Instructions to use bearzi/Kimi-K2.7-Code-JANGTQ_K with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use bearzi/Kimi-K2.7-Code-JANGTQ_K 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("bearzi/Kimi-K2.7-Code-JANGTQ_K") 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 bearzi/Kimi-K2.7-Code-JANGTQ_K with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "bearzi/Kimi-K2.7-Code-JANGTQ_K"
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": "bearzi/Kimi-K2.7-Code-JANGTQ_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use bearzi/Kimi-K2.7-Code-JANGTQ_K 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 "bearzi/Kimi-K2.7-Code-JANGTQ_K"
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 bearzi/Kimi-K2.7-Code-JANGTQ_K
Run Hermes
hermes
- OpenClaw new
How to use bearzi/Kimi-K2.7-Code-JANGTQ_K with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "bearzi/Kimi-K2.7-Code-JANGTQ_K"
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bearzi/Kimi-K2.7-Code-JANGTQ_K" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- MLX LM
How to use bearzi/Kimi-K2.7-Code-JANGTQ_K with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "bearzi/Kimi-K2.7-Code-JANGTQ_K"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "bearzi/Kimi-K2.7-Code-JANGTQ_K" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bearzi/Kimi-K2.7-Code-JANGTQ_K", "messages": [ {"role": "user", "content": "Hello"} ] }'
Kimi-K2.7-Code-JANGTQ_K
JANGTQ (JANG TurboQuant) quantization of moonshotai/Kimi-K2.7-Code for MLX on Apple silicon. TurboQuant applies a random-sign Hadamard rotation, a per-row FP16 norm, and a per-layer Lloyd-Max codebook to the routed experts, keeping the backbone at higher precision.
Profile: JANGTQ_K
| Component | Precision |
|---|---|
| Routed experts | gate 2-bit, up 2-bit, down 4-bit |
| Attention | 8-bit |
| Shared experts | 8-bit |
| Dense MLP | 8-bit |
| Embeddings | 8-bit |
| LM head | 8-bit |
| Norms / router | FP16 |
Requirements
- Load with the
jang-toolsPython package or vMLX. Not supported by stock MLX, LM Studio, or Ollama. - Kimi's tokenizer uses tiktoken and custom code:
pip install tiktoken blobfileand setTRANSFORMERS_TRUST_REMOTE_CODE=1.
Usage
import os
os.environ["TRANSFORMERS_TRUST_REMOTE_CODE"] = "1"
from jang_tools.load_jangtq import load_jangtq_model as load
from mlx_lm import generate
model, tokenizer = load("bearzi/Kimi-K2.7-Code-JANGTQ_K")
msgs = [{"role": "user", "content": "Write a Python function that reverses a string."}]
prompt = tokenizer.apply_chat_template(msgs, add_generation_prompt=True, tokenize=False)
print(generate(model, tokenizer, prompt=prompt, max_tokens=512, verbose=True))
License
Inherited from the base model moonshotai/Kimi-K2.7-Code; quantization does not change the upstream terms. Attribution is required only for very large commercial deployments (see the license link above).
- Downloads last month
- 1,074
Quantized
Model tree for bearzi/Kimi-K2.7-Code-JANGTQ_K
Base model
moonshotai/Kimi-K2.7-Code