Image-Text-to-Text
Transformers
GGUF
kimi_k25
feature-extraction
compressed-tensors
unsloth
custom_code
imatrix
conversational
Instructions to use unsloth/Kimi-K2.7-Code-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Kimi-K2.7-Code-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="unsloth/Kimi-K2.7-Code-GGUF", 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("unsloth/Kimi-K2.7-Code-GGUF", trust_remote_code=True) model = AutoModel.from_pretrained("unsloth/Kimi-K2.7-Code-GGUF", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use unsloth/Kimi-K2.7-Code-GGUF with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama cli -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Use Docker
docker model run hf.co/unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
- LM Studio
- Jan
- vLLM
How to use unsloth/Kimi-K2.7-Code-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Kimi-K2.7-Code-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "unsloth/Kimi-K2.7-Code-GGUF", "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/unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
- SGLang
How to use unsloth/Kimi-K2.7-Code-GGUF 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 "unsloth/Kimi-K2.7-Code-GGUF" \ --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": "unsloth/Kimi-K2.7-Code-GGUF", "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 "unsloth/Kimi-K2.7-Code-GGUF" \ --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": "unsloth/Kimi-K2.7-Code-GGUF", "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" } } ] } ] }' - Ollama
How to use unsloth/Kimi-K2.7-Code-GGUF with Ollama:
ollama run hf.co/unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
- Unsloth Desktop
- Pi
How to use unsloth/Kimi-K2.7-Code-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use unsloth/Kimi-K2.7-Code-GGUF with Docker Model Runner:
docker model run hf.co/unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
- Lemonade
How to use unsloth/Kimi-K2.7-Code-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Run and chat with the model
lemonade run user.Kimi-K2.7-Code-GGUF-UD-Q4_K_XL
List all available models
lemonade list
- Hermes Agent
How to use unsloth/Kimi-K2.7-Code-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use unsloth/Kimi-K2.7-Code-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "unsloth/Kimi-K2.7-Code-GGUF:UD-Q4_K_XL" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
---
|
| 2 |
tags:
|
| 3 |
- compressed-tensors
|
|
|
|
| 4 |
license: other
|
| 5 |
license_name: modified-mit
|
| 6 |
library_name: transformers
|
|
@@ -8,11 +9,32 @@ pipeline_tag: image-text-to-text
|
|
| 8 |
base_model:
|
| 9 |
- moonshotai/Kimi-K2.7-Code
|
| 10 |
---
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
<hr>
|
| 17 |
<div align="center" style="line-height:1">
|
| 18 |
<a href="https://www.kimi.com/code" target="_blank"><img alt="Chat" src="https://img.shields.io/badge/🤖-Kimi--Code-ff6b6b?color=1783ff&logoColor=white"/></a>
|
|
@@ -29,9 +51,6 @@ base_model:
|
|
| 29 |
<a href="https://huggingface.co/moonshotai/Kimi-K2.7-Code/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Modified_MIT-f5de53?&color=f5de53"/></a>
|
| 30 |
</div>
|
| 31 |
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
## 1. Model Introduction
|
| 36 |
|
| 37 |
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.
|
|
@@ -148,22 +167,6 @@ Kimi K2.7 Code is a coding-focused agentic model built upon Kimi K2.6. With subs
|
|
| 148 |
## 4. Native INT4 Quantization
|
| 149 |
Kimi-K2.7-Code adopts the same native int4 quantization method as [Kimi-K2-Thinking](https://huggingface.co/moonshotai/Kimi-K2-Thinking#4-native-int4-quantization).
|
| 150 |
|
| 151 |
-
## 5. Deployment
|
| 152 |
-
|
| 153 |
-
> [!Note]
|
| 154 |
-
> You can access Kimi-K2.7-Code's API on https://platform.moonshot.ai and we provide OpenAI/Anthropic-compatible API for you.
|
| 155 |
-
Currently, Kimi-K2.7-Code is recommended to run on the following inference engines:
|
| 156 |
-
* vLLM
|
| 157 |
-
* SGLang
|
| 158 |
-
* KTransformers
|
| 159 |
-
|
| 160 |
-
Kimi-K2.7-Code has the same architecture as Kimi-K2.5/Kimi-K2.6, and the deployment method can be directly reused.
|
| 161 |
-
|
| 162 |
-
The version requirement for `transformers` is `>=4.57.1, <5.0.0`.
|
| 163 |
-
|
| 164 |
-
Deployment examples can be found in the [Model Deployment Guide](docs/deploy_guidance.md).
|
| 165 |
-
|
| 166 |
-
|
| 167 |
---
|
| 168 |
## 6. Model Usage
|
| 169 |
|
|
|
|
| 1 |
---
|
| 2 |
tags:
|
| 3 |
- compressed-tensors
|
| 4 |
+
- kimi_k25
|
| 5 |
license: other
|
| 6 |
license_name: modified-mit
|
| 7 |
library_name: transformers
|
|
|
|
| 9 |
base_model:
|
| 10 |
- moonshotai/Kimi-K2.7-Code
|
| 11 |
---
|
| 12 |
+
# Read our How to [Run Kimi K2.7 Code Guide!](https://unsloth.ai/docs/models/kimi-k2.7-code)
|
| 13 |
+
<div>
|
| 14 |
+
<p style="margin: 0 0 0px 0; margin-top: 0px;">
|
| 15 |
+
<em>See <a href="https://unsloth.ai/docs/basics/unsloth-dynamic-v2.0-gguf">Unsloth Dynamic 2.0 GGUFs</a> for our quantization benchmarks.</em>
|
| 16 |
+
</p>
|
| 17 |
+
<div style="display: flex; gap: 5px; align-items: center; margin-bottom: 0px;">
|
| 18 |
+
<a href="https://github.com/unslothai/unsloth/">
|
| 19 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/unsloth%20new%20logo.png" width="133">
|
| 20 |
+
</a>
|
| 21 |
+
<a href="https://discord.gg/unsloth">
|
| 22 |
+
<img src="https://github.com/unslothai/unsloth/raw/main/images/Discord%20button.png" width="173">
|
| 23 |
+
</a>
|
| 24 |
+
<a href="https://unsloth.ai/docs/models/kimi-k2.7-code">
|
| 25 |
+
<img src="https://raw.githubusercontent.com/unslothai/unsloth/refs/heads/main/images/documentation%20green%20button.png" width="143">
|
| 26 |
+
</a>
|
| 27 |
+
</div>
|
| 28 |
+
<ul style="margin: 0;">
|
| 29 |
+
<li>To run Kimi K2.7 Code in full precision lossless, run Q8 (UD-Q8_K_XL), which is 595GB and only 10GB bigger than Q4 (UD-Q4_K_XL).</li>
|
| 30 |
+
<li>See our <a href="https://unsloth.ai/docs/models/kimi-k2.7-code">Kimi K2.7 Code guide</a> for quantization analysis and instructions.</li>
|
| 31 |
+
</ul>
|
| 32 |
</div>
|
| 33 |
+
|
| 34 |
+
<br>
|
| 35 |
+
|
| 36 |
+
# Kimi-K2.7-Code
|
| 37 |
+
|
| 38 |
<hr>
|
| 39 |
<div align="center" style="line-height:1">
|
| 40 |
<a href="https://www.kimi.com/code" target="_blank"><img alt="Chat" src="https://img.shields.io/badge/🤖-Kimi--Code-ff6b6b?color=1783ff&logoColor=white"/></a>
|
|
|
|
| 51 |
<a href="https://huggingface.co/moonshotai/Kimi-K2.7-Code/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/badge/License-Modified_MIT-f5de53?&color=f5de53"/></a>
|
| 52 |
</div>
|
| 53 |
|
|
|
|
|
|
|
|
|
|
| 54 |
## 1. Model Introduction
|
| 55 |
|
| 56 |
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.
|
|
|
|
| 167 |
## 4. Native INT4 Quantization
|
| 168 |
Kimi-K2.7-Code adopts the same native int4 quantization method as [Kimi-K2-Thinking](https://huggingface.co/moonshotai/Kimi-K2-Thinking#4-native-int4-quantization).
|
| 169 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
---
|
| 171 |
## 6. Model Usage
|
| 172 |
|