Instructions to use Itopoly/G9v3-3B-Q3_K_M-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M # Run inference directly in the terminal: llama cli -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M # Run inference directly in the terminal: ./llama-cli -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Use Docker
docker model run hf.co/Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
- LM Studio
- Jan
- vLLM
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Itopoly/G9v3-3B-Q3_K_M-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Itopoly/G9v3-3B-Q3_K_M-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
- Ollama
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with Ollama:
ollama run hf.co/Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
- Unsloth Desktop
- Pi
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with Docker Model Runner:
docker model run hf.co/Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
- Lemonade
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Run and chat with the model
lemonade run user.G9v3-3B-Q3_K_M-GGUF-Q3_K_M
List all available models
lemonade list
- Hermes Agent
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Itopoly/G9v3-3B-Q3_K_M-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Itopoly/G9v3-3B-Q3_K_M-GGUF:Q3_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Upload g9v3_chat_template_low.jinja with huggingface_hub
Browse files- g9v3_chat_template_low.jinja +203 -0
g9v3_chat_template_low.jinja
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token }}{%- set resolved_reasoning_effort = reasoning_effort|default('low') %}
|
| 2 |
+
{%- set reasoning_instructions = '' %}
|
| 3 |
+
{%- if enable_thinking is not defined or enable_thinking is true %}
|
| 4 |
+
{%- if resolved_reasoning_effort == 'low' %}
|
| 5 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to low. Keep your thinking brief and focused, moving directly to the conclusion without unnecessary elaboration.' %}
|
| 6 |
+
{%- elif resolved_reasoning_effort == 'medium' %}
|
| 7 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to medium. Think through the task with a moderate amount of reasoning before answering.' %}
|
| 8 |
+
{%- elif resolved_reasoning_effort == 'xhigh' %}
|
| 9 |
+
{%- set reasoning_instructions = 'Reasoning effort is set to xhigh. Please think carefully through the task, validate key assumptions, consider plausible alternatives, and prioritize correctness, consistency, and clarity in the final answer.' %}
|
| 10 |
+
{%- endif %}
|
| 11 |
+
{%- endif %}
|
| 12 |
+
{%- set tone_instructions = 'Tone and formatting: respond like a friendly, knowledgeable colleague. Use warm, complete sentences in short readable paragraphs. Be concise but never clipped or robotic. Avoid bullet lists and headings unless the user asks for steps or the content is genuinely a list.' %}
|
| 13 |
+
{%- set reasoning_instructions = ((reasoning_instructions ~ '\n\n') if reasoning_instructions else '') ~ tone_instructions %}
|
| 14 |
+
{%- if tools %}
|
| 15 |
+
{%- set tool_definitions %}
|
| 16 |
+
{{- "# Tools\n\nYou are provided with function signatures within <tools></tools> XML tags:\n<tools>" }}
|
| 17 |
+
{%- for tool in tools %}
|
| 18 |
+
{{- "\n" }}
|
| 19 |
+
{{- tool | tojson(ensure_ascii=False) }}
|
| 20 |
+
{%- endfor %}
|
| 21 |
+
{{- '\n</tools>\n\nTool usage guidelines:\n- You may call zero or more functions. If no function calls are needed, just answer normally and do not include any <function ... </function>.\n- When calling a function, return an XML object within <function ... </function> using:\n<function name="function-name"><param name="param-name">param-value</param></function>\n- param-value may be multi-line. If it contains <, & or newline characters, wrap it in a CDATA block: <param name="param-name"><![CDATA[...multi-line value...]]></param>' }}
|
| 22 |
+
{%- endset %}
|
| 23 |
+
|
| 24 |
+
{{- '<|im_start|>system\n' }}
|
| 25 |
+
{%- if messages[0].role == 'system' %}
|
| 26 |
+
{%- if '<tool_def_sep>' in messages[0].content %}
|
| 27 |
+
{{- (reasoning_instructions + '\n\n' if reasoning_instructions else '') + messages[0].content.replace('<tool_def_sep>', tool_definitions) }}
|
| 28 |
+
{%- else %}
|
| 29 |
+
{{- (reasoning_instructions + '\n\n' if reasoning_instructions else '') + messages[0].content + '\n\n' + tool_definitions }}
|
| 30 |
+
{%- endif %}
|
| 31 |
+
{%- else %}
|
| 32 |
+
{{- (reasoning_instructions + '\n\n' if reasoning_instructions else '') + tool_definitions.lstrip() }}
|
| 33 |
+
{%- endif %}
|
| 34 |
+
{{- '<|im_end|>\n' }}
|
| 35 |
+
{%- else %}
|
| 36 |
+
{%- if messages[0].role == 'system' %}
|
| 37 |
+
{{- '<|im_start|>system\n' + (reasoning_instructions + '\n\n' if reasoning_instructions else '') + messages[0].content + '<|im_end|>\n' }}
|
| 38 |
+
{%- elif reasoning_instructions %}
|
| 39 |
+
{{- '<|im_start|>system\n' + reasoning_instructions + '<|im_end|>\n' }}
|
| 40 |
+
{%- endif %}
|
| 41 |
+
{%- endif %}
|
| 42 |
+
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 43 |
+
{%- for message in messages[::-1] %}
|
| 44 |
+
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 45 |
+
{%- if ns.multi_step_tool and message.role == "user" and message.content is string and not(message.content.startswith('<tool_response>') and message.content.endswith('</tool_response>')) %}
|
| 46 |
+
{%- set ns.multi_step_tool = false %}
|
| 47 |
+
{%- set ns.last_query_index = index %}
|
| 48 |
+
{%- endif %}
|
| 49 |
+
{%- endfor %}
|
| 50 |
+
{%- for message in messages %}
|
| 51 |
+
{%- if message.content is string %}
|
| 52 |
+
{%- set content = message.content %}
|
| 53 |
+
{%- else %}
|
| 54 |
+
{%- set content = '' %}
|
| 55 |
+
{%- endif %}
|
| 56 |
+
{%- if (message.role == "user") or (message.role == "system" and not loop.first) %}
|
| 57 |
+
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 58 |
+
{%- elif message.role == "assistant" %}
|
| 59 |
+
{%- set tool_calls_norm = message.tool_calls or ([{'function': message.function_call}] if message.function_call is defined and message.function_call else []) %}
|
| 60 |
+
{%- set reasoning_content = '' %}
|
| 61 |
+
{%- if message.reasoning_content is string %}
|
| 62 |
+
{%- set reasoning_content = message.reasoning_content %}
|
| 63 |
+
{%- else %}
|
| 64 |
+
{%- if '</think>' in content %}
|
| 65 |
+
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 66 |
+
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 67 |
+
{%- endif %}
|
| 68 |
+
{%- endif %}
|
| 69 |
+
|
| 70 |
+
{%- if tool_calls_norm %}
|
| 71 |
+
{%- set content_parts = content.split('<tool_sep>') %}
|
| 72 |
+
{%- set processed_content = content_parts[0] %}
|
| 73 |
+
{%- set tool_calls_count = tool_calls_norm|length %}
|
| 74 |
+
{%- set tool_sep_count = content_parts|length - 1 %}
|
| 75 |
+
{%- set min_count = [tool_calls_count, tool_sep_count]|min %}
|
| 76 |
+
|
| 77 |
+
{%- for i in range(1, content_parts|length) %}
|
| 78 |
+
{%- set tool_index = i - 1 %}
|
| 79 |
+
{%- if tool_index < tool_calls_count %}
|
| 80 |
+
{%- set tool_call = tool_calls_norm[tool_index] %}
|
| 81 |
+
{%- if tool_call.function %}
|
| 82 |
+
{%- set tool_call = tool_call.function %}
|
| 83 |
+
{%- endif %}
|
| 84 |
+
{%- set single_tool_xml %}
|
| 85 |
+
{{- '<function name="' ~ tool_call.name ~ '">' }}
|
| 86 |
+
{%- if tool_call.arguments %}
|
| 87 |
+
{%- set args_dict = tool_call.arguments %}
|
| 88 |
+
{%- for param_name, param_value in args_dict.items() %}
|
| 89 |
+
{{- '<param name="' ~ param_name ~ '">' }}
|
| 90 |
+
{%- if param_value is string and ('<' in param_value or '&' in param_value or '\n' in param_value) %}
|
| 91 |
+
{{- '<![CDATA[' + param_value + ']]>' }}
|
| 92 |
+
{%- else %}
|
| 93 |
+
{{- param_value }}
|
| 94 |
+
{%- endif %}
|
| 95 |
+
{{- '</param>' }}
|
| 96 |
+
{%- endfor %}
|
| 97 |
+
{%- endif %}
|
| 98 |
+
{{- '</function>' }}
|
| 99 |
+
{%- endset %}
|
| 100 |
+
{%- set processed_content = processed_content + single_tool_xml + content_parts[i] %}
|
| 101 |
+
{%- else %}
|
| 102 |
+
{%- set processed_content = processed_content + content_parts[i] %}
|
| 103 |
+
{%- endif %}
|
| 104 |
+
{%- endfor %}
|
| 105 |
+
|
| 106 |
+
{%- if tool_calls_count > tool_sep_count %}
|
| 107 |
+
{%- for remaining_index in range(tool_sep_count, tool_calls_count) %}
|
| 108 |
+
{%- set tool_call = tool_calls_norm[remaining_index] %}
|
| 109 |
+
{%- if tool_call.function %}
|
| 110 |
+
{%- set tool_call = tool_call.function %}
|
| 111 |
+
{%- endif %}
|
| 112 |
+
{%- set remaining_tool_xml %}
|
| 113 |
+
{{- '<function name="' ~ tool_call.name ~ '">' }}
|
| 114 |
+
{%- if tool_call.arguments %}
|
| 115 |
+
{%- if tool_call.arguments is mapping %}
|
| 116 |
+
{%- set args_dict = tool_call.arguments %}
|
| 117 |
+
{%- for param_name, param_value in args_dict.items() %}
|
| 118 |
+
{{- '<param name="' ~ param_name ~ '">' }}
|
| 119 |
+
{%- if param_value is string and ('<' in param_value or '&' in param_value or '\n' in param_value) %}
|
| 120 |
+
{{- '<![CDATA[' + param_value + ']]>' }}
|
| 121 |
+
{%- else %}
|
| 122 |
+
{{- param_value }}
|
| 123 |
+
{%- endif %}
|
| 124 |
+
{{- '</param>' }}
|
| 125 |
+
{%- endfor %}
|
| 126 |
+
{%- else %}
|
| 127 |
+
{#- legacy function_call: arguments arrives as a JSON string; emit verbatim #}
|
| 128 |
+
{{- tool_call.arguments }}
|
| 129 |
+
{%- endif %}
|
| 130 |
+
{%- endif %}
|
| 131 |
+
{{- '</function>' }}
|
| 132 |
+
{%- endset %}
|
| 133 |
+
{%- set processed_content = processed_content + remaining_tool_xml %}
|
| 134 |
+
{%- endfor %}
|
| 135 |
+
{%- endif %}
|
| 136 |
+
|
| 137 |
+
{%- set content = processed_content %}
|
| 138 |
+
{%- endif %}
|
| 139 |
+
|
| 140 |
+
{%- if reasoning_content %}
|
| 141 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content.strip('\n') + '\n</think>\n\n' + content.lstrip('\n') }}
|
| 142 |
+
{%- elif '<think>' not in content and '</think>' not in content %}
|
| 143 |
+
{{- '<|im_start|>' + message.role + '\n<think>\n\n</think>\n\n' + content.lstrip('\n') }}
|
| 144 |
+
{%- else %}
|
| 145 |
+
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 146 |
+
{%- endif %}
|
| 147 |
+
|
| 148 |
+
{%- if tool_calls_norm and not has_tool_sep %}
|
| 149 |
+
{%- for tool_call in tool_calls_norm %}
|
| 150 |
+
{%- if (loop.first and content) or (not loop.first) %}
|
| 151 |
+
{{- '\n' }}
|
| 152 |
+
{%- endif %}
|
| 153 |
+
{%- if tool_call.function %}
|
| 154 |
+
{%- set tool_call = tool_call.function %}
|
| 155 |
+
{%- endif %}
|
| 156 |
+
{{- '<function name="' ~ tool_call.name ~ '">' }}
|
| 157 |
+
{%- if tool_call.arguments %}
|
| 158 |
+
{%- if tool_call.arguments is mapping %}
|
| 159 |
+
{%- set args_dict = tool_call.arguments %}
|
| 160 |
+
{%- for param_name, param_value in args_dict.items() %}
|
| 161 |
+
{{- '<param name="' ~ param_name ~ '">' }}
|
| 162 |
+
{%- if param_value is string and ('<' in param_value or '&' in param_value or '\n' in param_value) %}
|
| 163 |
+
{{- '<![CDATA[' + param_value + ']]>' }}
|
| 164 |
+
{%- else %}
|
| 165 |
+
{{- param_value }}
|
| 166 |
+
{%- endif %}
|
| 167 |
+
{{- '</param>' }}
|
| 168 |
+
{%- endfor %}
|
| 169 |
+
{%- else %}
|
| 170 |
+
{#- legacy function_call: arguments arrives as a JSON string; emit verbatim #}
|
| 171 |
+
{{- tool_call.arguments }}
|
| 172 |
+
{%- endif %}
|
| 173 |
+
{%- endif %}
|
| 174 |
+
{{- '</function>' }}
|
| 175 |
+
{%- endfor %}
|
| 176 |
+
{%- endif %}
|
| 177 |
+
{{- '<|im_end|>\n' }}
|
| 178 |
+
{%- elif message.role == "tool" or message.role == "function" %}
|
| 179 |
+
{%- if loop.first or (messages[loop.index0 - 1].role not in ("tool", "function")) %}
|
| 180 |
+
{{- '<|im_start|>user' }}
|
| 181 |
+
{%- endif %}
|
| 182 |
+
{{- '\n<tool_response>\n' }}
|
| 183 |
+
{%- if message.content is string %}
|
| 184 |
+
{{- content }}
|
| 185 |
+
{%- else %}
|
| 186 |
+
{{- message.content | tojson(ensure_ascii=False) }}
|
| 187 |
+
{%- endif %}
|
| 188 |
+
{{- '\n</tool_response>' }}
|
| 189 |
+
{%- if loop.last or (messages[loop.index0 + 1].role not in ("tool", "function")) %}
|
| 190 |
+
{{- '<|im_end|>\n' }}
|
| 191 |
+
{%- endif %}
|
| 192 |
+
{%- endif %}
|
| 193 |
+
{%- endfor %}
|
| 194 |
+
{%- if add_generation_prompt %}
|
| 195 |
+
{{- '<|im_start|>assistant\n' }}
|
| 196 |
+
{%- if enable_thinking is defined %}
|
| 197 |
+
{%- if enable_thinking is false %}
|
| 198 |
+
{{- '<think>\n\n</think>\n\n' }}
|
| 199 |
+
{%- elif enable_thinking is true %}
|
| 200 |
+
{{- '<think>\n' }}
|
| 201 |
+
{%- endif %}
|
| 202 |
+
{%- endif %}
|
| 203 |
+
{%- endif %}
|