Text Generation
Transformers
Safetensors
English
Korean
code
fuse_glm
custom_code
lfm2
glm
mixture-of-experts
routed-experts
coding
code-generation
agentic
bf16
top-k-routing
trust-remote-code
conversational
Instructions to use HCHs/RivetCoder-9B-A4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HCHs/RivetCoder-9B-A4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HCHs/RivetCoder-9B-A4B", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("HCHs/RivetCoder-9B-A4B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HCHs/RivetCoder-9B-A4B 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" # 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", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HCHs/RivetCoder-9B-A4B
- SGLang
How to use HCHs/RivetCoder-9B-A4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "HCHs/RivetCoder-9B-A4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HCHs/RivetCoder-9B-A4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "HCHs/RivetCoder-9B-A4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HCHs/RivetCoder-9B-A4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HCHs/RivetCoder-9B-A4B with Docker Model Runner:
docker model run hf.co/HCHs/RivetCoder-9B-A4B
| # Attribution notice | |
| RivetCoder-9B-A4B combines the following sources: | |
| - Host model: `LiquidAI/LFM2.5-2.6B`, revision | |
| `654f9463ce32b05d0429d76fe1f580b27d4c1ac0`, under the LFM Open License v1.0. | |
| - Expert donor: `zai-org/GLM-5.3-Flash`, revision | |
| `3f1971b7b5f7a528c9c4ef6212c8785298a8c24a`, under the MIT License. | |
| - Router sequence teacher: `qwen/qwen3.8-27b`, accessed through a local LM Studio | |
| endpoint. No Qwen weights are included. | |
| - Architectural reference: `Akahsizrr/fuse-1-Lite`, revision | |
| `430c959e47556ae53fed18a9d97f7cf30876e6ff`. | |
| Modifications and new work include GLM expert selection, a fixed tied | |
| identity-Hadamard bridge, expert/router weight folding, per-layer Top-4 routing, | |
| token gating, bounded residual scaling, Qwen-supervised routing-control training, | |
| and the custom `fuse_glm` Transformers implementation shipped in this repository. | |
| See `provenance/` for the complete local build record with personal filesystem | |
| paths removed. | |