---
title: d1a-e4b-it-8bit
canonical_url: "https://www.modelscope.cn/models/mlx-community/d1a-e4b-it-8bit"
md_url: "https://www.modelscope.cn/models/mlx-community/d1a-e4b-it-8bit.md"
repository: mlx-community/d1a-e4b-it-8bit
last_updated: 2026-10-26
license: apache-2.0
pipeline_tag: text-classification
tasks:
  - text-classification
model_type:
  - gemma4
architectures:
  - Gemma4ForConditionalGeneration
base_model:
  - JohnP1/d1a-e4b-it
base_model_relation: quantized
parameters: 1.7B
tensor_type:
  - BF16
  - U32
library_name:
  - mlx
  - safetensors
  - pytorch
frameworks:
  - pytorch
language:
  - en
  - ja
downloads: 80
stars: 0
tags:
  - d1a
  - decision-model
  - pull-requests
  - mlx
  - apple-silicon
  - quantized
  - 8-bit
  - on-device
---

# d1a-e4b-it-8bit

> d1a-e4b-it-8bit - mlx-community 在 ModelScope 开源的模型。D1A-E4B-it v0.6 · MLX 8-bit

mlx-community/d1a-e4b-it-8bit 是 ModelScope 魔搭社区上的 1.7B 参数text-classification模型，采用 apache-2.0 许可，基于 JohnP1/d1a-e4b-it 构建。

- **Repository**: mlx-community/d1a-e4b-it-8bit
- **License**: apache-2.0
- **Tasks**: text-classification
- **Parameters**: 1.7B
- **Base model**: JohnP1/d1a-e4b-it
- **Tags**: d1a, decision-model, pull-requests, mlx, apple-silicon, quantized, 8-bit, on-device
- **Downloads**: 80
- **Stars**: 0
- **Last updated**: 2026-10-26

Source: https://www.modelscope.cn/models/mlx-community/d1a-e4b-it-8bit

---

<p align="center"><img src="https://huggingface.co/JohnP1/d1a-e4b-it-mlx-q8/resolve/main/d1a-avatar.png" width="200" alt="D1A avatar: an anime girl with silver-white and dark purple hair, round glasses and headphones on a round #D1A badge"></p>

# D1A-E4B-it v0.6 · MLX 8-bit

This repository mirrors [JohnP1/d1a-e4b-it-mlx-q8](https://huggingface.co/JohnP1/d1a-e4b-it-mlx-q8) `v0.6` byte for byte (the same files, checked by LFS sha256), under tag `v0.6`.

**A small decision model for Apple Silicon: give it a document and a few questions, and it picks the answers.** Each question
is yes/no, multiple choice or a score; D1A returns a calibrated probability for every option in one forward pass, with no
generated text, so every answer is a valid option.

This is the 8-bit MLX build of [JohnP1/d1a-e4b-it](https://huggingface.co/JohnP1/d1a-e4b-it) v0.6, with the adapter merged
into its weights. Scores, training and limits are on that card; how far this build moves from the served chat build is below.

```python
from d1a import D1A   # pip install "d1a[serve,mlx,media] @ git+https://github.com/jonpol01/d1a"  (needs jonpol01/d1a#261)
m = D1A.load("mlx-community/d1a-e4b-it-8bit@v0.6")
m.decide("The customer was charged twice for the same order and wants a refund today.",
         {"team": {"type": "choice", "instructions": "Which team handles this?",
                   "criteria": {"billing": None, "shipping": None, "support": None}},
          "angry": {"type": "noul", "instructions": "Is the customer angry?"}})
```

**Not a chat model.** This build has the adapter merged into its weights, so it answers D1A decisions only; text generated
from it would come from a changed backbone, not Gemma 4 E4B-it. To chat with the same model that decides, build an unmerged
folder from the adapter: see [Enable chat](https://huggingface.co/JohnP1/d1a-e4b-it#enable-chat).

**`<bos>`: encode with it.** The Gemma 4 E4B-it tokenizer adds no `<bos>`, but this model was trained with one at the start
of every record (`d1a_config.json` records `leading_ids: [2]`). If you encode requests yourself, prepend id 2.

## What's inside

- the LoRA adapter merged into Gemma 4 E4B-it (revision `ee0ef602`); linear layers and token embeddings 8-bit (group 64), per-layer embeddings 4-bit;
- pointer head fp32 (`head.safetensors`);
- calibration temperature 1.55 in `d1a_config.json`, the run's, not refitted for this build; no use-case temperatures;
- 6.1 GB on disk for the text model, plus 0.9 GB of photo, voice and video encoders in `media/` (unchanged from the -it base).

## Against the served build

Same code, this build against the unmerged 8-bit chat build the Mac mini serves (`quality_gate.py`, Apple M1 Max): 145 demo requests (202 questions) and 92 PR-labeler states (276 questions).
- **1 of 202** demo answers and **3 of 276** labeler answers change; largest probability change 0.073;
- model time 1.01× the chat build's.

Numbers on the [D1A-E4B-it card](https://huggingface.co/JohnP1/d1a-e4b-it) were measured on the chat build, so they carry over to this build within those flips.

## Run it

```bash
pip install "d1a[serve,mlx,media] @ git+https://github.com/jonpol01/d1a"
python -m d1a.serving.serve --run mlx-community/d1a-e4b-it-8bit@v0.6 --port 8009
```

## Limits

- Everything on the [D1A-E4B-it card](https://huggingface.co/JohnP1/d1a-e4b-it#limits) applies.
- **The adapter is merged**, so this build cannot chat (above).
- **`<bos>`**: requests encoded without the leading id 2 are out of distribution.

## Versions

| Tag | What it is |
|---|---|
| **`v0.6`** | **MLX 8-bit build of D1A-E4B-it v0.6 (adapter merged)** |

## License and data

Apache-2.0. Base model: Gemma 4 by Google (Apache-2.0). Code: [github.com/jonpol01/d1a](https://github.com/jonpol01/d1a), built on Kev by Jared Palmer (Apache-2.0). Japanese decision data derived from JGLUE by Yahoo Japan Corporation and Waseda University (CC BY-SA 4.0). Pull-request data from NousResearch/hermes-agent (MIT); the labelled PR dataset itself, including the recent PRs, is private.
