Instructions to use spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit 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("spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit") 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 spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit 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 "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit"
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 spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit"
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 "spicyneuron/Qwen3.6-35B-A3B-MLX-4.8bit" \ --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"
Delete chat_template.optional.jinja
Browse files- chat_template.optional.jinja +0 -155
chat_template.optional.jinja
DELETED
|
@@ -1,155 +0,0 @@
|
|
| 1 |
-
{#
|
| 2 |
-
Patched to improve prompt caching when thinking is disabled. Does not output
|
| 3 |
-
empty <think> tags at the beginning of the assistant response. Copy this into
|
| 4 |
-
chat_template.jinja to apply.
|
| 5 |
-
#}
|
| 6 |
-
{%- set image_count = namespace(value=0) %}
|
| 7 |
-
{%- set video_count = namespace(value=0) %}
|
| 8 |
-
{%- macro render_content(content, do_vision_count, is_system_content=false) %}
|
| 9 |
-
{%- if content is string %}
|
| 10 |
-
{{- content }}
|
| 11 |
-
{%- elif content is iterable and content is not mapping %}
|
| 12 |
-
{%- for item in content %}
|
| 13 |
-
{%- if 'image' in item or 'image_url' in item or item.type == 'image' %}
|
| 14 |
-
{%- if is_system_content %}
|
| 15 |
-
{{- raise_exception('System message cannot contain images.') }}
|
| 16 |
-
{%- endif %}
|
| 17 |
-
{%- if do_vision_count %}
|
| 18 |
-
{%- set image_count.value = image_count.value + 1 %}
|
| 19 |
-
{%- endif %}
|
| 20 |
-
{%- if add_vision_id %}
|
| 21 |
-
{{- 'Picture ' ~ image_count.value ~ ': ' }}
|
| 22 |
-
{%- endif %}
|
| 23 |
-
{{- '<|vision_start|><|image_pad|><|vision_end|>' }}
|
| 24 |
-
{%- elif 'video' in item or item.type == 'video' %}
|
| 25 |
-
{%- if is_system_content %}
|
| 26 |
-
{{- raise_exception('System message cannot contain videos.') }}
|
| 27 |
-
{%- endif %}
|
| 28 |
-
{%- if do_vision_count %}
|
| 29 |
-
{%- set video_count.value = video_count.value + 1 %}
|
| 30 |
-
{%- endif %}
|
| 31 |
-
{%- if add_vision_id %}
|
| 32 |
-
{{- 'Video ' ~ video_count.value ~ ': ' }}
|
| 33 |
-
{%- endif %}
|
| 34 |
-
{{- '<|vision_start|><|video_pad|><|vision_end|>' }}
|
| 35 |
-
{%- elif 'text' in item %}
|
| 36 |
-
{{- item.text }}
|
| 37 |
-
{%- else %}
|
| 38 |
-
{{- raise_exception('Unexpected item type in content.') }}
|
| 39 |
-
{%- endif %}
|
| 40 |
-
{%- endfor %}
|
| 41 |
-
{%- elif content is none or content is undefined %}
|
| 42 |
-
{{- '' }}
|
| 43 |
-
{%- else %}
|
| 44 |
-
{{- raise_exception('Unexpected content type.') }}
|
| 45 |
-
{%- endif %}
|
| 46 |
-
{%- endmacro %}
|
| 47 |
-
{%- if not messages %}
|
| 48 |
-
{{- raise_exception('No messages provided.') }}
|
| 49 |
-
{%- endif %}
|
| 50 |
-
{%- if tools and tools is iterable and tools is not mapping %}
|
| 51 |
-
{{- '<|im_start|>system\n' }}
|
| 52 |
-
{{- "# Tools\n\nYou have access to the following functions:\n\n<tools>" }}
|
| 53 |
-
{%- for tool in tools %}
|
| 54 |
-
{{- "\n" }}
|
| 55 |
-
{{- tool | tojson }}
|
| 56 |
-
{%- endfor %}
|
| 57 |
-
{{- "\n</tools>" }}
|
| 58 |
-
{{- '\n\nIf you choose to call a function ONLY reply in the following format with NO suffix:\n\n<tool_call>\n<function=example_function_name>\n<parameter=example_parameter_1>\nvalue_1\n</parameter>\n<parameter=example_parameter_2>\nThis is the value for the second parameter\nthat can span\nmultiple lines\n</parameter>\n</function>\n</tool_call>\n\n<IMPORTANT>\nReminder:\n- Function calls MUST follow the specified format: an inner <function=...></function> block must be nested within <tool_call></tool_call> XML tags\n- Required parameters MUST be specified\n- You may provide optional reasoning for your function call in natural language BEFORE the function call, but NOT after\n- If there is no function call available, answer the question like normal with your current knowledge and do not tell the user about function calls\n</IMPORTANT>' }}
|
| 59 |
-
{%- if messages[0].role == 'system' %}
|
| 60 |
-
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 61 |
-
{%- if content %}
|
| 62 |
-
{{- '\n\n' + content }}
|
| 63 |
-
{%- endif %}
|
| 64 |
-
{%- endif %}
|
| 65 |
-
{{- '<|im_end|>\n' }}
|
| 66 |
-
{%- else %}
|
| 67 |
-
{%- if messages[0].role == 'system' %}
|
| 68 |
-
{%- set content = render_content(messages[0].content, false, true)|trim %}
|
| 69 |
-
{{- '<|im_start|>system\n' + content + '<|im_end|>\n' }}
|
| 70 |
-
{%- endif %}
|
| 71 |
-
{%- endif %}
|
| 72 |
-
{%- set ns = namespace(multi_step_tool=true, last_query_index=messages|length - 1) %}
|
| 73 |
-
{%- for message in messages[::-1] %}
|
| 74 |
-
{%- set index = (messages|length - 1) - loop.index0 %}
|
| 75 |
-
{%- if ns.multi_step_tool and message.role == "user" %}
|
| 76 |
-
{%- set content = render_content(message.content, false)|trim %}
|
| 77 |
-
{%- if not(content.startswith('<tool_response>') and content.endswith('</tool_response>')) %}
|
| 78 |
-
{%- set ns.multi_step_tool = false %}
|
| 79 |
-
{%- set ns.last_query_index = index %}
|
| 80 |
-
{%- endif %}
|
| 81 |
-
{%- endif %}
|
| 82 |
-
{%- endfor %}
|
| 83 |
-
{%- if ns.multi_step_tool %}
|
| 84 |
-
{{- raise_exception('No user query found in messages.') }}
|
| 85 |
-
{%- endif %}
|
| 86 |
-
{%- for message in messages %}
|
| 87 |
-
{%- set content = render_content(message.content, true)|trim %}
|
| 88 |
-
{%- if message.role == "system" %}
|
| 89 |
-
{%- if not loop.first %}
|
| 90 |
-
{{- raise_exception('System message must be at the beginning.') }}
|
| 91 |
-
{%- endif %}
|
| 92 |
-
{%- elif message.role == "user" %}
|
| 93 |
-
{{- '<|im_start|>' + message.role + '\n' + content + '<|im_end|>' + '\n' }}
|
| 94 |
-
{%- elif message.role == "assistant" %}
|
| 95 |
-
{%- set reasoning_content = '' %}
|
| 96 |
-
{%- if message.reasoning_content is string %}
|
| 97 |
-
{%- set reasoning_content = message.reasoning_content %}
|
| 98 |
-
{%- else %}
|
| 99 |
-
{%- if '</think>' in content %}
|
| 100 |
-
{%- set reasoning_content = content.split('</think>')[0].rstrip('\n').split('<think>')[-1].lstrip('\n') %}
|
| 101 |
-
{%- set content = content.split('</think>')[-1].lstrip('\n') %}
|
| 102 |
-
{%- endif %}
|
| 103 |
-
{%- endif %}
|
| 104 |
-
{%- set reasoning_content = reasoning_content|trim %}
|
| 105 |
-
{%- if (preserve_thinking is defined and preserve_thinking is true) or (loop.index0 > ns.last_query_index) %}
|
| 106 |
-
{{- '<|im_start|>' + message.role + '\n<think>\n' + reasoning_content + '\n</think>\n\n' + content }}
|
| 107 |
-
{%- else %}
|
| 108 |
-
{{- '<|im_start|>' + message.role + '\n' + content }}
|
| 109 |
-
{%- endif %}
|
| 110 |
-
{%- if message.tool_calls and message.tool_calls is iterable and message.tool_calls is not mapping %}
|
| 111 |
-
{%- for tool_call in message.tool_calls %}
|
| 112 |
-
{%- if tool_call.function is defined %}
|
| 113 |
-
{%- set tool_call = tool_call.function %}
|
| 114 |
-
{%- endif %}
|
| 115 |
-
{%- if loop.first %}
|
| 116 |
-
{%- if content|trim %}
|
| 117 |
-
{{- '\n\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 118 |
-
{%- else %}
|
| 119 |
-
{{- '<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 120 |
-
{%- endif %}
|
| 121 |
-
{%- else %}
|
| 122 |
-
{{- '\n<tool_call>\n<function=' + tool_call.name + '>\n' }}
|
| 123 |
-
{%- endif %}
|
| 124 |
-
{%- if tool_call.arguments is defined %}
|
| 125 |
-
{%- for args_name, args_value in tool_call.arguments|items %}
|
| 126 |
-
{{- '<parameter=' + args_name + '>\n' }}
|
| 127 |
-
{%- set args_value = args_value | string if args_value is string else args_value | tojson | safe %}
|
| 128 |
-
{{- args_value }}
|
| 129 |
-
{{- '\n</parameter>\n' }}
|
| 130 |
-
{%- endfor %}
|
| 131 |
-
{%- endif %}
|
| 132 |
-
{{- '</function>\n</tool_call>' }}
|
| 133 |
-
{%- endfor %}
|
| 134 |
-
{%- endif %}
|
| 135 |
-
{{- '<|im_end|>\n' }}
|
| 136 |
-
{%- elif message.role == "tool" %}
|
| 137 |
-
{%- if loop.previtem and loop.previtem.role != "tool" %}
|
| 138 |
-
{{- '<|im_start|>user' }}
|
| 139 |
-
{%- endif %}
|
| 140 |
-
{{- '\n<tool_response>\n' }}
|
| 141 |
-
{{- content }}
|
| 142 |
-
{{- '\n</tool_response>' }}
|
| 143 |
-
{%- if not loop.last and loop.nextitem.role != "tool" %}
|
| 144 |
-
{{- '<|im_end|>\n' }}
|
| 145 |
-
{%- elif loop.last %}
|
| 146 |
-
{{- '<|im_end|>\n' }}
|
| 147 |
-
{%- endif %}
|
| 148 |
-
{%- else %}
|
| 149 |
-
{{- raise_exception('Unexpected message role.') }}
|
| 150 |
-
{%- endif %}
|
| 151 |
-
{%- endfor %}
|
| 152 |
-
{%- if add_generation_prompt %}
|
| 153 |
-
{{- '<|im_start|>assistant\n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