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
| { | |
| "architectures": [ | |
| "FuseGlmForCausalLM" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_fuse_glm.FuseGlmConfig", | |
| "AutoModelForCausalLM": "modeling_fuse_glm.FuseGlmForCausalLM" | |
| }, | |
| "block_auto_adjust_ff_dim": false, | |
| "block_dim": 2048, | |
| "block_ffn_dim_multiplier": 1.0, | |
| "block_mlp_init_scale": 1.0, | |
| "block_multiple_of": 256, | |
| "block_norm_eps": 1e-05, | |
| "block_out_init_scale": 1.0, | |
| "block_use_swiglu": true, | |
| "block_use_xavier_init": true, | |
| "bos_token_id": 124894, | |
| "conv_L_cache": 3, | |
| "conv_bias": false, | |
| "conv_dim": 2048, | |
| "conv_use_xavier_init": true, | |
| "dtype": "bfloat16", | |
| "eos_token_id": 124900, | |
| "full_attn_idxs": null, | |
| "fuse_glm_coding_enabled": true, | |
| "fuse_glm_expert_intermediate_size": 2048, | |
| "fuse_glm_gate_clamp_max": 10.0, | |
| "fuse_glm_hard_token_gate_at_eval": false, | |
| "fuse_glm_layer_indices": [ | |
| 0, | |
| 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 | |
| ], | |
| "fuse_glm_num_experts": 16, | |
| "fuse_glm_output_router_diagnostics": false, | |
| "fuse_glm_residual_scale_max": 0.1, | |
| "fuse_glm_router_aux_loss_coef": 0.0, | |
| "fuse_glm_token_gate_bias": -4.0, | |
| "fuse_glm_token_gate_threshold": 0.5, | |
| "fuse_glm_top_k": 4, | |
| "fuse_glm_up_clamp_max": 10.0, | |
| "fuse_glm_up_clamp_min": -10.0, | |
| "hidden_size": 2048, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 10752, | |
| "layer_types": [ | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention", | |
| "full_attention", | |
| "linear_attention", | |
| "linear_attention" | |
| ], | |
| "max_position_embeddings": 131072, | |
| "model_type": "fuse_glm", | |
| "norm_eps": 1e-05, | |
| "num_attention_heads": 32, | |
| "num_heads": 32, | |
| "num_hidden_layers": 30, | |
| "num_key_value_heads": 8, | |
| "pad_token_id": 124893, | |
| "quantization_config": { | |
| "include_input_output_embeddings": false, | |
| "modules_to_not_convert": null, | |
| "quant_method": "torchao", | |
| "quant_type": { | |
| "default": { | |
| "_data": { | |
| "activation_dtype": { | |
| "_data": "float8_e4m3fn", | |
| "_type": "torch.dtype" | |
| }, | |
| "activation_value_lb": null, | |
| "activation_value_ub": null, | |
| "granularity": [ | |
| { | |
| "_data": {}, | |
| "_type": "PerTensor", | |
| "_version": 1 | |
| }, | |
| { | |
| "_data": {}, | |
| "_type": "PerTensor", | |
| "_version": 1 | |
| } | |
| ], | |
| "kernel_preference": { | |
| "_data": "AUTO", | |
| "_type": "KernelPreference" | |
| }, | |
| "mm_config": { | |
| "_data": { | |
| "emulate": false, | |
| "pad_inner_dim": false, | |
| "use_fast_accum": true | |
| }, | |
| "_type": "Float8MMConfig", | |
| "_version": 1 | |
| }, | |
| "set_inductor_config": true, | |
| "weight_dtype": { | |
| "_data": "float8_e4m3fn", | |
| "_type": "torch.dtype" | |
| } | |
| }, | |
| "_type": "Float8DynamicActivationFloat8WeightConfig", | |
| "_version": 2 | |
| } | |
| }, | |
| "untie_embedding_weights": false | |
| }, | |
| "rivet_coder": { | |
| "active_parameters_approx": 4210000000, | |
| "base_repo_id": "HCHs/RivetCoder-9B-A4B", | |
| "donor": "zai-org/GLM-5.3-Flash", | |
| "experts_per_layer": 16, | |
| "experts_per_token": 4, | |
| "host": "LiquidAI/LFM2.5-2.6B", | |
| "name": "RivetCoder-9B-A4B-FP8", | |
| "quantization": "TorchAO Float8DynamicActivationFloat8WeightConfig", | |
| "repo_id": "HCHs/RivetCoder-9B-A4B-FP8", | |
| "router_teacher": "qwen/qwen3.8-27b", | |
| "total_parameters_approx": 8740000000, | |
| "training_steps": 60 | |
| }, | |
| "rope_parameters": { | |
| "rope_theta": 10000000.0, | |
| "rope_type": "default" | |
| }, | |
| "tie_word_embeddings": true, | |
| "transformers_version": "5.16.1", | |
| "use_cache": true, | |
| "use_pos_enc": true, | |
| "vocab_size": 128000 | |
| } | |