Instructions to use moonshotai/Kimi-K3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use moonshotai/Kimi-K3 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="moonshotai/Kimi-K3", 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-K3", trust_remote_code=True, device_map="auto") - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use moonshotai/Kimi-K3 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "moonshotai/Kimi-K3" # 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-K3", "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-K3
- SGLang
How to use moonshotai/Kimi-K3 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-K3" \ --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-K3", "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-K3" \ --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-K3", "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-K3 with Docker Model Runner:
docker model run hf.co/moonshotai/Kimi-K3
Solving Kimi's Computing Issues via External Inference Providers
Since the model is now supported by external inference providers, the team at Moonshot AI could use them for some of Kimi's services, thereby eliminating current computing issues. For example, integrating via Together AI could instantly leverage a speed of 47 TPS, significantly boosting performance.
Title:
利用外部推理服務商解決 Kimi 算力瓶頸的提案
Comment:
鑑於該模型目前已獲得外部推理服務商的支持,Moonshot AI 團隊可以考慮在 Kimi 的部分服務中引入這些服務商,從而解決當前的算力瓶頸問題。例如,通過接入 Together AI,可以立即獲得 47 TPS 的運行速度,從而大幅提升整體性能。
这做不到!不同供应商的词元售价不同,不能视同是从kimi dot com销售的。而且固定价格并不利于外部提供商互相竞价来提供更便宜的词元。再者,如果kimi dot com变为一个类似openrouter的销售平台,你为何不直接购买已有平台的服务呢?这毫无意义。
English answer: To clarify, our proposal does not involve transforming Kimi into a customer-facing marketplace or token aggregator where external vendors compete directly.From a VectionLabs perspective, we are highlighting a backend infrastructure (B2B) optimization. Moonshot AI would operate as the sole enterprise client, utilizing external inference networks like Together AI behind the scenes as a wholesale utility layer to offload peak traffic. For end-users on kimi.com, the product tiering, interface, and billing model would remain completely unchanged, while benefiting from an immediate performance boost up to 47 TPS.
Chinese answer: 在此澄清,我們的提案並非建議將 Kimi 轉型為面向終端用戶、由外部廠商直接競價的 Token 市集或聚合平台。從 VectionLabs 的技術視角來看,這是一項後端基礎設施(B2B)的優化方案。Moonshot AI 將作為唯一的企業級客戶,在幕後將 Together AI 等外部推理網路視為批發形式的算力輔助工具,用以分流高峰期流量。對於 kimi.com 的終端用戶而言,產品架構、使用者介面與計費模式都將保持完全不變,同時能立即享有提升至 47 TPS 的高效能體驗.
你方为何不自己出售词元而非要向月之暗面推销你的云群集计算服务呢? 你方完全可以自行贩售词元推理服务,不需要月之暗面的许可。这样既不会触发数据进出口禁令,你方也能自行向其他有需要的企业客户销售kimi 3模型的词元推理服务。
English answer:
Thank you for the follow-up, but there seems to be another misunderstanding regarding our role. VectionLabs is not a cloud infrastructure provider; we do not own or sell cluster compute services, nor are we looking to act as a token vendor.As members of the open-source community, we opened this discussion purely to offer an objective, architectural suggestion to the Moonshot AI team. Observing that external inference networks (such as Together AI) achieve 47 TPS hosting this model, we highlighted this as a viable B2B backend optimization utility they could leverage. This is strictly a technical feasibility recommendation from the community, not a commercial pitch.
Chinese answer:
感謝您的進一步討論,但這裡可能存在另一個誤解。VectionLabs 並非雲端運算基礎設施供應商,我們本身並不銷售雲端集群算力,也無意成為 Token 零售商。作為開源社群的參與者,我們開立此討論串純粹是從技術與架構優化的視角,為 Moonshot AI 團隊提供一個客觀的建議。我們注意到外部推理服務商(例如 Together AI)託管該模型時能達到 47 TPS 的高效能,因此提議 Moonshot AI 可以考慮引入此類第三方 B2B 算力方案來優化其自身後端。這是一項純粹的技術可行性建言,而非商業推銷.