Kimi-K2 is a massive 671B parameter MoE model. Choose your quantization based on available unified memory:
1from mlx_lm import load, generate
2
3model, tokenizer = load("richardyoung/Kimi-K2-Instruct-0905-MLX-8bit")
4print(generate(model, tokenizer, prompt="Explain quantum entanglement simply:", max_tokens=200))
1mlx_lm.generate \
2 --model richardyoung/Kimi-K2-Instruct-0905-MLX-8bit \
3 --prompt "Write a Python script to analyze CSV files." \
4 --max-tokens 500
1from mlx_lm import load, generate
2
3model, tokenizer = load("richardyoung/Kimi-K2-Instruct-0905-MLX-8bit")
4
5conversation = """<|im_start|>system
6You are a helpful AI assistant specialized in coding and problem-solving.<|im_end|>
7<|im_start|>user
8Can you help me optimize this Python code?<|im_end|>
9<|im_start|>assistant
10"""
11
12response = generate(model, tokenizer, prompt=conversation, max_tokens=500)
13print(response)
1from mlx_lm import load, generate
2
3model, tokenizer = load("richardyoung/Kimi-K2-Instruct-0905-MLX-8bit")
4
5for token in generate(
6 model,
7 tokenizer,
8 prompt="Tell me about the future of AI:",
9 max_tokens=500,
10 stream=True
11):
12 print(token, end="", flush=True)
1mlx_lm.convert \
2 --hf-path moonshotai/Kimi-K2-Instruct-0905 \
3 --mlx-path Kimi-K2-Instruct-0905-MLX-8bit \
4 -q --q-bits 8 \
5 --trust-remote-code
Apache 2.0 - Same as the original model. Free for commercial use!
1@misc{kimi-k2-2025,
2 title={Kimi K2: Advancing Long-Context Language Models},
3 author={Moonshot AI},
4 year={2025},
5 url={https://huggingface.co/moonshotai/Kimi-K2-Instruct-0905}
6}
Quantized with ❤️ by richardyoung
If you find this useful, please ⭐ star the repo and share with others!
Created: October 2025 | Format: MLX 8-bit