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)# pip install -U transformers accelerate # 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
Download provenance/validation-metrics.json from HCHs/RivetCoder-9B-A4B: direct link, hf CLI and curl.
- Browser
- Download file 343 Bytes
-
https://huggingface.co/HCHs/RivetCoder-9B-A4B/resolve/main/provenance/validation-metrics.json
- Command line
-
hf download hf://HCHs/RivetCoder-9B-A4B/provenance/validation-metrics.json
-
curl -L -o validation-metrics.json https://huggingface.co/HCHs/RivetCoder-9B-A4B/resolve/main/provenance/validation-metrics.json
343 Bytes
| { | |
| "ce_improvement": 0.0043891161448869065, | |
| "finite": true, | |
| "fused_ce": 0.6014361901441425, | |
| "host_expert_off_ce": 0.6058253062890294, | |
| "mean_absolute_residual_scale": 0.07969798704336123, | |
| "mean_residual_scale": -0.002938792503376438, | |
| "mean_token_gate": 0.19380086263020832, | |
| "records": 4, | |
| "supervised_tokens": 1417 | |
| } | |