Text Generation
Transformers
Safetensors
English
Korean
code
fuse_glm
custom_code
lfm2
glm
mixture-of-experts
routed-experts
coding
code-generation
fp8
torchao
top-k-routing
trust-remote-code
conversational
Instructions to use HCHs/RivetCoder-9B-A4B-FP8 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HCHs/RivetCoder-9B-A4B-FP8 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="HCHs/RivetCoder-9B-A4B-FP8", 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-FP8", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use HCHs/RivetCoder-9B-A4B-FP8 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-FP8" # 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-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/HCHs/RivetCoder-9B-A4B-FP8
- SGLang
How to use HCHs/RivetCoder-9B-A4B-FP8 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-FP8" \ --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-FP8", "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-FP8" \ --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-FP8", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use HCHs/RivetCoder-9B-A4B-FP8 with Docker Model Runner:
docker model run hf.co/HCHs/RivetCoder-9B-A4B-FP8
File size: 1,758 Bytes
cd55fe8 a92180d cd55fe8 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | {
"schema": "rivetcoder-fp8-quantization",
"schema_version": 1,
"created_at": "2026-08-27T23:01:09+09:00",
"source": {
"repo_id": "HCHs/RivetCoder-9B-A4B",
"revision": "9a90b1917d9b5438e4d2fe1a4f6aea884db59a60"
},
"target": {
"repo_id": "HCHs/RivetCoder-9B-A4B-FP8",
"local_directory": "RivetCoder-9B-A4B-FP8"
},
"method": {
"framework": "TorchAO",
"config": "Float8DynamicActivationFloat8WeightConfig",
"weight_dtype": "float8_e4m3fn",
"activation_dtype": "float8_e4m3fn",
"activation_scheme": "dynamic",
"granularity": "per-tensor",
"compatible_linear_modules_only": true
},
"runtime": {
"platform": "Windows 11",
"python": "3.12.10",
"torch": "2.12.0+cu130",
"transformers": "5.16.1",
"accelerate": "1.13.0",
"safetensors": "0.8.0",
"torchao": "0.15.0",
"gpu": "NVIDIA GeForce RTX 5070 Ti",
"compute_capability": [12, 0]
},
"results": {
"parameter_tensors": 1826,
"fp8_tensor_subclass_parameters": 1636,
"fp8_parameter_elements": 8475574272,
"stored_tensor_bytes": 9000638976,
"safetensors_shards": 5,
"all_parameters_materialized": true,
"all_parameters_on_cuda": true,
"clean_reload_success": true,
"clean_reload_seconds": 338.0,
"clean_reload_fp8_parameters": 1636,
"clean_reload_non_cuda_parameters": 0,
"fast_serving_validated": true,
"fast_serving_logits_bit_exact": true,
"resident_cuda_allocated_bytes": 9039455232,
"forward_finite": true,
"forward_logits_shape": [1, 6, 128000]
},
"compatibility": {
"required_context": "torch.no_grad",
"known_incompatible_context": "torch.inference_mode",
"known_error": "Cannot set version_counter for inference tensor"
}
}
|