DEP: Native System One endpoint (`/v1/systemone`)
Amended 2026-09-30: P0 review changes (one forward pass per question, execution binding, aggregated workers only, tenant isolation, calibration wording) and a surfaces section.
Summary
This DEP adds POST /v1/systemone to the Dynamo frontend. The route implements the TypeSafe/Jev wire protocol, where a client asks noul, choice and score questions about a state and gets probabilities back instead of generated text.
The scope is the generative readout, which works with any chat model Dynamo already serves. The handler renders the state once, then scores each question as a one-token completion over the shared token prefix, using logprob_token_ids. The vLLM backend supports this today without engine changes.
The design copies the behavior of SGLang's merged /v1/systemone route (SGLang PR 41208): same prompt, labels, scoring, confidence and response. A client should get the same answers from either server. What Dynamo adds is placement across replicas, so all the questions of a request land on the worker holding the state prefix, and one route that works over several backends.
Motivation
A System One model answers structured questions about a state with a probability for every allowed answer. Each question costs one prefill and one scored token, with no decode loop. The TypeSafe/Jev HTTP API has become the common interface for these models and the official SDKs target it. Today the options for serving it are side-car wrappers (openjev-sglang, AnyJev used as a library), SGLang's single-engine route, or the closed Jev API.
Dynamo already has most of the pieces:
- The frontend enables routes per model type.
POST /v1/classifyand/v1/poolingare registered inget_endpoints_routerand switched on throughstate.flagswhen a worker of that type registers./v1/systemonecan follow the same pattern. logprob_token_idsalready flows from the request allowlist through the preprocessor to vLLM's sampling params, so the vLLM path needs no engine change.- The KV-aware router can place the state prefix on one worker, and worker pinning can keep the rest of the request there. A single-engine route or a side-car cannot do this across replicas.
Current support across the ecosystem (checked September 2026):
| Project | System One support |
|---|---|
TypeSafe / Jev (api.typesafe.ai) |
Closed reference model, defines the wire protocol |
| vLLM | No built-in endpoint. vLLM PR 57250 (DiffusionGemma structured reads, merged 2026-09-22) includes an example /v1/systemone proxy. vLLM PR 57417 and vLLM PR 58216 (merged) make DiffusionGemma honor logprob_token_ids. vLLM PR 58429 (Laya typed-decision models) is open. Maintainers are discussing a built-in endpoint but there is no public proposal yet. The existing /generative_scoring route scores label_token_ids in one step. |
| SGLang | Built-in /v1/systemone (SGLang PR 41208, merged 2026-09-25), built on the candidate scoring from SGLang PR 40826. The earlier /v1/decisions proposal (SGLang PR 40992) was closed and merged into it. There is also the standalone ekzhang/openjev-sglang wrapper. |
| AnyJev (Nokia applied research) | Library: label logprobs, cyclic-shift debiasing, batch-prior calibration |
| Standalone servers | razorback16/openjev (DiffusionGemma 26B-A4B on vLLM or MLX, plus Laya and Verdict encoders), yijunyu/jev-rs (Rust, on llama-server or any OpenAI-compatible backend), TheoLeeCJ/SemIf, formerly OpenJev (llama.cpp, MLX, WebGPU) |
| Dynamo | None today (this DEP) |
Goals and non-goals
Goals:
- Serve
/v1/systemonefrom the Dynamo frontend. - Support any served chat model, with per-backend capability checks.
- Return the same answers as SGLang's
/v1/systemonefor the same model and chat template, and match TypeSafe's documented examples and the official SDKs.
Non-goals for v1:
/permuteand/separate(Jev and LocalAI extensions), thestatsandassets_usedfields, and streaming.- System One models that are not chat models (see Future work).
Wire protocol
POST /v1/systemone
{ "model": "<served-model>",
"state": <string|object|array>,
"questions": { "<id>": { "type": "noul|choice|score",
"instructions": "...",
"criteria": ... } } }The three question types:
noulis a yes/no question.criteriais optional and can describe each side as{"true": ..., "false": ...}. The answer isnoul, the probability of true, with noconfidence.choicetakescriteriaas a map from option name to description (the description can benull). The answer haschoice,probabilitieskeyed by option name, andconfidence.scoretakescriteriaas an ordered list of levels. The answer hasscore(the expected level index, starting at 0),legendandprobabilitieskeyed"0"to"L-1", andconfidence.
The response is { "model", "answers": { <id>: ... }, "usage": { "input_tokens", "output_tokens" } }. Validation errors return 422 with FastAPI's {"detail":[...]} list. Overload returns 529 with Retry-After, which is already Dynamo's default overload status (DYN_HTTP_OVERLOAD_STATUS_CODE). The SDKs send a Bearer token, which Dynamo treats as it does for its other routes. The protocol does not define usage, so we follow SGLang: input_tokens counts every scored prompt and output_tokens is 0.
Confidence
Every implementation we checked computes choice confidence the same way, clamped to [0, 1]. Score confidence has two versions in the wild:
choice: (K * pmax - 1) / (K - 1)
score (adapter): 1 - E|i - mode| / mean|i - (L-1)/2| # typesafe-ai/system-one-adapter-python
score (alt): (L * pmax - 1) / (L - 1) # choice formula applied to levelsTypeSafe's docs have one score example (p = [0, 0.95, 0.05]), and both formulas give 0.925 on it, so the docs don't decide. They differ on spread-out distributions: p = [0.5, 0, 0.5] gives 0 with the adapter formula and 0.25 with the other. We use the adapter formula, floored at 0, as SGLang does. It is TypeSafe's own published code and it takes the order of the levels into account. A question with a single option or level gets confidence 1.
None of these numbers says how likely the answer is to be right. probabilities is a softmax over the offered labels, confidence is the compatibility statistic above, and x_label_mass is the raw mass on the labels. Thresholds must be validated on labeled data from the target workload. If we ever add a calibrated output, it gets its own name and version; it does not replace the raw distribution.
Design
Why a core endpoint
The frontend extension hook only supports static GET routes (frontend_extension.rs: "Currently only GET routes are supported") and can't call engines. So the endpoint follows the pattern of the experimental Anthropic messages API: an off-by-default flag and a handler that translates to the OpenAI protocol internally and calls an existing engine. Here that engine is the completions engine, called with token-ID prompts.
Surfaces
The decision logic, meaning prompt building, label verification, the one-token read and scoring, lives in frontend-crates and does not care which route is calling. Dynamo exposes it through two adapters:
POST /v1/systemone, the TypeSafe/Jev wire protocol. Prompt format v1, the label set, the 422 detail list and the confidence formulas follow SGLang's route, and the ecosystem around it (the official TypeSafe SDK, open decision model families like vLLM SR's Decision 1.0, openjev-sglang) already speaks it.POST /v1/decisions, SGLang's native shape (input,choice/score/yes_no,label_mass), on the same core.
An adapter is a thin mapping over the neutral question model (kind, id, instructions, options, levels); it touches no engine path, admission rule or scoring semantics. A new surface means another adapter, not a redesign. OpenAI announced a Decisions API at DevDay 2026 and its spec is not public yet; when it is, and when it lands in async-openai (which dynamo-protocols builds on), it becomes a third adapter the same way. Everything in this DEP constrains the core, so every adapter inherits it.
P0 targets general chat models. DiffusionGemma should work through its logprob_token_ids support and needs a validation test. Encoder models with trained heads (Laya, Jev-style) need a different engine path and stay in the follow-up DEP.
Files
Paths checked against upstream main:
| Change | Location |
|---|---|
EndpointType::SystemOne variant |
lib/llm/src/endpoint_type.rs |
Flag --enable-systemone-api (DYN_ENABLE_SYSTEMONE_API) and path override DYN_HTTP_SVC_SYSTEMONE_PATH |
frontend_config.rs, components/src/dynamo/frontend/frontend_args.py, components/src/dynamo/frontend/main.py |
| Route registration | service_v2.rs::get_endpoints_router, like anthropic_messages_router |
| Request and response types, prompt building, scoring | new lib/llm/src/protocols/systemone/ |
| Handler | new lib/llm/src/http/service/systemone.rs |
| Metrics label, OpenAPI doc, docs page | metrics.rs (Endpoint::SystemOne), docs/fern/... |
Handler
Steps tagged (SGLang) match SGLang's route (python/sglang/srt/entrypoints/systemone/ and openai/serving_decisions.py) so the answers are the same. The other steps are specific to running across several workers.
Validate (SGLang). Errors return 422 with FastAPI's detail list, without the
inputecho. A request needs at least one question. Choice questions take 1 to 255 options with distinct names, score questions take 1 to 10 levels, and a noul question needs instructions or a true/false description. Unknown keys inside a question are rejected, because a typo there would silently ask a different question. Unknown top-level fields are ignored, as the published schema allows. The/v1/decisionsfields that would change answers (temperature,prompt_format_version,return_prompt_token_ids) are rejected by name. Dynamo adds configurable limits of 128 questions, 32,768 tokens per prompt and 65,536 tokens per request. The handler then resolves the model (resolve_canonical_name) and gets the completions engine (ModelManager::get_completions_engine,discovery/model_manager.rs:1379).Build the prompt (SGLang). Each question is one user message containing the state (a string as is, anything else as compact JSON), a blank line, and a question block:
- choice:
Question: <instructions>, then one line per option,A: <name> - <description>or justA: <name>, thenAnswer with the letter of one option only. - score:
Question: <instructions>, then one line per level,0: <level>, thenAnswer with the number of one level only. - noul:
Is the following true? <instructions>, thenyes: <true description>andno: <false description>if given, thenAnswer with yes or no only.
The
Question:line is left out wheninstructionsis blank. The message is rendered with the model card's chat template (prompt_formatter_from_mdc,preprocessor/prompt.rs:381) withadd_generation_prompt=trueand the template's reasoning toggle set to false. The toggle is found from the configured reasoning parser, as in SGLang. It has to be set explicitly because Dynamo's Anthropic handler enables thinking whenever a reasoning parser is configured. The handler accepts SGLang'schat_template_kwargsextension. It returns 400 if a request turns the toggle on, or if the template always opens a reasoning block where the answer should go.- choice:
Pick labels (SGLang). Noul uses
yesandno, choice usesAtoZ, and score uses0to9. Above 26 options every option gets a two-letter label (AA,AB, and so on). Checking hundreds of labels against the full prompt is slow, so this only works when the template puts an added token, such as Qwen's</think>, between the message and the answer position. Labels can then be checked against the end of the template alone. Otherwise the request gets a 400. A label is valid only ifencode(prompt + label) == encode(prompt) + [id]andiddiffers from every other label's ID. The tokenizer comes from the worker's model card (ModelDeploymentCard::tokenizer()), and the two-letter label set is cached per model and template. An invalid code is excluded from the set and the next code used; if the pool cannot cover the option count the request fails with a 400, because a two-token label would read the wrong logit with no error. That is why AnyJev caps at 26 single letters.Tokenize the state once. All prompts in a request start with the same template header, state and blank line. The handler renders once with a marker where the question block goes, splits the result into a prefix and an ending, and tokenizes the prefix once. Each branch prompt is the prefix IDs followed by the tokenized question block and ending, sent as a token-ID prompt (
PromptInput::Tokensis already supported). Tokens can merge across the split, for example when the state ends in newlines. So on each request the handler compares the split tokens of the first question with its whole-prompt tokens, and tokenizes every prompt whole if they differ. This keeps the prompt tokens identical to SGLang's.Place the prefix, then fan out. SGLang scores all questions in one engine call and its radix cache shares the prefix between them. With several replicas, Dynamo has to keep them together itself.
The handler resolves the model once per request, to one deployment card and its worker set, and renders and tokenizes with that card. The first question only goes to workers whose card checksum matches. Branches are never re-resolved; if the checksum changes mid-request the request fails instead of half the questions landing on another revision. The rolling-upgrade test changes the template with requests in flight and expects every request to either use one revision or fail. It sends the first question alone through the KV-aware router, which computes the shared prefix on one worker. It then sends the remaining questions to that worker with nvext.backend_instance_id, because the router's view of the cache lags behind a request that just finished. Each branch uses max_tokens=1 and logprob_token_ids=[labels]. The fan-out reuses the completions_batch pattern (openai.rs:1556):
- each branch gets a child context
{id}-{qid}linked to the parent, so a client disconnect or the first failure cancels all branches; - a request deadline cancels all branches and returns 504;
- a
max_branchessemaphore, separate from request slots, stops a wide fan-out from starving other traffic, and returns 529 withRetry-Afterwhen full.
If the pinned worker goes away, or its card checksum no longer matches, the request fails with 503 instead of rescoring on a cold worker. P0 works with aggregated workers only, and the route is not enabled for a model served disaggregated. Placement for disaggregated serving is future work.
Label count is bounded by the backend. Each backend reports how many candidate IDs it can score in one forward pass (
max_label_ids_per_forward). A question with more labels than that fails with a 400 before dispatch; the handler never splits a question across passes. vLLM scores 128 IDs per request (MAX_LOGPROB_TOKEN_IDS), so choice questions there cap at 128 options. The SGLang backend sends the whole label set in one request and keeps 255. The tests count engine requests per question and fail if a question was scored in more than one pass.Score (SGLang). A softmax over the raw label logprobs, which gives the same result as SGLang's softmax over the label logits at temperature 1.
noulis p(yes).choiceis the most likely option, with ties going to the first option in request order.scoreis the sum of i times p_i. Confidence is computed as described above. Each answer also hastypeandx_label_mass, the sum of exp(raw logprob) over the labels, which shows how much of the model's probability landed on the offered labels. A non-finite value fails the request with 500.modelis the served model name.usage.input_tokensis the sum of prompt tokens over the questions, counting each question once, andusage.output_tokensis 0.Later (v1.1): permutation debiasing for choice questions, averaging K cyclic shifts of the options with a geometric mean as AnyJev does. It is cheap once the prefix is cached. It stays off by default because it changes the answers compared with SGLang.
Backend support
| Backend | Status |
|---|---|
| vLLM | Works today. logprob_token_ids is allowlisted (validate.rs:116), forwarded (preprocessor.rs:1877) and applied in the worker (vllm/handlers.py:855, which clears logprobs because vLLM raises unless logprobs == len(logprob_token_ids)). We still need a test showing the IDs come back as raw logprobs, so that x_label_mass is exact. The limit is 128 IDs per request (step 6). With speculative decoding, restricted logprobs can crash the rejection sampler (vLLM issue 42592, fix pending in vLLM PR 44727), and vLLM's Rust scoring route rejects such engines (vLLM PR 46427). The route should reject those workers too until the fix lands. A faster path for scoring a fixed set of tokens is proposed in vLLM issue 56767 and vLLM PR 56782. |
| SGLang | Missing. build_sglang_logprob_kwargs (common/backend/logprobs.py:268) only maps logprobs and prompt_logprobs. It needs to map logprob_token_ids to return_logprob=True, token_ids_logprob=[...] and parse meta_info.output_token_ids_logprobs. The DYN_SGL_ALLOW_TOP_LOGPROBS gate isn't needed since this skips the costly top-k detokenization. SGLang's own route is validated with NEXTN speculative decoding, but it scores through /v1/score rather than generation, so PR 1 tests the generation path with speculative decoding on. |
| TRT-LLM | Only top-k logprobs (handler_base.py:1106), so labels outside the top k would be missing. Either leave it unsupported or offer best effort with a warning. |
Reference implementation: SGLang
SGLang PR 41208, merged on 2026-09-25, serves the protocol inside one SGLang server. It goes through the /v1/score path (score_prompts with apply_softmax=True), with one prefill per question and no generated text. This DEP matches it on every point the protocol leaves open:
| Topic | SGLang's route | This DEP |
|---|---|---|
| Prompt | One user message: state, blank line, question block, reasoning off (prompt format version 1) | Same (step 2) |
| Labels | yes/no, A to Z, 0 to 9, two-letter labels above 26 options when the template allows |
Same (step 3) |
| Limits | 1 to 255 options, 1 to 10 levels | Same, plus request limits |
| Errors | 422 detail list without input, 400 when the model or template can't serve the request, 500 for non-finite scores |
Same |
| Confidence | Official adapter formulas | Same |
| Response | type and x_label_mass per answer, served model name, output_tokens 0, unrounded values |
Same |
| Scale-out | One engine, radix cache shares the prefix | First question places the prefix, the rest are pinned to tha |
Source: ai-dynamo/dynamo