Image-Text-to-Text
Transformers
Safetensors
kimi_k25
feature-extraction
compressed-tensors
conversational
custom_code
Eval Results
Instructions to use moonshotai/Kimi-K2.5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moonshotai/Kimi-K2.5 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="moonshotai/Kimi-K2.5", 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("moonshotai/Kimi-K2.5", trust_remote_code=True) model = AutoModel.from_pretrained("moonshotai/Kimi-K2.5", 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?"} ] }, ] 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]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use moonshotai/Kimi-K2.5 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moonshotai/Kimi-K2.5" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "moonshotai/Kimi-K2.5", "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/moonshotai/Kimi-K2.5
- SGLang
How to use moonshotai/Kimi-K2.5 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 "moonshotai/Kimi-K2.5" \ --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": "moonshotai/Kimi-K2.5", "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 "moonshotai/Kimi-K2.5" \ --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": "moonshotai/Kimi-K2.5", "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 moonshotai/Kimi-K2.5 with Docker Model Runner:
docker model run hf.co/moonshotai/Kimi-K2.5
Remove default system prompt, fix media_start token and update readme (#20)
Browse files- remove default system prompt (3a2c18aa8f64e39d29a7974a686e388f7f5f6292)
- fix: should be <|media_start|> (729b62b748575b92fee4c44b03c2aca54c447cb9)
- fix: should be <|media_start|> (d1bc6a58155f947418c2e48c79978634d0ac925b)
- use media_begin because it was in 3rd party code (abb1505cb489130aec852226de64a48a9bbc3458)
- fix (2e6b74b356fe2968c1213b798d601da8311482ba)
- fix (b9d08095157e03efb215ddac3619641c09176c80)
- update README (d03fdeaffc59afeac9082ab5fa0c21362cb7bc7f)
- fix format (847724a8eb9d7a931b8978d1a5cf7d73662f9174)
- README.md +5 -0
- chat_template.jinja +1 -5
README.md
CHANGED
|
@@ -29,6 +29,11 @@ pipeline_tag: image-text-to-text
|
|
| 29 |
<b>📰 <a href="https://www.kimi.com/blog/kimi-k2-5.html">Tech Blog</a></b>
|
| 30 |
</p>
|
| 31 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
## 1. Model Introduction
|
| 33 |
|
| 34 |
Kimi K2.5 is an open-source, native multimodal agentic model built through continual pretraining on approximately 15 trillion mixed visual and text tokens atop Kimi-K2-Base. It seamlessly integrates vision and language understanding with advanced agentic capabilities, instant and thinking modes, as well as conversational and agentic paradigms.
|
|
|
|
| 29 |
<b>📰 <a href="https://www.kimi.com/blog/kimi-k2-5.html">Tech Blog</a></b>
|
| 30 |
</p>
|
| 31 |
|
| 32 |
+
## 0. Changelog
|
| 33 |
+
- 2026.1.29:
|
| 34 |
+
- The default system prompt might cause confusion to users and unexpected behaviours, so we remove it.
|
| 35 |
+
- The token `<|media_start|>` is incorrect; it has been replaced with `<|media_begin|>` in the chat template.
|
| 36 |
+
|
| 37 |
## 1. Model Introduction
|
| 38 |
|
| 39 |
Kimi K2.5 is an open-source, native multimodal agentic model built through continual pretraining on approximately 15 trillion mixed visual and text tokens atop Kimi-K2-Base. It seamlessly integrates vision and language understanding with advanced agentic capabilities, instant and thinking modes, as well as conversational and agentic paradigms.
|
chat_template.jinja
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
{%- elif c is not none -%}
|
| 6 |
{% for content in c -%}
|
| 7 |
{% if content['type'] == 'image' or content['type'] == 'image_url' -%}
|
| 8 |
-
<|
|
| 9 |
{% elif content['type'] == 'video' or content['type']== 'video_url'-%}
|
| 10 |
<|kimi_k25_video_placeholder|>
|
| 11 |
{% else -%}
|
|
@@ -57,10 +57,6 @@
|
|
| 57 |
<|im_system|>tool_declare<|im_middle|>{{ tools | tojson(separators=(',', ':')) }}<|im_end|>
|
| 58 |
{%- endif -%}
|
| 59 |
{%- endif -%}
|
| 60 |
-
|
| 61 |
-
{%- if messages|length == 0 or messages[0]['role'] != 'system' -%}
|
| 62 |
-
<|im_system|>system<|im_middle|>You are Kimi, an AI assistant created by Moonshot AI.<|im_end|>
|
| 63 |
-
{%- endif -%}
|
| 64 |
|
| 65 |
{%- for message in hist_msgs -%}
|
| 66 |
{{set_roles(message)}}
|
|
|
|
| 5 |
{%- elif c is not none -%}
|
| 6 |
{% for content in c -%}
|
| 7 |
{% if content['type'] == 'image' or content['type'] == 'image_url' -%}
|
| 8 |
+
<|media_begin|>image<|media_content|><|media_pad|><|media_end|>
|
| 9 |
{% elif content['type'] == 'video' or content['type']== 'video_url'-%}
|
| 10 |
<|kimi_k25_video_placeholder|>
|
| 11 |
{% else -%}
|
|
|
|
| 57 |
<|im_system|>tool_declare<|im_middle|>{{ tools | tojson(separators=(',', ':')) }}<|im_end|>
|
| 58 |
{%- endif -%}
|
| 59 |
{%- endif -%}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
{%- for message in hist_msgs -%}
|
| 62 |
{{set_roles(message)}}
|