Text Generation
Transformers
Safetensors
deepseek_v3
unsloth
conversational
custom_code
text-generation-inference
4-bit precision
bitsandbytes
Instructions to use luisra/Kimi-K2-Instruct-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use luisra/Kimi-K2-Instruct-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="luisra/Kimi-K2-Instruct-4bit", 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("luisra/Kimi-K2-Instruct-4bit", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("luisra/Kimi-K2-Instruct-4bit", trust_remote_code=True, device_map="auto") 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 Settings
- vLLM
How to use luisra/Kimi-K2-Instruct-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "luisra/Kimi-K2-Instruct-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "luisra/Kimi-K2-Instruct-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/luisra/Kimi-K2-Instruct-4bit
- SGLang
How to use luisra/Kimi-K2-Instruct-4bit 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 "luisra/Kimi-K2-Instruct-4bit" \ --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": "luisra/Kimi-K2-Instruct-4bit", "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 "luisra/Kimi-K2-Instruct-4bit" \ --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": "luisra/Kimi-K2-Instruct-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Desktop
- Docker Model Runner
How to use luisra/Kimi-K2-Instruct-4bit with Docker Model Runner:
docker model run hf.co/luisra/Kimi-K2-Instruct-4bit
Add files using upload-large-folder tool
Browse files- model-00006-of-00107.safetensors +3 -0
- model-00013-of-00107.safetensors +3 -0
- model-00014-of-00107.safetensors +3 -0
- model-00016-of-00107.safetensors +3 -0
- model-00019-of-00107.safetensors +3 -0
- model-00021-of-00107.safetensors +3 -0
- model-00023-of-00107.safetensors +3 -0
- model-00026-of-00107.safetensors +3 -0
- model-00038-of-00107.safetensors +3 -0
- model-00043-of-00107.safetensors +3 -0
- model-00065-of-00107.safetensors +3 -0
- model-00070-of-00107.safetensors +3 -0
- model-00079-of-00107.safetensors +3 -0
- model-00085-of-00107.safetensors +3 -0
- model-00092-of-00107.safetensors +3 -0
- model-00100-of-00107.safetensors +3 -0
- model-00102-of-00107.safetensors +3 -0
- model-00105-of-00107.safetensors +3 -0
- model-00107-of-00107.safetensors +3 -0
- model.safetensors.index.json +1 -1
model-00006-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d4a38fb9b36085089a9653ef663cf231ac2109e8ee27c57e5662c9d9a6b4d5b6
|
| 3 |
+
size 4996629442
|
model-00013-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20cc428e9beeb6529de5d61f9837374ea6f080cb43dc3865b18b0e84e3117bb0
|
| 3 |
+
size 4996629624
|
model-00014-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:792301952cf321895a5f95fe3561a2c1448a5efc4933c3ec72aef48ec2fd76d6
|
| 3 |
+
size 4999514217
|
model-00016-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b36c6ed56e9e787b51b9704b354032f26c9e433d5b7d96b79aac36176edc842
|
| 3 |
+
size 4999515144
|
model-00019-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e302c9e44841a4ea7e0e7ed0212b59ce79547b16ca2d25010b63e359ed90c680
|
| 3 |
+
size 4996632293
|
model-00021-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ccff52b852bff5e492f15c3757f1db8159915b2c9eef5e4cf66de851bc5205ff
|
| 3 |
+
size 4999517981
|
model-00023-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:236a209a1d16fda94f70f7b3779d5c52b4fd80dc1729f56cb0f39260edfa9b24
|
| 3 |
+
size 4999518902
|
model-00026-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:50d291962c32c8219206a64beb701b0d4aa99d50ba86758597400a32b9b31184
|
| 3 |
+
size 4996632290
|
model-00038-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:af3cb52f71f8c9ab8db63b87cdd51aa63741b5b552643766cbbcb29c3506c2d1
|
| 3 |
+
size 4996632292
|
model-00043-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:35ed03d88b951cf58ae80d835fa541881c04de3ddf5d9c17072bd617b3f40ebb
|
| 3 |
+
size 4996633384
|
model-00065-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c12536ea9fd0fbe2b20c9efa249ea38de9137c2e85d782eab9b34814d0faf937
|
| 3 |
+
size 4999517708
|
model-00070-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:46f4072b3d4edcffae5031b00a2ce1238ac4ccba723e822df7a666907d3c8fd1
|
| 3 |
+
size 4996632298
|
model-00079-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20c69049ee2776caa8ba76c4d47c5dc3784786fb4cfe15f87f70082979ac0f3b
|
| 3 |
+
size 4996632287
|
model-00085-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a43210a14b4ed95eee5a9736c25bc65fcb3ceed1cd2e306a9560067bdbe65fae
|
| 3 |
+
size 4999519442
|
model-00092-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f61e364bc2fc1df5b7f32a0077cd017017970a1e5bdc70437a33c398c1bf91fd
|
| 3 |
+
size 4999519443
|
model-00100-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b5253b4c5e174955f8157b0b2420038728e6ec283b0cc518d11b99e3ddd28a4f
|
| 3 |
+
size 4996632285
|
model-00102-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1d8e20768e77775563140e3c291c8a4f8ec864eaa2ecd4ef3ff9ae6a5d95978f
|
| 3 |
+
size 4999517678
|
model-00105-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57a0d6b44eba9c800c3a606987408be6527bd1fe0a362964614f03f6619b3e8e
|
| 3 |
+
size 4996632289
|
model-00107-of-00107.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7a8db7ed764d65a18eb7ddbad76d070b43236d98f2ab7a7ec2df0ed399f85a21
|
| 3 |
+
size 3589089021
|
model.safetensors.index.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 43419708
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f1b1544ec27d5125df4f7862fb1677925fdaaca77f31b5400f0b09aed03e517a
|
| 3 |
size 43419708
|