Text Generation
MLX
Safetensors
gemma4
3-bit
gemma
instruction-tuned
reasoning
alignment
conversational
4-bit precision
Instructions to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6"
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 zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6
Run Hermes
hermes
- OpenClaw new
How to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6"
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 "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6 with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "zecanard/Gemopus-4-26B-A4B-it-MLX-3bit-mixed_3_6", "messages": [ {"role": "user", "content": "Hello"} ] }'
Syncing latest template update from Google.
Browse files- chat_template.jinja +25 -9
chat_template.jinja
CHANGED
|
@@ -8,12 +8,12 @@
|
|
| 8 |
{%- endif %}
|
| 9 |
{{- 'The current date is: ' + currentDate + ".\n\n" }}
|
| 10 |
{#- Template customizations by @zecanard. #}
|
| 11 |
-
{%- macro format_parameters(properties, required) -%}
|
| 12 |
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 13 |
{%- set ns = namespace(found_first=false) -%}
|
| 14 |
{%- for key, value in properties | dictsort -%}
|
| 15 |
{%- set add_comma = false -%}
|
| 16 |
-
{%- if key not in standard_keys -%}
|
| 17 |
{%- if ns.found_first %},{% endif -%}
|
| 18 |
{%- set ns.found_first = true -%}
|
| 19 |
{{ key }}:{
|
|
@@ -75,7 +75,7 @@
|
|
| 75 |
{%- elif value is mapping -%}
|
| 76 |
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 77 |
properties:{
|
| 78 |
-
{{- format_parameters(value, value['required'] | default([])) -}}
|
| 79 |
}
|
| 80 |
{%- endif -%}
|
| 81 |
{%- if value['required'] -%}
|
|
@@ -188,18 +188,21 @@
|
|
| 188 |
{#- Handle System/Tool Definitions Block -#}
|
| 189 |
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 190 |
{{- '<|turn>system\n' -}}
|
| 191 |
-
|
| 192 |
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 193 |
{%- if enable_thinking is defined and enable_thinking -%}
|
| 194 |
{{- '<|think|>\n' -}}
|
| 195 |
{%- set ns.prev_message_type = 'think' -%}
|
| 196 |
{%- endif -%}
|
| 197 |
-
|
| 198 |
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 199 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
{%- set loop_messages = messages[1:] -%}
|
| 201 |
{%- endif -%}
|
| 202 |
-
|
| 203 |
{%- if tools -%}
|
| 204 |
{%- for tool in tools %}
|
| 205 |
{{- '<|tool>' -}}
|
|
@@ -208,7 +211,6 @@
|
|
| 208 |
{%- endfor %}
|
| 209 |
{%- set ns.prev_message_type = 'tool' -%}
|
| 210 |
{%- endif -%}
|
| 211 |
-
|
| 212 |
{{- '<turn|>\n' -}}
|
| 213 |
{%- endif %}
|
| 214 |
|
|
@@ -303,6 +305,15 @@
|
|
| 303 |
{%- endif -%}
|
| 304 |
{%- endfor -%}
|
| 305 |
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 306 |
{%- else -%}
|
| 307 |
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 308 |
{%- endif -%}
|
|
@@ -312,6 +323,7 @@
|
|
| 312 |
{%- endfor -%}
|
| 313 |
{%- endif -%}
|
| 314 |
|
|
|
|
| 315 |
{%- if message['content'] is string -%}
|
| 316 |
{%- if role == 'model' -%}
|
| 317 |
{{- strip_thinking(message['content']) -}}
|
|
@@ -338,10 +350,14 @@
|
|
| 338 |
{%- endif -%}
|
| 339 |
{%- endfor -%}
|
| 340 |
{%- endif -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 341 |
|
| 342 |
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 343 |
{{- '<|tool_response>' -}}
|
| 344 |
-
{%- elif not (ns_tr_out.flag and not
|
| 345 |
{{- '<turn|>\n' -}}
|
| 346 |
{%- endif -%}
|
| 347 |
{%- endif -%}
|
|
|
|
| 8 |
{%- endif %}
|
| 9 |
{{- 'The current date is: ' + currentDate + ".\n\n" }}
|
| 10 |
{#- Template customizations by @zecanard. #}
|
| 11 |
+
{%- macro format_parameters(properties, required, filter_keys=false) -%}
|
| 12 |
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
|
| 13 |
{%- set ns = namespace(found_first=false) -%}
|
| 14 |
{%- for key, value in properties | dictsort -%}
|
| 15 |
{%- set add_comma = false -%}
|
| 16 |
+
{%- if not filter_keys or key not in standard_keys -%}
|
| 17 |
{%- if ns.found_first %},{% endif -%}
|
| 18 |
{%- set ns.found_first = true -%}
|
| 19 |
{{ key }}:{
|
|
|
|
| 75 |
{%- elif value is mapping -%}
|
| 76 |
{%- if add_comma %},{%- else -%} {%- set add_comma = true -%} {% endif -%}
|
| 77 |
properties:{
|
| 78 |
+
{{- format_parameters(value, value['required'] | default([]), filter_keys=true) -}}
|
| 79 |
}
|
| 80 |
{%- endif -%}
|
| 81 |
{%- if value['required'] -%}
|
|
|
|
| 188 |
{#- Handle System/Tool Definitions Block -#}
|
| 189 |
{%- if (enable_thinking is defined and enable_thinking) or tools or messages[0]['role'] in ['system', 'developer'] -%}
|
| 190 |
{{- '<|turn>system\n' -}}
|
|
|
|
| 191 |
{#- Inject Thinking token at the very top of the FIRST system turn -#}
|
| 192 |
{%- if enable_thinking is defined and enable_thinking -%}
|
| 193 |
{{- '<|think|>\n' -}}
|
| 194 |
{%- set ns.prev_message_type = 'think' -%}
|
| 195 |
{%- endif -%}
|
|
|
|
| 196 |
{%- if messages[0]['role'] in ['system', 'developer'] -%}
|
| 197 |
+
{%- if messages[0]['content'] is string -%}
|
| 198 |
+
{{- messages[0]['content'] | trim -}}
|
| 199 |
+
{%- elif messages[0]['content'] is sequence -%}
|
| 200 |
+
{%- for item in messages[0]['content'] -%}
|
| 201 |
+
{{- item['text'] | trim + ' '-}}
|
| 202 |
+
{%- endfor -%}
|
| 203 |
+
{%- endif -%}
|
| 204 |
{%- set loop_messages = messages[1:] -%}
|
| 205 |
{%- endif -%}
|
|
|
|
| 206 |
{%- if tools -%}
|
| 207 |
{%- for tool in tools %}
|
| 208 |
{{- '<|tool>' -}}
|
|
|
|
| 211 |
{%- endfor %}
|
| 212 |
{%- set ns.prev_message_type = 'tool' -%}
|
| 213 |
{%- endif -%}
|
|
|
|
| 214 |
{{- '<turn|>\n' -}}
|
| 215 |
{%- endif %}
|
| 216 |
|
|
|
|
| 305 |
{%- endif -%}
|
| 306 |
{%- endfor -%}
|
| 307 |
{{- format_tool_response_block(ns_tname.name, ns_txt.s) -}}
|
| 308 |
+
{%- for part in tool_body -%}
|
| 309 |
+
{%- if part.get('type') == 'image' -%}
|
| 310 |
+
{{- '<|image|>' -}}
|
| 311 |
+
{%- elif part.get('type') == 'audio' -%}
|
| 312 |
+
{{- '<|audio|>' -}}
|
| 313 |
+
{%- elif part.get('type') == 'video' -%}
|
| 314 |
+
{{- '<|video|>' -}}
|
| 315 |
+
{%- endif -%}
|
| 316 |
+
{%- endfor -%}
|
| 317 |
{%- else -%}
|
| 318 |
{{- format_tool_response_block(ns_tname.name, tool_body) -}}
|
| 319 |
{%- endif -%}
|
|
|
|
| 323 |
{%- endfor -%}
|
| 324 |
{%- endif -%}
|
| 325 |
|
| 326 |
+
{%- set captured_content -%}
|
| 327 |
{%- if message['content'] is string -%}
|
| 328 |
{%- if role == 'model' -%}
|
| 329 |
{{- strip_thinking(message['content']) -}}
|
|
|
|
| 350 |
{%- endif -%}
|
| 351 |
{%- endfor -%}
|
| 352 |
{%- endif -%}
|
| 353 |
+
{%- endset -%}
|
| 354 |
+
|
| 355 |
+
{{- captured_content -}}
|
| 356 |
+
{%- set has_content = captured_content | trim | length > 0 -%}
|
| 357 |
|
| 358 |
{%- if ns.prev_message_type == 'tool_call' and not ns_tr_out.flag -%}
|
| 359 |
{{- '<|tool_response>' -}}
|
| 360 |
+
{%- elif not (ns_tr_out.flag and not has_content) -%}
|
| 361 |
{{- '<turn|>\n' -}}
|
| 362 |
{%- endif -%}
|
| 363 |
{%- endif -%}
|