mirror of
https://github.com/hasso5703/alzeo.git
synced 2026-12-06 12:54:19 +01:00
One state, a map of typed questions (choice, score, noul), one typed answer per question with its probabilities and a confidence: the contract of TypeSafe's Jev, served by the lane this proxy fronts. Every question becomes one chat completion of exactly one token, the options are named by single-token letters (26 capitals and 562 verified two-letter pairs, tokenizer blob 0997f410c57a1f4e, identical on both lanes), and top_logprobs hands back the probability of each letter. Nothing is generated, nothing is parsed, the state is the shared prefix the radix cache reuses. Jev's aliases resolve to the served model, so the TypeSafe SDK (0.7.0, tested) runs against this box with one base URL changed. Why top_logprobs on /v1/chat/completions and never token_ids_logprob on /generate: on the served build (nightly 4ccff141d) get_token_ids_logprobs_raw appends a bare [] for a co-batched request that asked for nothing and batch_result_processor.py calls .tolist() on every entry, so the first batch that mixes one scoring request with one chat request kills the scheduler (sglang#34719, fix #35052 still open). The top-k arm slices a tensor for every request, an empty tensor at k=0, and survives the mix. A shared lane mixes on every step. The two confidence statistics are the hosted model's, identified from its live answers on 2026-09-18 and not from its docs: Choice is (p_max * N - 1) / (N - 1), 46 pairs within 0.018; Score is 1 - N * MAD_mode / floor(N^2 / 4), 120 pairs within 0.030 (their probabilities come rounded to two decimals). The docs' normalized entropy fits their two worked examples and not one live answer. Also measured on the hosted model: probabilities are sample frequencies (ten identical calls moved an option by a standard deviation of 0.014 to 0.027), and a Choice spends 17 + about 7 output tokens per option inside; this readout is a softmax that repeats to the digit and spends one token per question. Two levers ship off: SYSTEMONE_PERMUTATIONS=2 averages the given and the reversed option order, SYSTEMONE_TEMPERATURE scales the label logits; the benchmark decides on them. SYSTEMONE_MIN_LABEL_MASS=0 reports how much of the first-token probability landed on any label (x-systemone-label-mass) and can refuse a confused answer, which is what TypeSafe's CEO said a masked readout should do. bench-systemone.py sends byte-identical payloads to this box and to the hosted Jev on BoolQ (3,270), MMLU-Pro (the same 1,000 rows as ekzhang's run), French XNLI and MMMLU (500 each) and the 13 GDPR questions of TypeSafe's own cookbook, and reports accuracy, ECE, Brier, log loss, agreement and latency. Numbers land in the next commit; nothing in this one claims one. tests/test_proxy_systemone.py (37 tests, a fake engine with scripted first-token distributions), dashboard/tests/test_lifecycle.py (three outcomes added to the closed vocabulary), all existing proxy suites unchanged and green. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>