Repository navigation
[Example] Serve Jev's /v1/systemone typed-decision API on top of /v1/score - #41210
luke-edward wants to merge 4 commits into
Conversation
|
@sundar24295s @fortunecookiee, as the |
|
@JustinTong0323, |
|
@JustinTong0323, could you take a look when you have a chance? |
TypeSafe's Jev API takes a state and typed questions (choice, score, noul) and returns typed answers with probabilities and confidence, no generated text. Any chat model on SGLang can answer the same shape of question in one forward pass per question by reading the next-token distribution over the answer labels, which is what /v1/score computes with label_token_ids + apply_softmax. One /v1/score call scores every question of a request as one batch. examples/runtime/systemone/systemone_server.py is a small stdlib HTTP proxy that translates /v1/systemone requests into that call and maps the scores back to Jev's answer shapes, using TypeSafe's published confidence formula. The README documents the mapping and the differences from the hosted model. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
c409c3d to
c867800
Compare
|
On c867800, the remaining |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Merged current upstream/main in 468075d without rewriting the reviewed commits. The SystemOne regression test and changed-file pre-commit pass on that head. |
Motivation
Jev (TypeSafe, Sept 15) exposes a typed-decision API: a
statepluschoice/score/noulquestions, answered with probabilities and a confidence, no generated text. vLLM merged an example server for it last week (vllm-project/vllm#57250). SGLang can serve it directly:/v1/scorewithlabel_token_idsalready returns the next-token distribution over label tokens, and one call scores every question of a request as a batch.Example only, under
examples/runtime/: no core changes, no new dependencies.cc
/v1/scoreowners @sundar24295s @chanh @fortunecookiee.Modifications
examples/runtime/systemone/systemone_server.py: stdlib HTTP proxy.POST /v1/systemonevalidates the request (400 on schema errors, 502 upstream), builds one prompt per question ending where the answer label starts, sends one/v1/scorecall, and maps the distributions to Jev's answer shapes (choiceargmax + probabilities;score= Σ i·pᵢ + legend;noul= P(Yes);confidenceper TypeSafe's published formula).--temperaturepasses through for calibration.README.md: usage, mapping, and differences from the hosted model.examples/runtime/README.md: one line.Accuracy Tests
Tested end to end on an M2 with
Qwen/Qwen2.5-0.5B-Instruct(MLX,--mlx-enable-sampling): the request from the Jev docs returns the documented shape, probabilities sum to 1 at 3 and 26 options, 27 options → 400, schema errors → 400.Speed Tests and Profiling
Not applicable.
Checklist
test/registered/if wanted.)CI States
Latest PR Test (Base): ❌ Run #37502511712
Latest PR Test (Extra): ❌ Run #37502511229
Latest PR Test (AMD ROCm 10): ❌ Run #37502511594