Instructions to use shdennlin/gemma-4-26B-A4B-it-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use shdennlin/gemma-4-26B-A4B-it-8bit 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("shdennlin/gemma-4-26B-A4B-it-8bit") config = load_config("shdennlin/gemma-4-26B-A4B-it-8bit") # 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 shdennlin/gemma-4-26B-A4B-it-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 "shdennlin/gemma-4-26B-A4B-it-8bit"
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": "shdennlin/gemma-4-26B-A4B-it-8bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use shdennlin/gemma-4-26B-A4B-it-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 "shdennlin/gemma-4-26B-A4B-it-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 shdennlin/gemma-4-26B-A4B-it-8bit
Run Hermes
hermes
- OpenClaw new
How to use shdennlin/gemma-4-26B-A4B-it-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 "shdennlin/gemma-4-26B-A4B-it-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 "shdennlin/gemma-4-26B-A4B-it-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"
gemma-4-26B-A4B-it-8bit
8-bit MLX build of Google's Gemma-4 26B (A4B-it) target model, intended for speculative decoding (MTP) paired with the matching 8-bit drafter: shdennlin/gemma-4-26B-A4B-it-assistant-8bit.
Lineage
google/gemma-4-26B-A4B-it
↓
mlx-community/gemma-4-26B-A4B-it-bf16 (bf16 MLX conversion)
↓
shdennlin/gemma-4-26B-A4B-it-8bit ← this model (affine 8-bit)
Quantization Details
| Field | Value |
|---|---|
| Method | MLX affine PTQ (no calibration data) |
| Bits | 8 |
| Group size | 64 |
| Mode | affine |
| Average | 8.674 bits/weight |
| Tool | mlx-vlm @ cbbc56f97861 (≡ 0.5.0) |
| Hardware | Apple M4 Pro, 64GB unified memory |
Why 8-bit instead of bf16
The bf16 target (52GB) exceeds the unified memory budget of a 64GB Mac when combined with the drafter, KV cache, and Metal overhead. The 8-bit build fits comfortably (26GB) while preserving MTP draft/target hidden-state compatibility when paired with a matching 8-bit drafter.
Usage (mlx-vlm speculative decoding)
mlx_vlm.server \
--model shdennlin/gemma-4-26B-A4B-it-8bit \
--draft-model shdennlin/gemma-4-26B-A4B-it-assistant-8bit \
--draft-kind mtp \
--draft-block-size 6 \
--port 8006
Caveats
- Dtype matching matters. MTP's hidden-state comparison can degrade when drafter and target dtypes diverge. This 8-bit target is intended to be paired with the matching 8-bit drafter above.
- Acceptance rate must be empirically verified. PTQ at 8-bit is usually lossless enough for greedy parity, but always measure on your workload.
License
Gemma Terms of Use — same as the upstream Google release.
- Downloads last month
- 5
8-bit