Downloads · 30 days
164
7% of all-time downloads
brabooObrabo/Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX
Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX is a text generation model from brabooObrabo. Use it when you need the model to write or continue text. It is set up for mlx. The card lists the license as mit.
<div align="center" <h1<em<strongKimi-Linear-48B-A3B-Instruct · MXFP4 · 32-Group (MLX)</strong</em</h1 <strongmoonshotai/Kimi-Linear-48B-A3B-Instruct</strong base model that has been quantized<br with <codemlx-lm 0.28…
Downloads · 30 days
164
7% of all-time downloads
All-time downloads
2.5K
Public
Parameters
49.1B
26.1 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors26.1 GB · 100%
How the weights are stored.
U3249.1B · 100%
From the Hugging Face model README
config.json.--max-kv-size).tiktoken-based BPE (tokenizer_config.json, tiktoken.model) with special tokens defined inside the tokenizer files instead of hard-coded IDs.chat_template.jinja for the multi-turn schema that mirrors the official Kimi tool-call format.moonshotai/Kimi-Linear-48B-A3B-Instruct release.mlx-lm (>=0.28.4) via python3 -m mlx_lm.convert -q targeting MXFP4 weights.quantization_config.model-0000n-of-00005.safetensors plus model.safetensors.index.json for streaming loads.Quantization snippet (abbreviated from config.json):
"quantization_config": {
"group_size": 32,
"bits": 4,
"mode": "mxfp4",
"model.layers.1.mlp.gate": {"group_size": 64, "bits": 8},
"model.layers.2.mlp.gate": {"group_size": 64, "bits": 8},
"model.layers.3.mlp.gate": {"group_size": 64, "bits": 8},
"...": "additional gate entries continue through layer 26"
}
| File | Purpose |
|---|---|
config.json, generation_config.json, configuration_kimi.py | Hugging Face config + custom MLX config class. |
model-0000*-of-00005.safetensors, model.safetensors.index.json | Quantized MXFP4 shards. |
modeling_kimi.py | Custom model definition (inherits KimiLinearForCausalLM). |
tokenizer_config.json, special_tokens_map.json, tiktoken.model, tokenization_kimi.py | Tokenizer assets. |
chat_template.jinja | HF chat template for AutoTokenizer.apply_chat_template. |
README.md, README-kr.md | English/Korean model cards. |
modeling_kimi.py defines custom modules, so you must use --trust-remote-code with the CLI and trust_remote_code=True with the Python API. Handle sensitive data in an offline, isolated environment.Install MLX tooling (macOS 13.6+ on Apple Silicon):
pip install -U mlx-lm # or: pip install -U "git+https://github.com/ml-explore/mlx-lm.git@main"
# Offline cache only:
# HF_HUB_OFFLINE=1 TRANSFORMERS_OFFLINE=1 ...
Chat CLI (template + stop rules auto-applied):
mlx_lm.chat \
--model /path/to/Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX \
--trust-remote-code \
--max-tokens 512 --temperature 0.7 --top-p 0.9
For ≥256K contexts, consider --max-kv-size 262144 (and scale further as needed).
Programmatic usage:
from mlx_lm import load, generate
from mlx_lm.sample_utils import make_sampler, make_logits_processors
model, tok = load(
"/path/to/Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX",
trust_remote_code=True,
)
messages = [{"role": "user", "content": "Kimi Linear 구조를 간단히 요약해줘."}]
prompt = tok.apply_chat_template(messages, add_generation_prompt=True)
sampler = make_sampler(temperature=0.7, top_p=0.9)
procs = make_logits_processors(repetition_penalty=1.1, repetition_context_size=64)
print(
generate(
model,
tok,
prompt,
max_tokens=512,
sampler=sampler,
logits_processors=procs,
)
)
(Set HF_HUB_OFFLINE=1 and/or TRANSFORMERS_OFFLINE=1 before running if you need hub-less operation.)
moonshotai/Kimi-Linear-48B-A3B-Instruct (synced 2025-11-07 UTC).python3 -m mlx_lm.convert \
--hf-path moonshotai/Kimi-Linear-48B-A3B-Instruct \
--q-bits 4 -q \
--group-size 32 \
-o Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX
mlx_lm.chat sanity prompts and safetensors checksum inspection.After upload, verify shard integrity locally:
cd /path/to/Kimi-Linear-48B-A3B-Instruct-MXFP4-GS32-MLX
shasum -a 256 model-*.safetensors > SHA256SUMS
shasum -c SHA256SUMS
--trust-remote-code whenever loading this repository through MLX CLIs to ensure the custom layers in modeling_kimi.py are registered.mlx_lm.cache_prompt) plus --max-kv-size for reliable ≥1M-token experiments without exhausting unified memory.If you use this model, please cite both Moonshot AI and this quantized release in your research or product documentation.