Views
No views yet
Built with mlx-optiq, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. Try the Lab · All OptiQ quants · Docs
optiq.jsonl mix (40 samples across prose, reasoning, code, agent loops, tool-calling, instructions)optiq_metadata.json next to the safetensors.| Benchmark | OptiQ-4 (mixed) | uniform-4 | Δ |
|---|---|---|---|
| MMLU (5-shot, 1000) | 52.4% | 49.0% | +3.4 |
| GSM8K (no thinking) | 2.7% | 1.7% | +1.0 |
| IFEval (strict, full) | 64.7% | 58.6% | +6.1 |
| BFCL V3 (simple AST) | 0.0% | 0.0% | 0.0 |
| HumanEval (pass@1) | 57.9% | 45.7% | +12.2 |
| HashHop (overall) | 4.0% | 0.0% | +4.0 |
| Capability Score | 30.28 | 25.84 | +4.44 |
| KL vs bf16 (mean) | 0.136 | 0.350 | 2.6× closer |
1from mlx_lm import load, generate
2
3model, tok = load("mlx-community/MiniCPM5-1B-OptiQ-4bit")
4
5prompt = tok.apply_chat_template(
6 [{"role": "user", "content": "Summarize the plot of The Iliad in three sentences."}],
7 tokenize=False,
8 add_generation_prompt=True,
9 enable_thinking=False,
10)
11print(generate(model, tok, prompt=prompt, max_tokens=300))enable_thinking flag. With it on, the model emits a <think>...</think> block before answering, useful for math, multi-step planning, or any chain-of-thought task. The benchmark numbers above are with thinking off (the OptiQ framework forces it off for cross-family comparability).| Mode | temperature | top_p | Use when |
|---|---|---|---|
| No-think (default) | 0.7 | 0.95 | Fast assistant, rewriting, conversational |
| Think | 0.9 | 0.95 | Math, code, multi-hop reasoning |
chat_template_kwargs at the OpenAI endpoint level or as a keyword to apply_chat_template directly. optiq serve forwards chat_template_kwargs verbatim:1optiq serve --model mlx-community/MiniCPM5-1B-OptiQ-4bit --port 8000
2
3curl -s http://localhost:8000/v1/chat/completions \
4 -H "Content-Type: application/json" \
5 -d '{"model":"mlx-community/MiniCPM5-1B-OptiQ-4bit",
6 "messages":[{"role":"user","content":"What is 17 * 23?"}],
7 "chat_template_kwargs":{"enable_thinking":true}}'max_seq_length=2048 with all 7 Unsloth target modules adapted (peak ~3 GB during training, observed). The sensitivity-aware LoRA overlay reads optiq_metadata.json and gives 8-bit layers 2× the adapter rank of 4-bit layers at the same parameter budget.1optiq lora train mlx-community/MiniCPM5-1B-OptiQ-4bit \
2 --data ./my_training_data \
3 --preset default \
4 --max-seq-length 2048optiq convert openbmb/MiniCPM5-1B --target-bpw 5.0 --candidate-bits 4,81pip install mlx-optiq
2optiq convert <hf-model-id> --target-bpw 5.0 --candidate-bits 4,8
3optiq lab # full local workbench: chat, compare, quantize, fine-tune