# deg deg reads a context, takes a JSON Schema, and returns a JSON object that is valid against that schema. Most fields are **decided** by classification heads or **extracted** as spans copied from the context. New tokens are generated only for fields marked `x-generate: true`. The result costs far fewer generated tokens than writing the whole JSON out, and everything outside the generated fields is deterministic. Base model: Qwen3.5-0.8B. The full contract is in [SPEC.md](SPEC.md). ## The one flag ```json {"type": "object", "properties": { "department": {"enum": ["billing", "technical", "sales"]}, "urgent": {"type": "boolean"}, "order_id": {"type": "string"}, "reply": {"type": "string", "x-generate": true, "maxLength": 400}}, "required": ["department", "urgent", "order_id", "reply"]} ``` - `department` is decided (choice head + probabilities). - `urgent` is decided (noul head). - `order_id` is copied from the context (span pointer). - `reply` is the only field that generates tokens, bounded by `maxLength`. The mode follows only from the JSON type. There is no router, and `x-generate` is valid only on `string` or on an array of `string`. ## Status What is implemented: - schema validation and compilation into a deterministic fill plan (`deg.schema`); - response assembly and validation (`deg.response`); - deterministic span parsers (`deg.parsers`); - `/v1/fill` request parsing (`deg.request`). - the model: Qwen3.5-0.8B trunk + decision heads + span pointer + LM head (`deg.model`); - `fill(model, context, schema)` (`deg.infer`), training (`deg.train`) and evaluation (`deg.evaluate`); design in SPEC.md §12. - head-to-head bench vs structured-output baselines (`deg.bench`; results in `results/deg/bench-v1/summary.md`): `python -m deg.bench.run --system {deg,constrained,constrained-llamacpp,nuextract,clef,frontier} --set datagen-test` (extra `bench`). - JevBench (Benchmark Heaven, MIT; the 231 public typed decisions, scored by its own v1.3.0 rules, `deg.bench.jevbench`; results in `results/deg/jevbench-v1/`): `python -m deg.bench.jevbench --system {deg,systemone} ...` then `--report`. EVAL ONLY: `deg.train` refuses JevBench paths and drops any record or jev example containing a JevBench state. - **deg-suite v1** — the checkpoint/config selection metric (`deg.bench.suite`; results and design in `results/deg/suite-v1/`): one frozen held-out suite whose headline is the mean of DECIDE, EXTRACT and GENERATE, each the mean of its sources (datagen-test, JevBench, Banking77, SQuAD v2, ExtractBench, DialogSum + an open-judge, and a mixed set of real v3 val-split excerpts); invalid output scores 0 on all its fields: `CUDA_VISIBLE_DEVICES=0 python -m deg.bench.suite run --system deg --ckpt --label ` (or `results/deg/suite-v1/run_suite.sh