Text Generation
Transformers
Safetensors
deepseek_v3
unsloth
conversational
custom_code
text-generation-inference
compressed-tensors
Instructions to use unsloth/Kimi-K2-Thinking with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use unsloth/Kimi-K2-Thinking with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="unsloth/Kimi-K2-Thinking", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("unsloth/Kimi-K2-Thinking", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("unsloth/Kimi-K2-Thinking", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use unsloth/Kimi-K2-Thinking with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "unsloth/Kimi-K2-Thinking" # 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-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/unsloth/Kimi-K2-Thinking
- SGLang
How to use unsloth/Kimi-K2-Thinking 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-Thinking" \ --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-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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-Thinking" \ --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-Thinking", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio new
How to use unsloth/Kimi-K2-Thinking with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/Kimi-K2-Thinking to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for unsloth/Kimi-K2-Thinking to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for unsloth/Kimi-K2-Thinking to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="unsloth/Kimi-K2-Thinking", max_seq_length=2048, ) - Docker Model Runner
How to use unsloth/Kimi-K2-Thinking with Docker Model Runner:
docker model run hf.co/unsloth/Kimi-K2-Thinking
Add files using upload-large-folder tool
Browse files- model-00010-of-000062.safetensors +3 -0
- model-00012-of-000062.safetensors +3 -0
- model-00013-of-000062.safetensors +3 -0
- model-00014-of-000062.safetensors +3 -0
- model-00016-of-000062.safetensors +3 -0
- model-00019-of-000062.safetensors +3 -0
- model-00020-of-000062.safetensors +3 -0
- model-00021-of-000062.safetensors +3 -0
- model-00022-of-000062.safetensors +3 -0
- model-00023-of-000062.safetensors +3 -0
- model-00026-of-000062.safetensors +3 -0
- model-00028-of-000062.safetensors +3 -0
- model-00029-of-000062.safetensors +3 -0
- model-00032-of-000062.safetensors +3 -0
- model-00033-of-000062.safetensors +3 -0
- model-00034-of-000062.safetensors +3 -0
- model-00035-of-000062.safetensors +3 -0
- model-00037-of-000062.safetensors +3 -0
- model-00038-of-000062.safetensors +3 -0
- model-00041-of-000062.safetensors +3 -0
- model-00043-of-000062.safetensors +3 -0
- model-00046-of-000062.safetensors +3 -0
- model-00048-of-000062.safetensors +3 -0
- model-00049-of-000062.safetensors +3 -0
- model-00050-of-000062.safetensors +3 -0
- model-00051-of-000062.safetensors +3 -0
- model-00053-of-000062.safetensors +3 -0
- model-00054-of-000062.safetensors +3 -0
- model-00057-of-000062.safetensors +3 -0
- model-00058-of-000062.safetensors +3 -0
model-00010-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f3885c59a40662088e37b4bee49cdd33428cd40ca18f165405cda7806f4931de
|
| 3 |
+
size 9808995784
|
model-00012-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:766eb3b51f5bf5aeb99f6a7c61f83b56516dc9fcc2b94a7cb9b999b23e7215dd
|
| 3 |
+
size 9808999256
|
model-00013-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca1661d9843460f63870282cbbe22a68768a7d7bddf5a983a430249ed8e4724a
|
| 3 |
+
size 9808999256
|
model-00014-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:855acdcee579c79e463c9e3f2dd8a35b7ed0c4109c387e4a5780987e7c98d6a3
|
| 3 |
+
size 9808999256
|
model-00016-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ca84d3d21a5fcde572ea00447a30fb6174107f9dcb13c994ba6540717056620c
|
| 3 |
+
size 9808999256
|
model-00019-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6695243bd3ce55705e384ef51be993ba6b881ddbff841510be7937141b05761d
|
| 3 |
+
size 9808999256
|
model-00020-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e84f956e805f92ba224da76e5adc8f4303e5b66b7ac82aa2b793517c0f7bb1a3
|
| 3 |
+
size 9808999256
|
model-00021-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8ed0c3abc1898eb36cacdcf152f6d22f244dd8f95ec3e597a406575ef936e12c
|
| 3 |
+
size 9808999256
|
model-00022-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96ce2ddc9ff80d522e57437c123147066593e429523e1a24b0e5b134b8af5030
|
| 3 |
+
size 9808999256
|
model-00023-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bc62e7fcd8184cd45c046e2f92f2abde6009c160b7b0cd57da536af38e66d771
|
| 3 |
+
size 9808999256
|
model-00026-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a16fe7a9816d71e5927fc93e229aef8821a37ca2382700ef9878c4b72cb9ee34
|
| 3 |
+
size 9808999256
|
model-00028-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:10ef5c61dacb9c0390dd5e783a82d10bbaf25b1ff5d1cb2f1bbfe0a59b14d0cd
|
| 3 |
+
size 9808999256
|
model-00029-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f694289ad0f5c42dbcbcec326a8d2286f3b989e8c72a23c79cab8145ce4411d7
|
| 3 |
+
size 9808999256
|
model-00032-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4cd98998e2379b38f7ac412df3a1a129e1620cd3c76d97fa0366d92cad984c02
|
| 3 |
+
size 9808999256
|
model-00033-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:45a2dcd2e1ffd907e820d2721bfa53be572c0048d8c6d1a1c4de7039daacea91
|
| 3 |
+
size 9808999256
|
model-00034-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1cda7176b5651e3a3be960058f2e9ccdb965680c469a241b9169bcca7e861abf
|
| 3 |
+
size 9808999256
|
model-00035-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8fcd19675824aa0741579ecf437ffe37f6ee17a2064f58fb196f5b20bd587161
|
| 3 |
+
size 9808999256
|
model-00037-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:562593af7257c91cdfc5662ab1c46d3f7bba61ffe0d233c9958f70e357c28466
|
| 3 |
+
size 9808999256
|
model-00038-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b0d2c8ab656a35fac21c1654b7ac4f64654a4318f52ca0d27c4e24352f5eda50
|
| 3 |
+
size 9808999256
|
model-00041-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:91c07e51cf58dca947f0bd8ac63615b0878d5f9e202f966855bf07e255dc3f9a
|
| 3 |
+
size 9808999256
|
model-00043-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ede8d1839e19c8acdc5f3fd2a7c43a18f49ccd1243115169b99dd0b556d0ca0
|
| 3 |
+
size 9808999256
|
model-00046-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a5188a70ebf7134f241450f93030e64fe9fa4d0f1f42f965cef1deab9b53c7a1
|
| 3 |
+
size 9808999256
|
model-00048-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9226c9c424c089a18d7fda321fe90b04e0c607b48f193e5647f1cda87423e69e
|
| 3 |
+
size 9808999256
|
model-00049-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c10121535372dc5add3f07c1becdb580b2a8b672e51d3382c347900fcacd3466
|
| 3 |
+
size 9808999256
|
model-00050-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b09203a76184ec1f6b080445903842ebdc3471c5b41d654f64cf511956f8e694
|
| 3 |
+
size 9808999256
|
model-00051-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bdbda5bb8ff9d2872cab62f0dd6c15d23ec655a388a34c78347904077ba0dc9e
|
| 3 |
+
size 9808999256
|
model-00053-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e4754ee3f4f9376f3b1c1795bf712f6269fbe6e9cb62cd7edd5f58c684ecfd3a
|
| 3 |
+
size 9808999256
|
model-00054-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c1a8c98b6317e08d5f2364e671848c82a451b0b8d1ab60f5d6172f6aa38b92a5
|
| 3 |
+
size 9808999256
|
model-00057-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be21402538fcac79716f15c41d3f7fc69569d45d8e0211daaf2b19685411ddf0
|
| 3 |
+
size 9808999256
|
model-00058-of-000062.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b3c04f279972453f97c61c1acd9973154dba89a9e21d325950bab5116e13cf6
|
| 3 |
+
size 9808999256
|