majentik commited on
Commit
d6c8c9c
·
verified ·
1 Parent(s): 253b8cf

Add model card (weights pending mlx_lm mistral3 architecture support)

Browse files
Files changed (1) hide show
  1. README.md +85 -0
README.md ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: mistralai/Mistral-Small-4-119B-2603
3
+ library_name: mlx
4
+ license: apache-2.0
5
+ tags:
6
+ - turboquant
7
+ - kv-cache-quantization
8
+ - mistral
9
+ - moe
10
+ - sparse-moe
11
+ - multimodal
12
+ - quantized
13
+ - mlx
14
+ - 2-bit
15
+ - apple-silicon
16
+ - 256k-context
17
+ - thinking
18
+ pipeline_tag: text-generation
19
+ ---
20
+
21
+ # Mistral-Small-4-119B-TurboQuant-MLX-2bit
22
+
23
+ **Dual compression: 2-bit MLX weight quantization + TurboQuant KV cache quantization** for Mistral Small 4 on Apple Silicon.
24
+
25
+ This repository provides a 2-bit weight-quantized MLX conversion of [mistralai/Mistral-Small-4-119B-2603](https://huggingface.co/mistralai/Mistral-Small-4-119B-2603) with TurboQuant KV cache quantization support. Aggressive compression for running on consumer Apple Silicon hardware.
26
+
27
+ ## Overview
28
+
29
+ This model applies two complementary compression techniques:
30
+
31
+ 1. **2-bit weight quantization (MLX)** -- reduces model weights from ~238 GB to ~30 GB
32
+ 2. **TurboQuant KV cache quantization** -- reduces KV cache from ~32 GB to ~8 GB at 256K context
33
+
34
+ This enables running a 119B-parameter MoE model on Apple Silicon Macs with 64 GB+ unified memory.
35
+
36
+ ## Model Specs
37
+
38
+ | Property | Value |
39
+ |---|---|
40
+ | Base Model | Mistral Small 4 (March 2026) |
41
+ | Total Parameters | 119B |
42
+ | Active Parameters | 6.5B per token (Sparse MoE) |
43
+ | Architecture | Sparse MoE -- 128 experts, 4 active per token |
44
+ | Context Length | 256K tokens |
45
+ | Modality | Text + Images (multimodal) |
46
+ | Capabilities | Thinking / reasoning, tool use, multilingual |
47
+ | License | Apache 2.0 |
48
+ | Weight Quantization | 2-bit (MLX) |
49
+ | KV Cache Quantization | TurboQuant 4-bit |
50
+
51
+ ## Memory Estimates
52
+
53
+ | Configuration | Weights | KV Cache (256K) | Total |
54
+ |---|---|---|---|
55
+ | FP16 baseline | ~238 GB | ~32 GB | ~270 GB |
56
+ | **This model (2-bit MLX + TurboQuant)** | **~30 GB** | **~8 GB** | **~38 GB** |
57
+
58
+ > **Note:** This is a Sparse MoE model -- only 6.5B parameters are active per token, so inference is fast despite the 119B total parameter count. The 2-bit quantization trades some quality for significantly reduced memory. Expect modest degradation on complex reasoning tasks compared to 4-bit.
59
+
60
+ ## Quickstart
61
+
62
+ ```python
63
+ from mlx_lm import load, generate
64
+
65
+ model, tokenizer = load("majentik/Mistral-Small-4-119B-TurboQuant-MLX-2bit")
66
+
67
+ prompt = "Explain sparse mixture-of-experts architectures."
68
+ messages = [{"role": "user", "content": prompt}]
69
+ text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
70
+
71
+ response = generate(model, tokenizer, prompt=text, max_tokens=512)
72
+ print(response)
73
+ ```
74
+
75
+ ## What is TurboQuant?
76
+
77
+ TurboQuant ([arXiv: 2504.19874](https://arxiv.org/abs/2504.19874)) is a KV cache quantization method that compresses the key-value cache used during autoregressive generation. It supports 4-bit (default) and 2-bit (aggressive) modes. Because it targets the KV cache rather than weights, it stacks with weight quantization for compounding memory savings.
78
+
79
+ ## See Also
80
+
81
+ - [mistralai/Mistral-Small-4-119B-2603](https://huggingface.co/mistralai/Mistral-Small-4-119B-2603) -- Base model
82
+ - [majentik/Mistral-Small-4-119B-TurboQuant](https://huggingface.co/majentik/Mistral-Small-4-119B-TurboQuant) -- KV cache only (no weight quantization)
83
+ - [majentik/Mistral-Small-4-119B-TurboQuant-MLX-4bit](https://huggingface.co/majentik/Mistral-Small-4-119B-TurboQuant-MLX-4bit) -- 4-bit MLX variant
84
+ - [majentik/Mistral-Small-4-119B-TurboQuant-MLX-1bit](https://huggingface.co/majentik/Mistral-Small-4-119B-TurboQuant-MLX-1bit) -- 1-bit MLX variant
85
+ - [TurboQuant Paper (arXiv: 2504.19874)](https://arxiv.org/abs/2504.19874)