Repository navigation
System One: serve Tinfoil's decision models - #1259
Merged
Merged
Conversation
`POST /v1/systemone` now also answers with Tinfoil's decision models (`decision-small`, `decision-medium`, `decision-large`: vLLM-SR's d3 family in Tinfoil's attested enclaves), selected by `model`. Request and response fields are unchanged, and `glm-5-3-flash` stays the default with the same prompt, calibration, limits, errors and billing. A decision-model request is one upstream `POST /v1/decisions` through the in-process attested Tinfoil client. `web/system_one/decisions.rs` translates the System One shape both ways, following d3's own reading of a question: a `noul` is a predicate, or a false-first boolean choice described by its criteria; choices and scores keep their labels, descriptions and order; non-string values are sent as JSON with Python separators. Answers keep their shapes, with TypeSafe's confidence, temperature 1 unless the request sets one (applied as softmax(ln p / T)) and an option_mass of 1, since a classification head only scores the offered options. Decision models read text only (images: 422 `system_one_images_unsupported`), take 2 to 26 options per choice and need distinct non-blank score levels, and the state plus one question must fit the model's 32,768-token context (413 `system_one_context_exceeded`). They are Pro-only, in neither chat catalog, and have one Tinfoil route each, which route health tracks. Usage is published once per call. The upstream send, probe, usage and error handling moved from `SystemOneCall::send_read` into `Upstream::send`, shared by both engines with no change in what it does. SDK and proxy docs describe the models; the SDK types are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pi's classifier registry now lists `decision-small`, `decision-medium` and `decision-large` next to `glm-5-3-flash`, on the same System One API and account transport. They judge text only and take a 32,768-token context per question. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
POST /v1/systemonenow also serves Tinfoil's decision models:decision-small,decision-mediumanddecision-large(vLLM-SR's d3 family in Tinfoil's attested enclaves). A request picks one withmodel. Request and response fields are unchanged, andglm-5-3-flashstays the default with its behavior unchanged.POST /v1/decisions, sent through the in-process attested Tinfoil client.web/system_one/decisions.rstranslates the System One shape both ways, following d3's own reading of a System One question:noulbecomes apredicate; anoulwith criteria becomes a boolean choice with the criteria as option descriptions,falsefirst;choiceandscorekeep their labels, descriptions and level order;confidence.temperatureis 1 unless the request sets one; an explicit value is applied assoftmax(ln p / T).option_massis 1, because a classification head only scores the offered options (vLLM reports the samelabel_mass).SystemOneCall::send_readintoUpstream::send, which both engines use, without changing what it does.Per-model contract
glm-5-3-flash(default)decision-*imagessystem_one_images_unsupported(new)system_one_bad_option_count, message names the limit)system_one_context_exceeded(new)temperatureoption_massusage.requests/output_tokens/v1/decisionssystem_one_unsupported_modelnow lists the four model ids. Unknown models still return 422.Integrations
model_config: aDecisionModeltable, Pro-only. These models never resolve as completion models and appear in neither chat catalog, so chat, Responses and the Research model picker do not see them.provider_registry: one Tinfoil route per decision model, kept apart from completion routing.inference/health: those routes are seeded, so probes, circuit breaking and capacity gates cover them.tinfoil, model = the public id, input tokens as Tinfoil counts them (the state is counted once per question).temperatureandoption_mass./v1/systemonewas already forwarded, andmodelis opaque to the proxy.glm-5-3-flash.Validation
Unit and component gates
services/opensecret):cargo fmt --all -- --check,cargo clippy --locked --all-targets --all-features -- -D warnings, andcargo test --locked --all-features: 893 passed, 0 failed, 34 ignored (the ignored set is the usual disposable-DB and live-provider tests).system_one::decisions: request lowering, answer reading (shape, refusal, value and order checks), usage, the temperature override, per-model validation, and a loopback test of the wire request through the Tinfoil transport.pi-aiSystem One tests 5 passed.Local stack, end to end
modelomitted and explicitoption_mass,requests: 3,output_tokens: 3decision-small/-medium/-large, same 3 questionstemperature1,option_mass1,requests: 1,output_tokens: 0noulwith criteria, structured instructions and descriptionsdecision-mediumtemperature: 2ondecision-mediumsystem_one_images_unsupportedsystem_one_bad_option_count(limit 26)system_one_context_exceededsystem_one_bad_option_count(limit 255, unchanged)system_one_unsupported_modelmodel_not_available_on_plantinfoil, modeldecision-*, Tinfoil's input tokens (329 for 3 questions, 6,774 for 64), 0 output. GLM still emits one per question.Before this change
Live probes of Tinfoil's
/v1/decisionsthrough the attested router established its limits: text only, 26 options, 10 levels, 64 questions, 32,768-token prompt per question, strict schema.Paced eval on SST-2 and AG News (100 each) through this translation, accuracy:
glm-5-3-flash(current System One)decision-smalldecision-mediumdecision-largedecision-largealso has the best log loss on both.Not covered here: deployed Dev or Prod behavior, and billing's pricing of these events in a deployed environment (local billing does not consume usage events; maple-billing-server#135 has the pricing tests).
Rollout
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.