Instructions to use HCHs/RivetCoder-9B-A4B-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 HCHs/RivetCoder-9B-A4B-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 HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
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 HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
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 HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use HCHs/RivetCoder-9B-A4B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HCHs/RivetCoder-9B-A4B-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": "HCHs/RivetCoder-9B-A4B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
- Ollama
How to use HCHs/RivetCoder-9B-A4B-GGUF with Ollama:
ollama run hf.co/HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
- Unsloth Desktop
- Pi
How to use HCHs/RivetCoder-9B-A4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
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": "HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use HCHs/RivetCoder-9B-A4B-GGUF with Docker Model Runner:
docker model run hf.co/HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
- Lemonade
How to use HCHs/RivetCoder-9B-A4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.RivetCoder-9B-A4B-GGUF-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use HCHs/RivetCoder-9B-A4B-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 HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
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 HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use HCHs/RivetCoder-9B-A4B-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M
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 "HCHs/RivetCoder-9B-A4B-GGUF:Q4_K_M" \ --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"
RivetCoder-9B-A4B-GGUF
Q8_0 and Q4_K_M GGUF quantizations of HCHs/RivetCoder-9B-A4B. Both files were quantized directly from the canonical BF16 checkpoint, not from the FP8 distribution.
Compatibility: custom llama.cpp required
These GGUFs use general.architecture = rivetcoder, a computation graph that
is not present in stock llama.cpp. Use the Windows CUDA runtime supplied in
bundle/, or rebuild the supplied source overlay against the recorded
llama.cpp base commit.
At release time, ordinary llama.cpp, LM Studio, and Ollama builds cannot load
these files. Renaming the architecture to lfm2 is not a workaround because
that would omit the routed expert sidecar.
Files
| File | Bytes | SHA-256 | Purpose |
|---|---|---|---|
RivetCoder-9B-A4B-Q8_0.gguf |
9,296,262,848 | 6e71dd349df93f734b89fd70f2d0590037ddd3bdc11a4e9533991a0eab47b85e |
Higher fidelity |
RivetCoder-9B-A4B-Q4_K_M.gguf |
5,318,260,416 | 980adc81f64b52bc71228abd0e2bed02a1b6a00bdda9afbfd6d5e0c124ac5600 |
Lower VRAM |
bundle/rivetcoder-llama-windows-cuda-sm120.zip |
recorded in provenance/checksums.sha256 |
recorded in provenance/checksums.sha256 |
RTX 50-series CLI/server |
bundle/rivetcoder-llama-source-overlay.zip |
recorded in provenance/checksums.sha256 |
recorded in provenance/checksums.sha256 |
converter and runtime source overlay |
What was verified
The release criterion is runtime operation, not model-quality evaluation.
- BF16, Q8_0, and Q4_K_M all loaded with the custom CUDA llama.cpp build and
generated real tokens with exit code
0. - Q8_0 and Q4_K_M each passed the 506-tensor schema check.
- All 150 routing-control values matched the BF16 Hugging Face checkpoint.
- Router matrices, correction biases, token-gate weights and biases, and effective residual scales stayed F32 after quantization.
llama-serverloaded Q8_0 with full GPU offload and returnedGET /health -> {"status":"ok"}.- Q4_K_M also generated tokens with full GPU offload.
This is not a coding benchmark and makes no HumanEval, MBPP, SWE-bench, or general quality claim.
Test system: Windows x86-64, NVIDIA GeForce RTX 5070 Ti 16GB, driver 616.56,
CUDA Toolkit 13.1, custom llama.cpp base commit
ca3d5a3e10d53f7ea672cb9b6178faca3e2807bc.
Short one-turn runtime checks at a 512-token context measured approximately:
| Quant | Prompt | Generation |
|---|---|---|
| Q8_0 | 134.9 tok/s | 130.1 tok/s |
| Q4_K_M | 127.9 tok/s | 170.1 tok/s |
These are smoke-run timings, not controlled performance benchmarks.
Windows CUDA quick start
Extract bundle/rivetcoder-llama-windows-cuda-sm120.zip, then run:
.\llama-server.exe `
--model .\RivetCoder-9B-A4B-Q4_K_M.gguf `
--alias RivetCoder-9B-A4B `
--host 127.0.0.1 `
--port 8080 `
--n-gpu-layers all `
--ctx-size 4096 `
--parallel 1 `
--batch-size 512 `
--ubatch-size 256 `
--flash-attn on `
--reasoning-budget 512
For direct answers without a thinking trace, replace
--reasoning-budget 512 with --reasoning-budget 0. The embedded chat
template opens a thinking section by default, so an unlimited reasoning budget
can consume the entire output allowance before message.content is produced.
OpenAI-compatible request:
$body = @{
model = 'RivetCoder-9B-A4B'
messages = @(
@{ role = 'user'; content = 'Write a Python hello-world program.' }
)
temperature = 0
max_tokens = 512
} | ConvertTo-Json -Depth 8
Invoke-RestMethod `
-Method Post `
-Uri http://127.0.0.1:8080/v1/chat/completions `
-ContentType application/json `
-Body $body
The GGUF metadata declares a 131,072-token context. Release smoke tests used 512 and 4,096 tokens; 128K memory use and long-context quality were not tested.
Architecture retained in GGUF
Every one of the 30 LFM host layers keeps its native dense FFN and adds a sparse routed sidecar:
x = ffn_norm(hidden)
dense = LFM_dense_FFN(x)
experts = clamped SwiGLU experts selected by sigmoid Top-4 routing
gate = sigmoid(token_gate(x))
output = hidden + dense + effective_scale * gate * experts
There are 16 candidate experts per layer and four active experts per token.
The Hugging Face checkpoint stores a raw residual scale; conversion folds it
once as 0.1 * tanh(raw_scale). GGUF stores that signed effective F32 value,
and the C++ graph multiplies it directly without applying tanh again.
The graph also retains the post-sigmoid selection correction, normalized uncorrected routing weights, expert gate/up clamps, all 22 ShortConv layers, and all eight full-attention layers.
Runtime bundle
The Windows bundle is a static llama.cpp/ggml build with CUDA enabled,
GGML_NATIVE=OFF, an AVX2 CPU fallback, and sm_120a GPU code. It contains
llama-cli.exe, llama-server.exe, the required redistributable CUDA cuBLAS
and MSVC runtime DLLs, build metadata, and license notices. An NVIDIA driver
supporting the RTX 50 series is still required.
The source-overlay ZIP records every modified and new file relative to the exact upstream base commit so the converter/runtime can be rebuilt for other platforms. Stock upstream source plus only the GGUF files is insufficient.
License and attribution
The model remains subject to the LFM Open License v1.0 in LICENSE,
including its commercial-use conditions. Read the full license; this summary
is not legal advice.
GLM-derived expert weights originate from zai-org/GLM-5.3-Flash; its MIT
license is included at licenses/GLM-MIT.txt. The
custom llama.cpp runtime/source remains under llama.cpp's MIT license, with
third-party redistributable notices included in the runtime archive.
No Qwen weights are included. Qwen was used only as a sequence-level teacher during routing-control training.
- Downloads last month
- -
4-bit
8-bit
Model tree for HCHs/RivetCoder-9B-A4B-GGUF
Base model
HCHs/RivetCoder-9B-A4B