Image-Text-to-Text
Transformers
Safetensors
kimi_k25
feature-extraction
compressed-tensors
conversational
custom_code
Instructions to use PYTHAI/Kimi-K2.7-Code-fork with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PYTHAI/Kimi-K2.7-Code-fork with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="PYTHAI/Kimi-K2.7-Code-fork", 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("PYTHAI/Kimi-K2.7-Code-fork", trust_remote_code=True) model = AutoModel.from_pretrained("PYTHAI/Kimi-K2.7-Code-fork", 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 PYTHAI/Kimi-K2.7-Code-fork with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PYTHAI/Kimi-K2.7-Code-fork" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PYTHAI/Kimi-K2.7-Code-fork", "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/PYTHAI/Kimi-K2.7-Code-fork
- SGLang
How to use PYTHAI/Kimi-K2.7-Code-fork 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 "PYTHAI/Kimi-K2.7-Code-fork" \ --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": "PYTHAI/Kimi-K2.7-Code-fork", "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 "PYTHAI/Kimi-K2.7-Code-fork" \ --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": "PYTHAI/Kimi-K2.7-Code-fork", "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 PYTHAI/Kimi-K2.7-Code-fork with Docker Model Runner:
docker model run hf.co/PYTHAI/Kimi-K2.7-Code-fork
| { | |
| "kind": "licence-locked pointer fork", | |
| "source_repo": "moonshotai/Kimi-K2.7-Code", | |
| "source_url": "https://huggingface.co/moonshotai/Kimi-K2.7-Code", | |
| "source_commit": "74797c9c62378b951a1f6fcf5c4631024e9b8bef", | |
| "forked_at_utc": "2026-09-13T23:55:35Z", | |
| "licence_tag": "other", | |
| "licence_file": { | |
| "path": "LICENSE", | |
| "bytes": 1470, | |
| "sha256": "9cb73476cecdfabac7775bf7c225bd5f6017d5d678372917e4456964c0454f7a" | |
| }, | |
| "weights_copied": false, | |
| "weights_not_copied": { | |
| "files": 64, | |
| "bytes": 595177988208 | |
| }, | |
| "parameters": 1026879376368, | |
| "load_weights_with": "from_pretrained('moonshotai/Kimi-K2.7-Code', revision='74797c9c62378b951a1f6fcf5c4631024e9b8bef')", | |
| "files": [ | |
| { | |
| "path": "LICENSE", | |
| "bytes": 1470, | |
| "sha256": "9cb73476cecdfabac7775bf7c225bd5f6017d5d678372917e4456964c0454f7a" | |
| }, | |
| { | |
| "path": "README.md", | |
| "bytes": 15061, | |
| "sha256": "c78bbe5af19636b180eda956abf1f30a79027ec04d6642ebddc44edbc4470879" | |
| }, | |
| { | |
| "path": "THIRD_PARTY_NOTICES.md", | |
| "bytes": 1665, | |
| "sha256": "98392e4fd8a43aa576613212e69d0c7d2090504b4127da1fca7270f6af85d101" | |
| }, | |
| { | |
| "path": "chat_template.jinja", | |
| "bytes": 2385, | |
| "sha256": "8d21200dff7e85beaf51c8b110952e039ffd0779f615d64d63293d74773360f9" | |
| }, | |
| { | |
| "path": "config.json", | |
| "bytes": 5420, | |
| "sha256": "ffbb57bff844e024f6c112640b63da80af228ceb8fb3e2e21908a21febbcdffb" | |
| }, | |
| { | |
| "path": "configuration_deepseek.py", | |
| "bytes": 10615, | |
| "sha256": "c1327c307e2dd11d1bf0adc8bcef69ae51f9617a3a869a9497bb08aec912f931" | |
| }, | |
| { | |
| "path": "configuration_kimi_k25.py", | |
| "bytes": 5435, | |
| "sha256": "2bc5487efced291e0e6aa3b24aad1082bade4172aff94ea1b6f0ae20a1d6bb4f" | |
| }, | |
| { | |
| "path": "docs/deploy_guidance.md", | |
| "bytes": 3689, | |
| "sha256": "b1bc4c5fb7c8b1da727663d4da83999afc902f6166ff862fbaef514b86de2c65" | |
| }, | |
| { | |
| "path": "figures/demo_video.mp4", | |
| "bytes": 270100, | |
| "sha256": "09b4d925aa0a7c712feef50765355f0625d8f6d46ea302fd98db9609e9070047" | |
| }, | |
| { | |
| "path": "figures/kimi-logo.png", | |
| "bytes": 87988, | |
| "sha256": "4a80f64242bf907940765adc7bcf340c28dd83334b07c5503792a26495d1933b" | |
| }, | |
| { | |
| "path": "generation_config.json", | |
| "bytes": 91, | |
| "sha256": "b784cc6a9ecb551196b81cb6b1d2dcb18467b92adaab6992ae4cc455ad44d2ce" | |
| }, | |
| { | |
| "path": "kimi_k25_processor.py", | |
| "bytes": 6906, | |
| "sha256": "537d7a708e1654766fc628c99667bdb9364136d3541633d6522ac43cef9bfea0" | |
| }, | |
| { | |
| "path": "kimi_k25_vision_processing.py", | |
| "bytes": 10019, | |
| "sha256": "498e20753c9aa6b6224ddbcd05b04deb7e987b76595bf5c28ee8583f33ebc375" | |
| }, | |
| { | |
| "path": "media_utils.py", | |
| "bytes": 13179, | |
| "sha256": "77a6b1fed3580b0562443092928a0240c2989e3950377e93893952123ae48e3d" | |
| }, | |
| { | |
| "path": "model.safetensors.index.json", | |
| "bytes": 23597438, | |
| "sha256": "f6dd3318271f0121445d2af1c0c3f75707127a84a625f86bc0eaae9deb848f40" | |
| }, | |
| { | |
| "path": "modeling_deepseek.py", | |
| "bytes": 78639, | |
| "sha256": "17e079e0a5e41114aabd2ae5ba924128ba6652bc6f9a00ea06efcd1230340406" | |
| }, | |
| { | |
| "path": "modeling_kimi_k25.py", | |
| "bytes": 53045, | |
| "sha256": "a1594f129ae8dc5fa3c9dbbc24e8e603b30d7caef1226669b4d95dc8f2a3e2dd" | |
| }, | |
| { | |
| "path": "preprocessor_config.json", | |
| "bytes": 744, | |
| "sha256": "bd9a1f5d7b1580b38093c35ca49162580a118485164fac48e1cdb224ee41fcff" | |
| }, | |
| { | |
| "path": "tiktoken.model", | |
| "bytes": 2795286, | |
| "sha256": "b6c497a7469b33ced9c38afb1ad6e47f03f5e5dc05f15930799210ec050c5103" | |
| }, | |
| { | |
| "path": "tokenization_kimi.py", | |
| "bytes": 14132, | |
| "sha256": "88394687bd081f55928849b2d140e190c70297660d3fb8b7c54c0e5633b177e3" | |
| }, | |
| { | |
| "path": "tokenizer_config.json", | |
| "bytes": 4832, | |
| "sha256": "6dfafeacca3d44748fc4a2fcc6725be5ea616ecc5b95f5a8b4277077c06e7d9f" | |
| }, | |
| { | |
| "path": "tool_declaration_ts.py", | |
| "bytes": 16517, | |
| "sha256": "97e09ed262f1cd38f87584eaa46c5d4d5b3c9725dd299b21642f389040794ebc" | |
| } | |
| ], | |
| "why": "preserve the licence terms of this exact commit and pin the revision; the weights stay at the source and are addressed by commit sha", | |
| "forked_by": "mindX (PYTHAI) via the node token" | |
| } |