Instructions to use leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx 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("leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx") config = load_config("leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx") # 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) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx"
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": "leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx 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 "leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx"
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 leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx"
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 "leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx" \ --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"
leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx
This model was converted to MLX format from huihui-ai/Huihui-gemma-4-26B-A4B-it-abliterated using BaseQuant_XL 6/8-bit mixed quantization optimized for Apple Silicon. The vision encoder is preserved (full multimodal).
BaseQuant_XL keeps the most routing-critical layers in full bf16 precision — the MoE router.proj (gate) and the mlp (shared/dense expert that processes all tokens) — while applying aggressive quantization to the bulk parameters. Note: tie_word_embeddings=True means there is no separate lm_head (tied to embed_tokens).
This is the abliterated (uncensored) version of Gemma-4-26B-A4B, a 25.2B-parameter MoE (Mixture of Experts) model with 128 experts per layer (avg. 3.8B active parameters per token) and a vision encoder. The unquantized BF16 base was used as the source for maximum fidelity.
Note: This is a re-quantization from the correct non-QAT source (
huihui-ai/Huihui-gemma-4-26B-A4B-it-abliterated). The previous version of this model (Huihui-gemma-4-26B-A4B-it-qat-6bit-XL-mlx) was mistakenly quantized from the QAT variant and has been deprecated.
About XL Quantization
BaseQuant_XL is a fully data-agnostic, static quantization. No calibration dataset, no sensitivity analysis, no importance matrix. Precision is allocated purely by architectural role — routing-critical layers get higher precision, bulk expert parameters get lower precision. The result is a transparent, faithful capture of the source model.
Data-dependent calibration quantizations (iMatrix, AWQ, GPTQ, oQ, oQ4e, etc.) use a calibration set to guide bit allocation. This can produce a skewed representation of the model: domains well-represented in the calibration data (English, popular topics, public or leaked benchmarks) are preserved better, while underrepresented domains (non-English languages, niche use cases, your own data) are preserved worse. XL avoids this trade-off entirely — it generalizes honestly because it is never fit to any particular data distribution.
Use with mlx
pip install -U mlx-vlm
python -m mlx_vlm.generate --model leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx --max-tokens 256 --temperature 1.0 --top-p 1.0 --prompt "Hello"
BaseQuant_XL Quantization Strategy
| Bit Depth | Layers | Rationale |
|---|---|---|
| bf16 (unquantized) | router.proj (gate), mlp (shared/dense expert), vision tower |
Routing decisions and the dense expert that processes every token — errors here cascade through all tokens |
| 8-bit | embed_tokens, self_attn |
Every-token layers with moderate sensitivity — 8-bit is near-lossless |
| 6-bit | experts.switch_glu (routed experts) |
Bulk of parameters — only a subset of experts active per token |
Quantization Details
| Layer | Bits | Group Size |
|---|---|---|
router.proj (gate) |
bf16 | — |
mlp (shared/dense expert) |
bf16 | — |
| Vision tower (full) | bf16 | — |
embed_tokens |
8 | 64 |
self_attn |
8 | 64 |
experts.switch_glu (routed experts) |
6 | 64 |
| Default fallback | 8 | 64 |
- Quantization type: BaseQuant_XL mixed (multimodal, vision preserved)
- Bits per weight: ~7.1
- Total size: ~21 GB (5 shards)
- Group size: 64
- Method: Custom
quant_predicateviamlx_vlm - Note:
tie_word_embeddings=True— no separate lm_head
Recommended Inference Parameters
| Parameter | Value |
|---|---|
temperature |
1.0 |
top_p |
1.0 |
top_k |
64 |
min_p |
0.01 |
repeat_penalty |
1.05 |
Reasoning Parsing in LM Studio and Others
- Start string:
<|channel|>thought - End string:
<|channel|>
Chat Template
The chat template is synced to the canonical Google upstream version from google/gemma-4-26B-A4B-it/chat_template.jinja. Do not rely on the HF cache copy — it may be stale.
Key markers in the latest template: preserve_thinking, continues_into_next, prev_non_tool_role, null handling in format_argument.
The template is injected into both chat_template.jinja (standalone file) and tokenizer_config.json (chat_template JSON field).
- Downloads last month
- 123
6-bit
Model tree for leonsarmiento/Huihui-gemma-4-26B-A4B-it-6bit-XL-mlx
Base model
google/gemma-4-26B-A4B