Instructions to use staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx 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("staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx") 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
- MLX LM
How to use staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx", "messages": [ {"role": "user", "content": "Hello"} ] }' - Atomic Chat
DeepSeek-R1-Distill-Llama-70B-lecore-mlx
MLX mixed-precision quantization of deepseek-ai/DeepSeek-R1-Distill-Llama-70B, with the bit width of every
linear layer picked by leCore Unicron requantize (per-tensor bits chosen by measurement), ported to GPU for this model size.
How the bits were chosen
- Each decoder linear tensor was quantized alone (MLX affine, group 64 during measurement) at 2, 3 and 4 bits; the damage was measured as KL(fp16 || quantized) on next-token distributions over a calibration mix (3066 WikiText-2 train tokens, 1022 Python-source tokens, and leCore's structured probe: prose, code, SQL, markdown).
- Bits were assigned greedily: start at 4 bits everywhere, repeatedly take the downgrade with the least measured damage per byte saved until the predicted file size fit the budget. Embeddings 4-bit, lm_head 6-bit, group size 64.
- Converted with
mlx_lm.convertand a per-layerquant_predicate. Bit histogram (linear tensors): {'2': 251, '3': 205, '4': 102, '8': 0, '16': 2}.
Measured results (held-out: WikiText-2 test + a different Python-source slice, seq 512)
Perplexity was computed on the exact shipped weights (MLX tensors dequantized with mx.dequantize, run in bf16 on GPU).
"bpw" = integer bits + 0.5 for the bf16 scale/bias per group of 64.
| Model | Size (GB, weights) | bpw | WikiText-2 ppl (32704 tok) | Python-code ppl (8176 tok) |
|---|---|---|---|---|
| bf16 reference | – | 16 | 8.2625 | 3.8528 |
| this repo (leCore Unicron mix) | 26.77 | 3.033 | 14.1309 | 6.8978 |
| stock MLX 3-bit, group 64 | 30.87 | 3.500 | 155.2344 | 11.5845 |
Benchmarks (lm-eval-harness 0.4.9, run on the shipped weights dequantized to bf16 on GPU)
MMLU 5-shot on the first 10 questions of each of the 57 subjects; GSM8K 5-shot on the first 100 test problems (greedy, 320 new tokens, no chat template). These are subsets, so expect about ±2–4 points of sampling noise.
| Model | MMLU (5-shot) | GSM8K strict | GSM8K flexible |
|---|---|---|---|
| leCore mix (this repo) | 69.8% | 83.0% | 86.0% |
| stock 3-bit affine, group 64 (simulated) | 25.3% | 0.0% | 0.0% |
Only measured numbers are reported. No downstream-task benchmarks were run. Short-context perplexity does not tell you everything about quality, so check outputs for your own use case.
Usage (Apple Silicon)
pip install -U mlx-lm
mlx_lm.generate --model staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx --prompt "Hello" --max-tokens 256 --max-kv-size 8192
Weights are ~26.77 GB. On a 36 GB Mac you may need to raise the GPU wired-memory limit, e.g. sudo sysctl iogpu.wired_limit_mb=30000.
License
Base model: deepseek-ai/DeepSeek-R1-Distill-Llama-70B, released by DeepSeek under the MIT License. That model is fine-tuned from Llama-3.3-70B-Instruct, so the Llama 3.3 Community License Agreement also applies (https://www.llama.com/llama3_3/license/), including its Acceptable Use Policy. Built with Llama. Only quantization was done here: no retraining.
- Downloads last month
- 345
3-bit
Model tree for staccs/DeepSeek-R1-Distill-Llama-70B-lecore-mlx
Base model
deepseek-ai/DeepSeek-R1-Distill-Llama-70B