Text Generation
Transformers
Safetensors
kimi_k3
feature-extraction
nvfp4
fp4
quantized
Mixture of Experts
modelopt
sglang
custom_code
8-bit precision
Instructions to use PatronusAI/kimi-k3-nvfp4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PatronusAI/kimi-k3-nvfp4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PatronusAI/kimi-k3-nvfp4", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("PatronusAI/kimi-k3-nvfp4", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use PatronusAI/kimi-k3-nvfp4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PatronusAI/kimi-k3-nvfp4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatronusAI/kimi-k3-nvfp4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PatronusAI/kimi-k3-nvfp4
- SGLang
How to use PatronusAI/kimi-k3-nvfp4 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 "PatronusAI/kimi-k3-nvfp4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatronusAI/kimi-k3-nvfp4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "PatronusAI/kimi-k3-nvfp4" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatronusAI/kimi-k3-nvfp4", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PatronusAI/kimi-k3-nvfp4 with Docker Model Runner:
docker model run hf.co/PatronusAI/kimi-k3-nvfp4
File size: 2,067 Bytes
3f06273 eb07696 3f06273 eb07696 3f06273 | 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 58 59 60 61 62 63 64 65 66 67 68 69 70 | {
"producer": {
"name": "modelopt",
"cast": "mxfp4_to_nvfp4_offline"
},
"quantization": {
"quant_algo": "NVFP4",
"kv_cache_quant_algo": null,
"group_size": 16,
"exclude_modules": [
"*self_attn*",
"*shared_experts*",
"*mlp.gate_proj*",
"*mlp.up_proj*",
"*mlp.gate_up_proj*",
"*mlp.down_proj*",
"*lm_head*",
"*vision_tower*",
"*mm_projector*",
"*language_model.lm_head*",
"*language_model.model.embed_tokens*",
"*input_layernorm*",
"*mlp_res_norm*",
"*mlp_res_proj*",
"*post_attention_layernorm*",
"*self_attention_res_norm*",
"*self_attention_res_proj*",
"*self_attn.b_proj*",
"*self_attn.f_a_proj*",
"*self_attn.f_b_proj*",
"*self_attn.g_proj*",
"*self_attn.k_conv1d*",
"*self_attn.k_proj*",
"*self_attn.o_norm*",
"*self_attn.o_proj*",
"*self_attn.q_conv1d*",
"*self_attn.q_proj*",
"*self_attn.v_conv1d*",
"*self_attn.v_proj*",
"*block_sparse_moe.gate*",
"*block_sparse_moe.routed_expert_down_proj*",
"*block_sparse_moe.routed_expert_norm*",
"*block_sparse_moe.routed_expert_up_proj*",
"*block_sparse_moe.shared_experts.down_proj*",
"*block_sparse_moe.shared_experts.gate_proj*",
"*block_sparse_moe.shared_experts.up_proj*",
"*self_attn.kv_a_layernorm*",
"*self_attn.kv_a_proj_with_mqa*",
"*self_attn.kv_b_proj*",
"*self_attn.q_a_layernorm*",
"*self_attn.q_a_proj*",
"*self_attn.q_b_proj*",
"*language_model.model.norm*",
"*language_model.model.output_attn_res_norm*",
"*language_model.model.output_attn_res_proj*",
"*mm_projector.post_norm*",
"*mlp.fc0*",
"*mlp.fc1*",
"*norm0*",
"*norm1*",
"*wo*",
"*wqkv*",
"*vision_tower.encoder.final_layernorm*",
"*vision_tower.patch_embed.pos_emb*",
"*vision_tower.patch_embed.proj*"
],
"quantized_modules_count": 247296,
"activation_scheme": "none"
}
} |