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 • 3
How to use spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision with MLX:
# Make sure mlx-vlm is installed
# pip install --upgrade mlx-vlm
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from mlx_vlm.utils import load_config
# Load the model
model, processor = load("spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision")
config = load_config("spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision")
# Prepare input
image = ["http://images.cocodataset.org/val2017/000000039769.jpg"]
prompt = "Describe this image."
# Apply chat template
formatted_prompt = apply_chat_template(
processor, config, prompt, num_images=1
)
# Generate output
output = generate(model, processor, formatted_prompt, image)
print(output)How to use spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision with Pi:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision"
# 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/Gemma-4-26B-A4B-MLX-4.7bit-vision"
}
]
}
}
}# Start Pi in your project directory: pi
How to use spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision with OpenClaw:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision"
# 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/Gemma-4-26B-A4B-MLX-4.7bit-vision" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
openclaw agent --local --agent main --message "Hello from Hugging Face"
How to use spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision with Hermes Agent:
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision"
# 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/Gemma-4-26B-A4B-MLX-4.7bit-vision
hermes
Gemma-4-26B-A4B-it optimized for MLX. This quant supports image input and requires a vision-enabled MLX server.
EDIT April 5, 2026: Updated model for better performance / speed tradeoff, plus full precision vision embedding. Added benchmarks.
# Start server at http://localhost:8080/chat/completions
uvx --from mlx-vlm --with torchvision \
mlx_vlm.server \
--host 127.0.0.1 \
--port 8080 \
--model spicyneuron/Gemma-4-26B-A4B-MLX-4.7bit-vision
Quantized using a custom script inspired by Unsloth/AesSedai/ubergarm style mixed-precision GGUFs. MLX quantization options differ than llama.cpp, but the principles are the same:
| metric | mlx-community/gemma-4-26b-a4b-it-4bit | unsloth/gemma-4-26b-a4b-it-UD-MLX-4bit | 4.7 bit (this model) |
|---|---|---|---|
| bpw | 4.587 | 4.743 | 4.704 |
| peak mem | 15.312 | 15.804 | 15.681 |
| prompt proc (1024) | 2514.427 | 2508.474 | 2501.617 |
| token gen (512) | 97.214 | 92.890 | 91.860 |
| perplexity | 146.663 ± 0.921 | 211.070 ± 1.378 | 133.539 ± 0.827 |
| hellaswag | 0.525 ± 0.011 | 0.531 ± 0.011 | 0.532 ± 0.011 |
| piqa | 0.72 ± 0.01 | 0.712 ± 0.011 | 0.719 ± 0.01 |
| winogrande | 0.635 ± 0.014 | 0.635 ± 0.014 | 0.639 ± 0.014 |
language_model weights.allenai/tulu-3-sft-mixture.
Best to interpret it as weaker signal than the other benchmark results.Tested with:
mlx_lm.perplexity --sequence-length 4096 --seed 123
mlx_lm.benchmark --prompt-tokens 1024 --generation-tokens 512 --num-trials 5
mlx_lm.evaluate --tasks hellaswag --seed 123 --num-shots 0 --limit 2000
mlx_lm.evaluate --tasks piqa --seed 123 --num-shots 0 --limit 2000
mlx_lm.evaluate --tasks winogrande --seed 123 --num-shots 0 --limit 2000
4-bit