Text Classification
MLX
Safetensors
English
Japanese
gemma4
d1a
decision-model
pull-requests
apple-silicon
quantized
8-bit precision
on-device
Instructions to use mlx-community/d1a-e4b-it-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/d1a-e4b-it-8bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download mlx-community/d1a-e4b-it-8bit --local-dir d1a-e4b-it-8bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
|
Download README.md from mlx-community/d1a-e4b-it-8bit: direct link, hf CLI and curl.
- Browser
- Download file 4.32 kB
-
https://huggingface.co/mlx-community/d1a-e4b-it-8bit/resolve/main/README.md
- Command line
-
hf download hf://mlx-community/d1a-e4b-it-8bit/README.md
-
curl -L -o README.md https://huggingface.co/mlx-community/d1a-e4b-it-8bit/resolve/main/README.md
4.32 kB
| license: apache-2.0 | |
| base_model: JohnP1/d1a-e4b-it | |
| base_model_relation: quantized | |
| library_name: mlx | |
| pipeline_tag: text-classification | |
| language: [en, ja] | |
| tags: [d1a, decision-model, pull-requests, mlx, apple-silicon, quantized, 8-bit, on-device] | |
| <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. | |