Repository navigation
feat(serve): typed decisions through /v1/systemone and /v1/decisions - #119
Merged
Merged
Conversation
TypeSafe's System One API (as llama.cpp, vLLM and Ollama serve it) and OpenAI's Decisions API, answered by the served chat model: one read per question, the first reply token's exact log probabilities of the labels (A.. for a choice, yes/Yes and no/No for a noul, 0.. for a score) read by a new readout_logprobs Op on the head's logits in the Qwen3.5 core (ExecutionOptions::readout_tokens, TokenLogprob::readout); the other cores read them from the top-20 alternatives. A system turn keeps the first token on the labels (98-99% of its probability on Bonsai 2 27B), the reads run a lane's worth at a time and share the state's cached prefix, and the responses carry label_mass, argmax_is_label and readout diagnostics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #64.
What
POST /v1/systemone(TypeSafe's System One API, in the shape llama.cpp, vLLM and Ollama serve) andPOST /v1/decisions(OpenAI's Decisions API, text only) answerchoice,noul/predicateandscorequestions about a state with the served chat model, no training and no startup option.A.. for a choice,yes/nofor a noul,0.. for a score), thinking off, one output token, greedy, no penalties, no graft.readout_logprobs(l[id] - logsumexp(l)over the public vocabulary, one CTA, FP64 oracle test) runs on the head's logits in the Qwen3.5 core's prefill (both the chunked card path andsample_from_hidden), carried throughExecutionOptions::readout_tokens→ plan → round buffers →RawTokenLogprob::readout_values→TokenLogprob::readout. Flash-Next and Gemma 4 leave it empty and the serve layer reads the labels from the token's top-20 alternatives (diagnostics.<id>.readout = "top_k", a missing label bounded by the least likely alternative).yes+Yesandno+Noadded up);confidenceis the winner's probability over the whole vocabulary;diagnostics.<id>carrieslabel_mass,argmax_is_labelandreadout.scoreis the probability-weighted level index with alegend.joint, thinking on → 400;images/files/audio/videos→ 501; 1–64 questions, 2–26 options, 2–10 levels; a label that is not one tokenizer token → 400.--max-concurrency) at a time, so other clients get the queue between windows, and every read starts with the state, which the prefix cache prefills once.systemone/openai_decisions;GET /v1index entries; docs indocs/serving.md(Typed decisions), README and the documentation map.Per-request calibration (temperature, permutations) is deferred by the user's decision.
Verification
Vast RTX 3090 (EPYC 7313, driver 595, CUDA 12.8 build, sm_86), Ternary Bonsai 2 27B,
--max-concurrency 4,scripts/pods/decision_checks.sh+decision_bench.py(added):ninfer_readout_logprobs_test(full 248320-row and 151936-row vocabularies, 1–32 ids, uniform and extreme logits, untouched slots pastcount, validation),ninfer_target_logprobs_test,ninfer_logprob_topk_test,ninfer_systemone_test(parsing of both dialects, labels, prompts, reading, responses),ninfer_rerank_test: pass.label_massequal the chat endpoint's top-20 log probabilities of the same prompt to 1e-5 (billing 0.71710 vs 0.71710; label mass 0.98292 vs 0.98292).choice, expected score, 400/501 refusals checked.Yestoyes. Both cases are read anyway.git diff --check.Not verified / limits
Rental: 1.0 h at $0.30/h on Vast (RunPod had no 3090/4090 community instance with a public IP); the instance is destroyed.