---
title: d1-2B-OptiQ-4bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/d1-2B-OptiQ-4bit"
md_url: "https://www.modelscope.cn/models/mlx-community/d1-2B-OptiQ-4bit.md"
repository: mlx-community/d1-2B-OptiQ-4bit
last_updated: 2026-10-30
license: other
pipeline_tag: text-classification
tasks:
  - text-classification
model_type:
  - lfm3_vl
architectures:
  - D1Model
base_model:
  - LiquidAI/d1-2B
base_model_relation: quantized
parameters: 354.8M
tensor_type:
  - BF16
  - U32
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
downloads: 12
stars: 4
tags:
  - mlx
  - optiq
  - quantized
  - 4bit
  - mixed-precision
  - liquid
  - lfm3
  - decision
  - decision-model
  - classification
  - calibration
  - system-one
  - typed-decisions
  - apple-silicon
---

# d1-2B-OptiQ-4bit

> d1-2B-OptiQ-4bit - mlx-community 在 ModelScope 开源的模型。mlx-community/d1-2B-OptiQ-4bit

mlx-community/d1-2B-OptiQ-4bit 是 ModelScope 魔搭社区上的 354.8M 参数text-classification模型，采用 other 许可，基于 LiquidAI/d1-2B 构建。

- **Repository**: mlx-community/d1-2B-OptiQ-4bit
- **License**: other
- **Tasks**: text-classification
- **Parameters**: 354.8M
- **Base model**: LiquidAI/d1-2B
- **Tags**: mlx, optiq, quantized, 4bit, mixed-precision, liquid, lfm3, decision, decision-model, classification, calibration, system-one, typed-decisions, apple-silicon
- **Downloads**: 12
- **Stars**: 4
- **Last updated**: 2026-10-30

Source: https://www.modelscope.cn/models/mlx-community/d1-2B-OptiQ-4bit

---

# mlx-community/d1-2B-OptiQ-4bit

> **Built with [mlx-optiq](https://mlx-optiq.com)**, the MLX-native toolkit to quantize, fine-tune, and serve LLMs locally on Apple Silicon, no PyTorch and no cloud. [All OptiQ quants](https://mlx-optiq.com/models) · [Docs](https://mlx-optiq.com/docs/)

An OptiQ mixed-precision quant of [LiquidAI/d1-2B](https://huggingface.co/LiquidAI/d1-2B), Liquid's decision model built on LFM3-VL-2B. It answers named, typed questions about a state (yes/no, choice, score) with a probability for every option, in one forward pass and with no generated tokens.

d1 has no separate head: each answer is read off the language model at its answer slot, after a prompt where the state and the questions read each other both ways. `optiq serve` runs that natively in MLX, with Liquid's own prompt and calibration code (shipped in this repo) so the model sees exactly what it was trained on.

## Typed Decisions

Scored on the full 400-case test split of [LocalLLaMA/typed-decisions](https://huggingface.co/datasets/LocalLLaMA/typed-decisions) (2,000 decisions) with the benchmark's own metrics, one request per case with all five questions, zero-shot.

| Model | Size | Accuracy | KL from gold ↓ | Brier ↓ | ECE ↓ |
|---|---:|---:|---:|---:|---:|
| [LiquidAI/d1-2B](https://huggingface.co/LiquidAI/d1-2B) (Liquid's runner, float32) | 3.8 GB | 0.637 | 0.2817 | 0.1370 | 0.1244 |
| **This model** | 1.7 GB | **0.641** | **0.2834** | **0.1386** | **0.1262** |
| [LiquidAI/d1-2B-MLX-4bit](https://huggingface.co/LiquidAI/d1-2B-MLX-4bit) | 1.35 GB | 0.6265 | 0.2905 | 0.1431 | 0.1304 |

How far each quant moves the answers away from the original, over the same 2,000 decisions:

| | Mean KL from the original ↓ | Answers changed ↓ | Largest probability shift ↓ |
|---|---:|---:|---:|
| **This model** | **0.011** | **8.2%** | **0.27** |
| LiquidAI/d1-2B-MLX-4bit | 0.025 | 11.3% | 0.37 |

This quant stays closer to the original than Liquid's uniform 4-bit, at about a quarter more disk (1.7 GB against 1.35 GB). Its typed-decisions accuracy is within noise of the original's. Median latency is 0.27 s per case (five questions in one request) on an Apple M3 Max.

## Run it

```bash
pip install -U mlx-optiq
optiq serve --model mlx-community/d1-2B-OptiQ-4bit
```

Then ask it questions over `POST /v1/systemone`:

```bash
curl -s localhost:8080/v1/systemone -H 'Content-Type: application/json' -d '{
  "model": "d1",
  "state": "I was charged twice and my parcel never arrived. Please refund one charge.",
  "questions": {
    "refund": {"type": "noul", "instructions": "Is the customer asking for a refund?"},
    "team": {"type": "choice", "instructions": "Which team should handle this?",
             "criteria": {"billing": "Charges, refunds, invoices", "shipping": "Delivery and parcels"}},
    "urgency": {"type": "score", "instructions": "How urgent is this ticket?", "criteria": ["low", "medium", "high"]}
  }
}'
```

Each answer comes back in d1's own shape, with its probabilities and `"output_tokens": 0`. From Python:

```python
from optiq.decision import D1

model = D1.load("mlx-community/d1-2B-OptiQ-4bit")
out = model.system_one(state, questions)
```

Yes/no, choice (including `"multiple": true`), score and estimate questions are supported, over text and JSON states. Reading spans out of the state (`text`, `number`, `date`) and pictures or video are not supported yet; the vision tower ships here at bf16 in `optiq_vision.safetensors` for when they are. Needs mlx-optiq 0.7.9 or later.

## Links

- **Project website:** [mlx-optiq.com](https://mlx-optiq.com/)
- **All OptiQ quants:** [mlx-optiq.com/models](https://mlx-optiq.com/models)
- **PyPI:** [pypi.org/project/mlx-optiq](https://pypi.org/project/mlx-optiq/)
- **Base model:** [LiquidAI/d1-2B](https://huggingface.co/LiquidAI/d1-2B)
