Instructions to use mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit"
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit
Run Hermes
hermes
- MLX LM
How to use mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mlx-community/moonshotai_Kimi-K2-Instruct-mlx-3bit", "messages": [ {"role": "user", "content": "Hello"} ] }'
Upload 5 files
Browse files
model-00026-of-00091.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:270f7454ffa881a4c7b77eef212d9024872335c586e464f46b3e13d904c111ef
|
| 3 |
+
size 5001553719
|
model-00027-of-00091.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:96a6fc10df20881ba8ec9f9fa1fadbf8c5860f97933b88aafc06b6571447a8e0
|
| 3 |
+
size 5001553651
|
model-00028-of-00091.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ddc0c8a9eb9633822bcedf7d0108d4065f1452e90ed326d62b3a09c7a54b0328
|
| 3 |
+
size 4932502298
|
model-00029-of-00091.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:734edabdb571b5fe94f72a51e3ac3dd09c9c2d30cd18f7003b9a484dc1750a38
|
| 3 |
+
size 5001553765
|
model-00030-of-00091.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f60ff36dcde9098d63c9f0bf453de710ed108119d725031ea88d9764f5222090
|
| 3 |
+
size 5001553687
|