Instructions to use Myric/granite-4.0-h-small-APEX-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Myric/granite-4.0-h-small-APEX-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Myric/granite-4.0-h-small-APEX-GGUF", filename="granite-4.0-h-small-APEX-handroll.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Myric/granite-4.0-h-small-APEX-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/granite-4.0-h-small-APEX-GGUF
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/granite-4.0-h-small-APEX-GGUF
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Myric/granite-4.0-h-small-APEX-GGUF # Run inference directly in the terminal: ./llama-cli -hf Myric/granite-4.0-h-small-APEX-GGUF
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Myric/granite-4.0-h-small-APEX-GGUF # Run inference directly in the terminal: ./build/bin/llama-cli -hf Myric/granite-4.0-h-small-APEX-GGUF
Use Docker
docker model run hf.co/Myric/granite-4.0-h-small-APEX-GGUF
- LM Studio
- Jan
- vLLM
How to use Myric/granite-4.0-h-small-APEX-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Myric/granite-4.0-h-small-APEX-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Myric/granite-4.0-h-small-APEX-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Myric/granite-4.0-h-small-APEX-GGUF
- Ollama
How to use Myric/granite-4.0-h-small-APEX-GGUF with Ollama:
ollama run hf.co/Myric/granite-4.0-h-small-APEX-GGUF
- Unsloth Studio
How to use Myric/granite-4.0-h-small-APEX-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Myric/granite-4.0-h-small-APEX-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Myric/granite-4.0-h-small-APEX-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Myric/granite-4.0-h-small-APEX-GGUF to start chatting
- Pi
How to use Myric/granite-4.0-h-small-APEX-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Myric/granite-4.0-h-small-APEX-GGUF" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Myric/granite-4.0-h-small-APEX-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF
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 Myric/granite-4.0-h-small-APEX-GGUF
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use Myric/granite-4.0-h-small-APEX-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF
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 "Myric/granite-4.0-h-small-APEX-GGUF" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use Myric/granite-4.0-h-small-APEX-GGUF with Docker Model Runner:
docker model run hf.co/Myric/granite-4.0-h-small-APEX-GGUF
- Lemonade
How to use Myric/granite-4.0-h-small-APEX-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Myric/granite-4.0-h-small-APEX-GGUF
Run and chat with the model
lemonade run user.granite-4.0-h-small-APEX-GGUF-{{QUANT_TAG}}List all available models
lemonade list
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 "Myric/granite-4.0-h-small-APEX-GGUF" \
--custom-provider-id llama-cpp \
--custom-compatibility openai \
--custom-text-input \
--accept-risk \
--skip-healthRun OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"Granite-4.0-H-Small โ APEX GGUF
MoE-aware, mixed-precision APEX quantizations of
ibm-granite/granite-4.0-h-small
โ IBM's hybrid Mamba-2 / Transformer MoE (granitemoehybrid): 40 layers
(36 Mamba-2 + 4 attention), 64-routed + shared-expert MoE, ~32B total / ~9B active,
Apache-2.0. To my knowledge the first APEX quant of a 32B Granite hybrid.
Results & which file to pick
Perplexity on wikitext-2-raw (test, 200ร512-token windows), llama-perplexity.
All quants are imatrix-guided (diverse calibration).
| File | Size | BPW | PPL | ฮ vs bf16 | Fits (VRAM) |
|---|---|---|---|---|---|
| bf16 (reference) | 61 GB | 16.0 | 5.752 | โ | โ |
| APEX-i-quality | 21 GB | 5.44 | 5.781 | +0.50% | 24 GB โ best quality |
| APEX-i-compact | 16 GB | 4.13 | 5.998 | +4.28% | 24 GB |
| APEX-i-mini | 13 GB | 3.34 | 6.471 | +12.49% | 16 GB โ smallest, quality trade |
- i-quality โ recommended; near-lossless (+0.5%). Q6_K/Q5_K experts, Q8_0 shared, Q6_K attn/SSM.
- i-compact โ Q3_K mid experts; a real but usable quality step (+4.3%) for tighter fits.
- i-mini โ IQ2_S mid experts; smallest that stays coherent (16 GB cards), but a clear quality drop (+12.5%) โ pick it only when you must fit and can tolerate the hit.
Note on minimum size: Granite's routed-expert dim is 640 (not 256-divisible), so i-quants can't apply to the
ffn_down_expsโ they fall back to ~Q4_K. That floors the practical minimum around ~13 GB (i-mini) and, as a bonus, protects the down projections' quality. Going below that (nano/IQ1) buys little here.
Usage (llama.cpp)
llama-cli -m granite-4.0-h-small-APEX-i-quality.gguf -ngl 999 -p "Hello"
llama-server -m granite-4.0-h-small-APEX-i-compact.gguf -ngl 999 --host 0.0.0.0 --port 8080
Requires a llama.cpp build supporting the granitemoehybrid architecture.
Method
APEX = per-tensor-role, per-layer precision over stock llama-quantize --tensor-type-file.
Granite-H needed its Mamba-2 mixer tensors added to the map (the stock generator omits them):
- Mamba-2 (36 layers):
ssm_in,ssm_conv1d,ssm_outat mixer precision; 1-D state (ssm_a/d/dt/norm) left F32. - Attention (4 layers):
attn_q/k/v/output. - MoE (all 40): routed
ffn_*_expson a depth gradient; sharedffn_*_shexpat Q8_0/Q6_K.
Baseline: IBM's own f16 GGUF. imatrix from Bartowski calibration_datav3.
Config gen + patcher: configs/, patch_granite_config.py, REPRODUCE.md.
Null result: protecting the Mamba-2 recurrence doesn't help
A hand-roll pinning ssm_in/out/conv1d to Q8_0 (22 GB, PPL 5.779) was within noise of
i-quality โ the SSM/recurrence tensors aren't precision-sensitive. Consistent with the
same finding on Kimi-Linear's KDA and Granite-4.0-H-Tiny.
It is shipped here as granite-4.0-h-small-APEX-handroll.gguf for transparency and
reproduction, but there's no reason to use it โ it's slightly larger than i-quality
(22 GB vs 21 GB) for no measurable quality gain (PPL 5.779 vs 5.781). Use i-quality.
Attribution & licenses
See LICENSE (Apache-2.0) and NOTICE.
- Base: IBM (@ibm-granite) โ granite-4.0-h-small (Apache-2.0)
- Engine: llama.cpp (@ggml-org) (MIT)
- APEX: Ettore Di Giacinto / LocalAI (@mudler) โ localai-org/apex-quant (MIT)
- Calibration: Bartowski (@bartowski) โ calibration_datav3
Unofficial community quantization; not affiliated with or endorsed by IBM.
- Downloads last month
- 208
We're not able to determine the quantization variants.
Model tree for Myric/granite-4.0-h-small-APEX-GGUF
Base model
ibm-granite/granite-4.0-h-small
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp# Start a local OpenAI-compatible server: llama serve -hf Myric/granite-4.0-h-small-APEX-GGUF