Instructions to use BlackfrostAI/Kimi-K2.7-Code-BF16 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use BlackfrostAI/Kimi-K2.7-Code-BF16 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="BlackfrostAI/Kimi-K2.7-Code-BF16", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModel processor = AutoProcessor.from_pretrained("BlackfrostAI/Kimi-K2.7-Code-BF16", trust_remote_code=True) model = AutoModel.from_pretrained("BlackfrostAI/Kimi-K2.7-Code-BF16", trust_remote_code=True, device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use BlackfrostAI/Kimi-K2.7-Code-BF16 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "BlackfrostAI/Kimi-K2.7-Code-BF16" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "BlackfrostAI/Kimi-K2.7-Code-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/BlackfrostAI/Kimi-K2.7-Code-BF16
- SGLang
How to use BlackfrostAI/Kimi-K2.7-Code-BF16 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 "BlackfrostAI/Kimi-K2.7-Code-BF16" \ --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": "BlackfrostAI/Kimi-K2.7-Code-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "BlackfrostAI/Kimi-K2.7-Code-BF16" \ --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": "BlackfrostAI/Kimi-K2.7-Code-BF16", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use BlackfrostAI/Kimi-K2.7-Code-BF16 with Docker Model Runner:
docker model run hf.co/BlackfrostAI/Kimi-K2.7-Code-BF16
ℹ️ Full BF16 Weights (dequantized)
This repository provides full
bfloat16weights formoonshotai/Kimi-K2.7-Code, which Moonshot AI released in native INT4 (pack-quantized / compressed-tensors) format.The weights here are a faithful dequantization of the official INT4 release to
bfloat16— no fine-tuning, ablation, distillation, or other behavioral modification.quantization_confighas been removed fromconfig.jsonanddtypeset tobfloat16, so the model loads as a standard full-precisiontransformersmodel.
Base model moonshotai/Kimi-K2.7-Code(© Moonshot AI, Modified MIT)This repo BF16 dequantization by Blackfrost-AI Precision bfloat16(attention, shared experts, and routed experts all upcast from INT4)Size ~2.05 TB · 64 safetensors shards · 70,310 tensors Behavior Identical to the original — all architecture, capabilities, and evaluations below are Moonshot's Intended use A full-precision base for re-quantization (GGUF / NVFP4 / FP8), fine-tuning, or research that needs unpacked weights All credit for the model belongs to Moonshot AI. This conversion is provided under the same Modified MIT License as the original.
1. Model Introduction
Kimi K2.7 Code is a coding-focused agentic model built upon Kimi K2.6. With substantial improvements on real-world long-horizon coding tasks, it strengthens end-to-end task completion across complex software engineering workflows while improving token efficiency, reducing thinking-token usage by approximately 30% compared with Kimi K2.6.
2. Model Summary
| Architecture | Mixture-of-Experts (MoE) |
| Total Parameters | 1T |
| Activated Parameters | 32B |
| Number of Layers (Dense layer included) | 61 |
| Number of Dense Layers | 1 |
| Attention Hidden Dimension | 7168 |
| MoE Hidden Dimension (per Expert) | 2048 |
| Number of Attention Heads | 64 |
| Number of Experts | 384 |
| Selected Experts per Token | 8 |
| Number of Shared Experts | 1 |
| Vocabulary Size | 160K |
| Context Length | 256K |
| Attention Mechanism | MLA |
| Activation Function | SwiGLU |
| Vision Encoder | MoonViT |
| Parameters of Vision Encoder | 400M |
| Weight Precision (this repo) | BF16 (dequantized from native INT4) |
3. Evaluation Results
Evaluations are those of the original
moonshotai/Kimi-K2.7-Code. Dequantization to BF16 does not change model behavior; if anything it removes INT4 rounding.
| Benchmark | Kimi K2.6 | Kimi K2.7 Code | GPT-5.5 | Claude Opus 4.8 |
|---|---|---|---|---|
| Coding | ||||
| Kimi Code Bench v2 | 50.9 | 62.0 | 69.0 | 67.4 |
| Program Bench | 48.3 | 53.6 | 69.1 | 63.8 |
| MLS Bench Lite | 26.7 | 35.1 | 35.5 | 42.8 |
| Agentic | ||||
| Kimi Claw 24/7 Bench | 42.9 | 46.9 | 52.8 | 50.4 |
| MCP Atlas | 69.4 | 76.0 | 79.4 | 81.3 |
| MCP Mark Verified | 72.8 | 81.1 | 92.9 | 76.4 |
4. Quantization / Precision
The original Kimi-K2.7-Code is released in native INT4 (pack-quantized), using the same method as Kimi-K2-Thinking.
This repository is the full BF16 dequantization of that release. The INT4 packed routed-expert weights were unpacked and dequantized to bfloat16; attention, shared experts, dense layer 0, embeddings, lm_head, and the vision tower (already BF16 in the original) are carried through unchanged. config.json has quantization_config removed and dtype: bfloat16, so it loads as a standard BF16 model — no compressed-tensors needed.
Use these weights as a full-precision starting point to re-quantize (GGUF, NVFP4, FP8, AWQ, …) or to fine-tune.
5. Deployment
Kimi-K2.7-Code has the same architecture as Kimi-K2.5/Kimi-K2.6, and the deployment method can be directly reused. Recommended inference engines:
- vLLM
- SGLang
- KTransformers
This BF16 checkpoint loads with trust_remote_code=True at dtype=torch.bfloat16. Note it is ~2 TB — plan tensor-parallel/offload accordingly. For the original INT4 release and its official deployment guide, see moonshotai/Kimi-K2.7-Code.
6. Model Usage
Usage is identical to the original model (forced thinking + preserve_thinking). See the original model card for chat-completion, vision, preserve-thinking, and tool-call examples. The chat template and tokenizer in this repo are the originals, unchanged.
7. License
Released under the Modified MIT License, the same license as the original model weights. Copyright © 2026 Moonshot AI. This BF16 conversion by Blackfrost-AI is distributed under the same terms.
8. Third Party Notices
See THIRD PARTY NOTICES.
9. Acknowledgements & Contact
Full credit to Moonshot AI for creating and open-sourcing Kimi-K2.7-Code. This repository only redistributes a dequantized copy of their weights. For questions about the original model, contact support@moonshot.ai.
- Downloads last month
- 22
Model tree for BlackfrostAI/Kimi-K2.7-Code-BF16
Base model
moonshotai/Kimi-K2.7-Code