Text Generation
MLX
Safetensors
mistral3
rotorquant
kv-cache-quantization
8bit
weight-quantization
leanstral
lean4
formal-proofs
theorem-proving
quantized
apple-silicon
mistral
Mixture of Experts
8-bit precision
Instructions to use majentik/Leanstral-RotorQuant-MLX-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use majentik/Leanstral-RotorQuant-MLX-8bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # if on a CUDA device, also pip install mlx[cuda] # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("majentik/Leanstral-RotorQuant-MLX-8bit") prompt = "Once upon a time in" text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- MLX LM
How to use majentik/Leanstral-RotorQuant-MLX-8bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Generate some text mlx_lm.generate --model "majentik/Leanstral-RotorQuant-MLX-8bit" --prompt "Once upon a time"
- Atomic Chat
Card accuracy sweep: honest brand labeling, remove dead links, upstream KV tip
Browse files39 unmodified lines404142434344454629 unmodified lines7677787979808182838485868781828384858687888921 unmodified lines11111211311511411511618 unmodified lines13513613714013814213914414014614139 unmodified lines
**8-bit MLX weight-quantized [Leanstral-2603](https://huggingface.co/mistralai/Leanstral-2603) with [RotorQuant](https://github.com/scrya-com/rotorquant) KV-cache quantization for Lean 4 formal proof generation on Apple Silicon.**
Leanstral is the first open-source AI agent purpose-built for Lean 4 formal proofs -- generating both executable code and machine-checkable mathematical proofs. This variant combines **dual compression**: 8-bit MLX weight quantization for reduced model size plus RotorQuant KV-cache quantization for efficient long-context inference with faster prefill and decode.Leanstral is the first open-source AI agent purpose-built for Lean 4 formal proofs -- generating both executable code and machine-checkable mathematical proofs. This variant combines **dual compression**: 8-bit MLX weight quantization for reduced model size plus the legacy RotorQuant KV-cache fork (superseded by upstream llama.cpp KV options) for efficient long-context inference with faster prefill and decode.
Approximate model size: **~120 GB**
29 unmodified linesprint(response)```
## What is RotorQuant?## About the RotorQuant / TurboQuant labels
[RotorQuant](https://github.com/scrya-com/rotorquant) is a rotation-based KV cache quantization method that applies learned Clifford algebra rotations before quantizing the key-value cache. Key results:
- **5.3x faster prefill** compared to TurboQuant baseline- **28% faster decode** throughput- **Perplexity: 6.91** vs 7.07 for TurboQuant (lower is better)
Combined with MLX 8-bit weight quantization, this dual compression approach makes it feasible to run Leanstral's ~119B parameter model on Apple Silicon hardware with excellent throughput.RotorQuant and TurboQuant are this project's **release labels**, not distinctquantization algorithms — for any given tier, both brand repos carrybyte-identical weights produced with the standard MLX / llama.cpp quantizers.No brand-specific speedup is claimed or measured. The KV-cache fork theselabels originally referred to is legacy; for KV-cache memory savings use theupstream options described above (`-ctk/-ctv q8_0`, `OLLAMA_KV_CACHE_TYPE`).
## KV-Cache Quantization Comparison
21 unmodified lines## See Also
- [mistralai/Leanstral-2603](https://huggingface.co/mistralai/Leanstral-2603) -- Base model- [majentik/Leanstral-RotorQuant-MLX-4bit](https://huggingface.co/majentik/Leanstral-RotorQuant-MLX-4bit) -- MLX 4-bit + RotorQuant- [majentik/Leanstral-RotorQuant-MLX-2bit](https://huggingface.co/majentik/Leanstral-RotorQuant-MLX-2bit) -- MLX 2-bit + RotorQuant- [majentik/Leanstral-TurboQuant-MLX-8bit](https://huggingface.co/majentik/Leanstral-TurboQuant-MLX-8bit) -- MLX 8-bit + TurboQuant- [RotorQuant GitHub](https://github.com/scrya-com/rotorquant)18 unmodified lines
| Variant | Runtime | Approx size | Use case ||---|---|---|---|| [RotorQuant](https://huggingface.co/majentik/leanstral-rotorquant) | runtime modifier | n/a | KV-cache root (weight-agnostic) || [RotorQuant-MLX-2bit](https://huggingface.co/majentik/leanstral-rotorquant-mlx-2bit) | mlx-lm | card-only | Apple Silicon, smallest || [RotorQuant-MLX-4bit](https://huggingface.co/majentik/leanstral-rotorquant-mlx-4bit) | mlx-lm | card-only | Apple Silicon balanced || **RotorQuant-MLX-8bit** | mlx-lm | card-only | Apple Silicon reference || [TurboQuant](https://huggingface.co/majentik/leanstral-turboquant) | runtime modifier | n/a | KV-cache root (weight-agnostic) || [TurboQuant-MLX-2bit](https://huggingface.co/majentik/leanstral-turboquant-mlx-2bit) | mlx-lm | card-only | Apple Silicon, smallest || [TurboQuant-MLX-4bit](https://huggingface.co/majentik/leanstral-turboquant-mlx-4bit) | mlx-lm | card-only | Apple Silicon balanced || [TurboQuant-MLX-8bit](https://huggingface.co/majentik/leanstral-turboquant-mlx-8bit) | mlx-lm | card-only | Apple Silicon reference |README.md+8-14