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 AutoModel model = AutoModel.from_pretrained("moonshotai/Kimi-K2.5", trust_remote_code=True, dtype="auto") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- 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
返回的内容为claude的思考过程的数据格式
#30
by tzzhangyajun - opened
使用下面的参数请求 返回的回复内容异常,经常返回这数据 里面还包含有claude的模型名 是用了大量的claude的对话数据训练的?
至少有6层的几率是返回这样的
{
"model": "moonshotai/Kimi-K2.5:together",
"messages": [
{
"role": "user",
"content": [
{
"type": "text",
"text": "画一个大象"
}
]
},
{
"role": "assistant",
"tool_calls": [
{
"id": "image_generate:0",
"type": "function",
"function": {
"name": "image_generate",
"arguments": "{\"prompt\": \"A majestic African elephant standing in the savanna, with large ears, long tusks, and wrinkled gray skin. Golden sunlight, natural wildlife photography style, detailed texture\", \"path\": \"elephant.png\", \"ratio\": \"4:3\"}"
}
}
],
"content": "我来为你生成一张大象的图片。",
"reasoning_content": "用户要求画一个大象。这是一个图片生成任务,我需要使用 image_generate 工具来生成一张大象的图片。\n\n用户只说\"画一个大象\",没有指定特定的风格或场景,我会生成一个自然、真实的大象图片。"
},
{
"tool_call_id": "image_generate:0",
"role": "tool",
"name": "image_generate",
"content": "图片[elephant.png]生成成功"
},
{
"role": "assistant",
"tool_calls": [
{
"id": "finish:1",
"type": "function",
"function": {
"name": "finish",
"arguments": "{\"files\": [\"elephant.png\"]}"
}
}
],
"content": "大象图片已经生成完成!这是一张非洲象在草原上的画面,展现了大象雄壮的身姿、标志性的大耳朵和长长的象牙。",
"reasoning_content": "图片生成成功了。现在我需要向用户展示结果,并调用 finish 工具完成任务。"
},
{
"tool_call_id": "finish:1",
"role": "tool",
"name": "finish",
"content": "success"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "image_generate",
"description": "使用AI生成图片。支持文生图和参考图片生成。",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "图片描述"
},
"path": {
"type": "string",
"description": "保存图片的路径"
},
"image": {
"type": "array",
"items": {
"type": "string"
},
"description": "参考图片路径或URL数组,AI将基于这些图片的风格或内容生成新图片,支持传入多张参考图"
},
"ratio": {
"type": "string",
"description": "图片长宽比,如 1:1、16:9 等",
"enum": [
"1:1",
"4:3",
"3:4",
"16:9",
"9:16",
"3:2",
"2:3",
"5:4",
"4:5",
"21:9",
"9:21"
]
}
},
"required": [
"prompt",
"path"
]
}
}
},
{
"type": "function",
"function": {
"name": "finish",
"description": "Finish the user's task",
"parameters": {
"type": "object",
"properties": {
"files": {
"type": "array",
"description": "The path array of files to finish",
"items": {
"type": "string"
}
}
},
"required": [
"files"
]
}
}
}
],
"max_tokens": null,
"response_format": null
}
Same here:
https://huggingface.co/moonshotai/Kimi-K2.5/discussions/38
Also keeps saying it's Claude.
lul
