Instructions to use pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec 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("pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec") 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 pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec"
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": "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec 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 "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec"
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 pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec
Run Hermes
hermes
- MLX LM
How to use pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec", "messages": [ {"role": "user", "content": "Hello"} ] }'
Kimi-K2.7-Code-MLX-4bit-hiprec
MLX (Apple Silicon) conversion of moonshotai/Kimi-K2.7-Code — a ~1T-parameter (32B active) DeepSeek-V3-style MoE coding model. Text-only build (vision tower dropped during conversion).
What "hiprec" means
The source checkpoint is natively 4-bit: its routed experts ship as compressed-tensors int4 (group size 32), while the attention, shared/dense MLPs and lm_head are left in bf16. The experts (the ~95% bulk) therefore cannot be made higher-precision — there is no 5/6/8-bit version of this model to convert from.
This build keeps the experts at their native 4-bit and quantizes the otherwise-bf16 layers to 6-bit (group 64) instead of crushing them to 4-bit. Net effect (~5.0 bits/weight, ~600 GB): higher fidelity on attention/router/dense/lm_head than a uniform-4-bit MLX build, at a small size premium.
If you want the smallest footprint instead, the uniform sub-4-bit community builds (inferencerlabs 3.5-bit, spicyneuron 3.6-bit, mlx-community 4-bit) are the alternatives.
Requirements
~600 GB on disk and roughly 768 GB+ of unified memory to run (it does not fit a 512 GB machine).
Use with mlx-lm
pip install mlx-lm
python -m mlx_lm generate --model pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec --trust-remote-code --prompt "Write a Python LRU cache." -m 512
Validation
Not run-tested by the publisher — the model exceeds the conversion host's RAM. Verified by file-integrity check (weight index, shard presence, config, tokenizer) only.
License
Released under the Kimi K2 license (see LICENSE). Quantization config (excerpt): bits=4, group_size=32 for experts; non-expert layers at 6-bit/group-64.
- Downloads last month
- 829
4-bit
Model tree for pipenetwork/Kimi-K2.7-Code-MLX-4bit-hiprec
Base model
moonshotai/Kimi-K2.7-Code