Text Generation
GGUF
Mixture of Experts
apex
quantized
granite
mamba
hybrid
llama.cpp
imatrix
conversational
Instructions to use Myric/granite-4.0-h-tiny-APEX-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Myric/granite-4.0-h-tiny-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-tiny-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/granite-4.0-h-tiny-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-tiny-APEX-GGUF # Run inference directly in the terminal: llama cli -hf Myric/granite-4.0-h-tiny-APEX-GGUF
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf Myric/granite-4.0-h-tiny-APEX-GGUF # Run inference directly in the terminal: ./build/bin/llama cli -hf Myric/granite-4.0-h-tiny-APEX-GGUF
Use Docker
docker model run hf.co/Myric/granite-4.0-h-tiny-APEX-GGUF
- Llama new
- LM Studio
- Jan
- vLLM
How to use Myric/granite-4.0-h-tiny-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-tiny-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-tiny-APEX-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Myric/granite-4.0-h-tiny-APEX-GGUF
- Ollama
How to use Myric/granite-4.0-h-tiny-APEX-GGUF with Ollama:
ollama run hf.co/Myric/granite-4.0-h-tiny-APEX-GGUF
- Unsloth Desktop
- Pi
How to use Myric/granite-4.0-h-tiny-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-tiny-APEX-GGUF
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/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-tiny-APEX-GGUF" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Myric/granite-4.0-h-tiny-APEX-GGUF with Docker Model Runner:
docker model run hf.co/Myric/granite-4.0-h-tiny-APEX-GGUF
- Lemonade
How to use Myric/granite-4.0-h-tiny-APEX-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Myric/granite-4.0-h-tiny-APEX-GGUF
Run and chat with the model
lemonade run user.granite-4.0-h-tiny-APEX-GGUF-{{QUANT_TAG}}List all available models
lemonade list
- Hermes Agent
How to use Myric/granite-4.0-h-tiny-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-tiny-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-tiny-APEX-GGUF
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Myric/granite-4.0-h-tiny-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-tiny-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-tiny-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"
Upload patch_granite_config.py with huggingface_hub
Browse files- patch_granite_config.py +38 -0
patch_granite_config.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Adapt an APEX generate_config.sh output for Granite-4.0-H-Tiny (granitemoehybrid).
|
| 3 |
+
|
| 4 |
+
Hybrid: 36 Mamba-2 layers (ssm_in/out/conv1d) + 4 attention layers (plain MHA) +
|
| 5 |
+
MoE (64 routed + shared expert) on every layer. The stock generator emits
|
| 6 |
+
ffn_*_exps/shexp, attn_q/k/v/output, and ssm_out — but MISSES the Mamba-2
|
| 7 |
+
input/conv projections. We add ssm_in + ssm_conv1d at the mixer precision, and
|
| 8 |
+
drop tensors Granite doesn't have. 1-D SSM state (ssm_a/d/dt/norm) stays F32.
|
| 9 |
+
|
| 10 |
+
--ssm-type pins the Mamba-2 mixer projections (ssm_in/out/conv1d) higher (e.g.
|
| 11 |
+
Q8_0) to test whether protecting the recurrence helps (the hand-roll variant).
|
| 12 |
+
"""
|
| 13 |
+
import argparse, re
|
| 14 |
+
DROP = {"attn_gate","attn_qkv","shortconv.in_proj","shortconv.out_proj","ssm_alpha","ssm_beta"}
|
| 15 |
+
ADD = ["ssm_in","ssm_conv1d"] # ssm_out already emitted by the generator
|
| 16 |
+
SSM_ALL = ["ssm_in","ssm_out","ssm_conv1d"]
|
| 17 |
+
|
| 18 |
+
def main():
|
| 19 |
+
ap=argparse.ArgumentParser(); ap.add_argument("infile"); ap.add_argument("outfile")
|
| 20 |
+
ap.add_argument("--ssm-type",default=None,help="override Mamba-2 mixer tensors (e.g. Q8_0)")
|
| 21 |
+
a=ap.parse_args()
|
| 22 |
+
out=[]
|
| 23 |
+
for l in (x.strip() for x in open(a.infile) if x.strip()):
|
| 24 |
+
m=re.match(r"blk\.\d+\.([\w.]+)=",l); tail=m.group(1) if m else ""
|
| 25 |
+
if tail in DROP: continue
|
| 26 |
+
# optionally bump ssm_out (already present) to the mixer override type
|
| 27 |
+
mo_out=re.match(r"(blk\.\d+\.ssm_out)=(\S+)",l)
|
| 28 |
+
if mo_out and a.ssm_type:
|
| 29 |
+
out.append(f"{mo_out.group(1)}={a.ssm_type}"); continue
|
| 30 |
+
out.append(l)
|
| 31 |
+
mo=re.match(r"blk\.(\d+)\.attn_output=(\S+)",l)
|
| 32 |
+
if mo:
|
| 33 |
+
n,t=mo.group(1),mo.group(2)
|
| 34 |
+
st=a.ssm_type or t
|
| 35 |
+
for name in ADD: out.append(f"blk.{n}.{name}={st}")
|
| 36 |
+
open(a.outfile,"w").write("\n".join(out)+"\n")
|
| 37 |
+
print(f"wrote {a.outfile} ({len(out)} lines)")
|
| 38 |
+
if __name__=="__main__": main()
|