Instructions to use JohnP1/d1a-e2b-it-qat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use JohnP1/d1a-e2b-it-qat with PEFT:
from peft import PeftModel from transformers import AutoModel base_model = AutoModel.from_pretrained("google/gemma-4-E2B-it") model = PeftModel.from_pretrained(base_model, "JohnP1/d1a-e2b-it-qat") - Notebooks
- Google Colab
- Kaggle
Configuration Parsing Warning:In adapter_config.json: "peft.base_model_name_or_path" must be a string
![]()
D1A-E2B-it QAT Β· PyTorch
What it does: decisions (/v1/systemone), chat (OpenAI-format /v1/chat/completions, streaming and tool calls), and
photos, voice clips and video (python -m d1a.serving.media). For NVIDIA, CPU, or a Mac without MLX. On Apple Silicon use
the MLX build, JohnP1/d1a-e2b-it-qat-mlx-q4: the same adapter, faster.
The recommended D1A-E2B-it, replacing D1A-E2B-it v0.6 by the owner's decision of 2026-10-25. It is better at D1A's own
jobs (PR labels, routing, hard decisions), but D1A's release rule vetoes it on transfer-v4 (β5.2 points); see the
scorecard.
A small decision model: 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.
What's inside
- The D1A LoRA adapter (rank 16) and pointer head, trained on Google's quantization-aware-trained int4 trunk
google/gemma-4-E2B-it-qat-w4a16-ct (revision
971342c0): D1A-E2B-it v0.6's adapter, retrained for one epoch of its all-skills mix on that exact trunk (jonpol01/d1a#341). base_ctind1a_config.jsonnames that checkpoint. d1a rebuilds the trunk from it when it loads this adapter, every int4 weight written as scale Γ integer, so the adapter runs on the weights it was trained on. Exact in fp32 (D1A_DTYPE=fp32), rounded in bf16.- Calibration temperature 1.55, fitted on the MLX build's answers (decision-v7 calibration + PR-label development).
- Loading downloads Gemma 4 E2B-it (about 10 GB) and the QAT checkpoint (about 8 GB).
Run it
Needs d1a with jonpol01/d1a#346 and #348, and on a Mac's GPU (MPS) #354:
pip install "d1a[serve,media] @ git+https://github.com/jonpol01/d1a"
D1A_MERGE=0 python -m d1a.serving.serve --run JohnP1/d1a-e2b-it-qat --port 8009
Decisions and chat come from that one server: D1A_MERGE=0 keeps the adapter separate, so chat switches it off and talks as
Gemma 4 E2B-it QAT itself. Photos, voice and video come from the media server, which loads the full model with its encoders
(the QAT checkpoint's own, the vision projection QAT retrained included):
python -m d1a.serving.media --run JohnP1/d1a-e2b-it-qat --port 8010
Checks
On an Apple M1 Max, PyTorch bf16 (MPS), this repo's files as published:
- Decisions: the README's example request answers
billing0.65 (the MLX build: 0.67). - Chat: answers and streams.
- Photos, voice and video: the playground's 14 media requests all answered; 27 of 28 answers the same as the MLX build.
- The suites were measured on the MLX build of this adapter (scorecard).
Limits
- Release exception: transfer-v4 β5.2 points against D1A-E2B-it v0.6 (task types outside training). Pin
JohnP1/d1a-e2b-it@v0.6where those matter. - PyTorch on a Mac's GPU (MPS) needs d1a with jonpol01/d1a#354, or torch 2.14 or later. Before it, PyTorch's MPS embedding kernel read part of Gemma 4's per-layer embedding table as zeros: for E2B, token ids from 239,675 (tabs, some CJK, emoji, and the image start and end tokens; jonpol01/d1a#353, pytorch/pytorch#188756). The MPS checks above ran before that fix. NVIDIA, the CPU and the MLX build were never affected.
<bos>: trained with id 2 at the start of every record; d1a adds it.- Questions are in English; the documents can be English or Japanese.
License and data
Apache-2.0. Base model: Gemma 4 by Google (Apache-2.0). Code: 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.
- Downloads last month
- 28