Claude Code in a Box
Collection
How to replace Claude Code with a Mac Studio: https://spicyneuron.substack.com/p/a-mac-studio-for-local-ai-6-months • 5 items • Updated • 2
How to use spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit 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.5-397B-A17B-MLX-3.5bit")
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)How to use spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit"
# 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": "spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit"
}
]
}
}
}# Start Pi in your project directory: pi
How to use spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit"
# 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.5-397B-A17B-MLX-3.5bit
hermes
How to use spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit with MLX LM:
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit"
# Install MLX LM
uv tool install mlx-lm
# Start the server
mlx_lm.server --model "spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit"
# 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.5-397B-A17B-MLX-3.5bit",
"messages": [
{"role": "user", "content": "Hello"}
]
}'Qwen3.5-397B-A17B optimized for MLX!
Also available as a smaller 129GB version: https://huggingface.co/spicyneuron/Qwen3.5-397B-A17B-MLX-2.6bit
# Start server at http://localhost:8080/v1/chat/completions
uvx --from mlx-lm mlx_lm.server \
--host 127.0.0.1 \
--port 8080 \
--model spicyneuron/Qwen3.5-397B-A17B-MLX-3.5bit
Quantized with a mlx-lm fork, drawing inspiration from Unsloth/AesSedai/ubergarm style mixed-precision GGUFs. MLX quantization options differ than llama.cpp, but the principles are the same:
| metric | lmstudio-community 4 bit | 2.6 bit | 3.5 bit |
|---|---|---|---|
| perplexity | 3.919 ± 0.019 | 3.852 ± 0.018 | 3.919 ± 0.019 |
| hellaswag | 0.594 ± 0.022 | 0.598 ± 0.022 | 0.622 ± 0.022 |
| piqa | 0.798 ± 0.018 | 0.802 ± 0.018 | 0.804 ± 0.018 |
| winogrande | 0.744 ± 0.02 | 0.718 ± 0.02 | 0.746 ± 0.019 |
| p1024/g512 prompt | 490.702 | 489.545 | 479.453 |
| p1024/g512 gen | 39.192 | 38.398 | 35.547 |
| p1024/g512 mem | 225.095 | 131.523 | 179.842 |
3-bit
Base model
Qwen/Qwen3.5-397B-A17B