You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Jev (TypeSafe System One model): pre-answer classifier for scenario routing #17
Jev (TypeSafe AI's "System One Model") is a frontier model that makes fast, structured decisions: it outputs type-safe structured values with calibrated confidence scores in ~70–500ms at ~$0.042/MTok, and doesn't generate free text (so no hallucinated values).
A good fit for a pre-answer classification step in the Studio UI / audit flow. Example (medical assistant): before providing an answer, classify the patient's question into "health information" vs "patient rights" (etc.), with a confidence score, and route accordingly.
What this would look like in Studio
New participant option: "Jev (TypeSafe)" alongside LLM targets/judges, configured with an API key from console.typesafe.ai (early access).
Expose the structured category + calibrated confidence in the audit result / run detail, so it's inspectable and can drive branching in a scenario.
Surface it as a cheap, fast judge/quality-gate option (calibrated probabilities are useful for scoring without a full LLM judge call).
Engine-side exploration lives in SimulaMet/SimpleAudit#100 (API integration as target/auditor/judge + confidence-vs-judge comparison).
SimulaMet/SimpleAudit#104 (structured choice answers + exact-match grading) was merged as SimpleAudit#106 and shipped in v0.4.0 today, and Studio's pin is now widened to allow it (simpleaudit>=0.4.0,<0.5.0, commit cc01335).
What the engine now provides that this issue depends on:
DecisionTarget — a System One decision model (Ollama POST /v1/systemone, OpenRouter Decisions API) as a first-class audit target, with DecisionTarget.ollama(...) / DecisionTarget.openrouter(...) factory methods.
A scenario-level decision block: fixed-option question + criteria; targets see it as data (no answer key), the full structured answer (choice, probabilities, confidence) is stored in the transcript.
choice_match judge — code-only grading of the chosen option against accepted, no judge model, no judge API key. This is the "cheap, fast judge/quality-gate option" from the issue: calibrated probabilities are available in the result for inspecting/driving routing.
What's still left for Studio (this issue):
Surface a "decision model" participant option in the target setup UI (Jev via OpenRouter, Clef via local Ollama), wired to DecisionTarget + secret_reference for the API key.
Expose the structured category + calibrated confidence in the audit result / run detail.
The pre-answer routing use case (classify → branch in a scenario) — the engine covers grading, not branching, so scenario-routing support may need a design pass.
Suggested next step: a Studio PR that lets users register a DecisionTarget endpoint through the model registry and see decision answers in run detail.
Thanks for the ping, and for landing the engine side. I'll take the Studio part: registering a DecisionTarget endpoint through the model registry (Clef via local Ollama first, Jev via OpenRouter behind secret_reference) and surfacing the structured answer — choice, probabilities, confidence — in run detail. PR to follow on this issue. I'm leaving the pre-answer routing (your item 3) out of that PR since it needs the design pass you mention.
@avalyset — progress on the Studio side, in parallel with your PR: the model-registry half of item 1 is now in place (commit c468a56), which should shrink the surface your PR needs to cover.
What c468a56 does on /connections/:
Auto-detects decision models as they're registered, and persists the capability on RegisteredModel.capabilities (with a RegisteredModel.is_decision property + a badge in the model list and discover dialog).
Ollama — probed per model via POST {api-root}/v1/systemone with a 2-option question: 200 ⇒ decision model, the "does not support decision" 400 ⇒ not one (no inference spent on chat models).
OpenRouter — model-id prefix heuristic (typesafe/, jev) since the Decisions catalog isn't publicly listed.
So "register a DecisionTarget endpoint through the model registry (Clef via local Ollama first, Jev via OpenRouter)" is largely already marked for you — the registry now knows which registered models are decision-capable.
What I'd still expect to land in your PR (not done here):
Wiring the decision-capable registered model into the engine's DecisionTarget factory (DecisionTarget.ollama(...) / .openrouter(...)) in the target-setup flow + secret_reference for the key.
Surfacing the structured answer — choice, probabilities, confidence — in run detail (item 2).
Happy to split or hand over whatever overlaps — let me know how you'd like to divide the registry-wiring vs. run-detail pieces.
Thanks — that fits well. I'll take both remaining pieces in the one PR: wiring decision-capable registered models (your RegisteredModel.is_decision) into DecisionTarget.ollama(...) / .openrouter(...) in the target-setup flow with secret_reference for the OpenRouter key, and surfacing choice, probabilities and confidence in run detail. Rebasing onto c468a56 now so the PR builds on your registry detection instead of duplicating it.
One more refinement landed on this side — f4e91d2 (on main):
Detection now uses a single probe surface, POST /v1/systemone, for every non-OpenRouter connection. Turns out that endpoint is the standard System One surface across providers (Ollama and vLLM both expose it at the API root; vLLM returns 501 when the model has no supported read strategy). So:
Any OpenAI-compatible server — Ollama, vLLM, anything — is probed once per model with a 2-option question. 200 ⇒ decision model; 400 "does not support decision" (Ollama) or 501 (vLLM) ⇒ not one. No inference spent on non-decision models.
OpenRouter stays on the typesafe//jev name heuristic: its /v1/systemone is a paid proxy with no public model listing, so probing all ~469 listed models would bill real inference.
Practical implication for the DecisionTarget wiring: when a model carries capabilities.decision, the target endpoint is simply {base_url}/v1/systemone for Ollama/vLLM/OpenAI-compatible servers — no per-provider endpoint logic needed in the target setup, only the auth handling (OpenRouter's key via secret_reference).
Already in the engine's JUDGE_CONFIGS, so judges/services.bases() should mirror it automatically. To verify: ensure_starter_judges surfaces it, and a run can go judge-less (code-only judge ⇒ no judge endpoint / secret_reference required — _validate_secrets in infra/engine.py may currently demand one).
DecisionTarget bridge wiring (core, worker-side)
build_model_auditor() (infra/engine.py) always builds the stock OpenAI-compatible ModelTarget. When the target snapshot has capabilities.decision, it needs to build a DecisionTarget instead (endpoint {base_url}/v1/systemone, key via the snapshot's secret_reference, Ollama 64 KiB body cap via the .ollama() factory) and call auditor.set_target(...).
max_turns must be forced to 1 (DecisionTarget.max_turns = 1) — auditor_kwargs currently hardcodes it from the generation config.
Check whether install_trace_context_target (infra/trace_target.py) covers DecisionTarget too, or per-turn traceparent propagation is lost for decision runs.
Scenario decision block (biggest piece)
New JSON field on ScenarioRevision + scenario_dict() passthrough + form UI for a closed question (fixed options, accepted answer key that never reaches the target, optional state).
Validate 2–26 options at save time (the engine raises on broken limits).
A scenario with a decision block should require a decision-capable target.
Target picker + run detail (UI polish)
New Experiment: show the decision badge next to registered models; flag/restrict decision models when the scenario set contains decision scenarios.
Run detail: surface TargetResponse.decision — chosen option, per-option probabilities, confidence — not just the content string (issue item 2).
Overlap note:@avalyset — items 2 (target wiring) and 4 (run detail) look like the scope of your announced PR.
Yes, let's split along those lines. I take 2 (DecisionTarget bridge in build_model_auditor via set_target, max_turns forced to 1, and checking install_trace_context_target covers DecisionTarget) and 4 (decision badge/restriction in the New Experiment picker, and choice/probabilities/confidence in run detail). You take 1 and 3. My PR won't touch ScenarioRevision or the scenario form: the end-to-end test builds its decision scenario as a dict in the test, so it stays mergeable before or after yours.
Upstream note for the bridge-wiring item: SimulaMet/SimpleAudit#108 (open) points DecisionTarget.openrouter() at /api/v1/systemone and drops the legacy /api/alpha/decisions URL. So once that lands in an engine release (0.4.1/0.5.0), the Studio bridge can use one canonical endpoint for every provider: {base_url}/v1/systemone for Ollama/vLLM/self-hosted, and the DecisionTarget.openrouter() factory for OpenRouter-hosted Jev. No alpha URL handling needed anywhere.
Activity
SushantGautam commentedon Oct 7, 2026
@avalyset
SushantGautam commentedon Oct 9, 2026
Update — the engine side of this landed.
SimulaMet/SimpleAudit#104 (structured choice answers + exact-match grading) was merged as SimpleAudit#106 and shipped in v0.4.0 today, and Studio's pin is now widened to allow it (
simpleaudit>=0.4.0,<0.5.0, commitcc01335).What the engine now provides that this issue depends on:
DecisionTarget— a System One decision model (OllamaPOST /v1/systemone, OpenRouter Decisions API) as a first-class audit target, withDecisionTarget.ollama(...)/DecisionTarget.openrouter(...)factory methods.decisionblock: fixed-option question + criteria; targets see it as data (no answer key), the full structured answer (choice, probabilities, confidence) is stored in the transcript.choice_matchjudge — code-only grading of the chosen option againstaccepted, no judge model, no judge API key. This is the "cheap, fast judge/quality-gate option" from the issue: calibrated probabilities are available in the result for inspecting/driving routing.What's still left for Studio (this issue):
DecisionTarget+secret_referencefor the API key.Suggested next step: a Studio PR that lets users register a
DecisionTargetendpoint through the model registry and seedecisionanswers in run detail.avalyset commentedon Oct 9, 2026
Thanks for the ping, and for landing the engine side. I'll take the Studio part: registering a DecisionTarget endpoint through the model registry (Clef via local Ollama first, Jev via OpenRouter behind secret_reference) and surfacing the structured answer — choice, probabilities, confidence — in run detail. PR to follow on this issue. I'm leaving the pre-answer routing (your item 3) out of that PR since it needs the design pass you mention.
SushantGautam commentedon Oct 9, 2026
@avalyset — progress on the Studio side, in parallel with your PR: the model-registry half of item 1 is now in place (commit
c468a56), which should shrink the surface your PR needs to cover.What
c468a56does on /connections/:RegisteredModel.capabilities(with aRegisteredModel.is_decisionproperty + a badge in the model list and discover dialog).POST {api-root}/v1/systemonewith a 2-option question:200⇒ decision model, the"does not support decision"400 ⇒ not one (no inference spent on chat models).typesafe/,jev) since the Decisions catalog isn't publicly listed.DecisionTargetendpoint through the model registry (Clef via local Ollama first, Jev via OpenRouter)" is largely already marked for you — the registry now knows which registered models are decision-capable.What I'd still expect to land in your PR (not done here):
DecisionTargetfactory (DecisionTarget.ollama(...)/.openrouter(...)) in the target-setup flow +secret_referencefor the key.Happy to split or hand over whatever overlaps — let me know how you'd like to divide the registry-wiring vs. run-detail pieces.
avalyset commentedon Oct 9, 2026
Thanks — that fits well. I'll take both remaining pieces in the one PR: wiring decision-capable registered models (your
RegisteredModel.is_decision) intoDecisionTarget.ollama(...)/.openrouter(...)in the target-setup flow withsecret_referencefor the OpenRouter key, and surfacing choice, probabilities and confidence in run detail. Rebasing onto c468a56 now so the PR builds on your registry detection instead of duplicating it.SushantGautam commentedon Oct 9, 2026
One more refinement landed on this side —
f4e91d2(onmain):Detection now uses a single probe surface,
POST /v1/systemone, for every non-OpenRouter connection. Turns out that endpoint is the standard System One surface across providers (Ollama and vLLM both expose it at the API root; vLLM returns501when the model has no supported read strategy). So:200⇒ decision model;400 "does not support decision"(Ollama) or501(vLLM) ⇒ not one. No inference spent on non-decision models.typesafe//jevname heuristic: its/v1/systemoneis a paid proxy with no public model listing, so probing all ~469 listed models would bill real inference.Practical implication for the
DecisionTargetwiring: when a model carriescapabilities.decision, the target endpoint is simply{base_url}/v1/systemonefor Ollama/vLLM/OpenAI-compatible servers — no per-provider endpoint logic needed in the target setup, only the auth handling (OpenRouter's key viasecret_reference).SushantGautam commentedon Oct 9, 2026
Full gap analysis for end-to-end decision-model support, for anyone picking pieces (splitting welcome):
Already on
main:cc01335)capabilities.decision+ badges on /connections/ (c468a56)/v1/systemoneprobe for all non-OpenRouter providers, incl. vLLM 501 (f4e91d2)Remaining, in suggested build order:
choice_matchjudge surfacing (small — verify + maybe fix)JUDGE_CONFIGS, sojudges/services.bases()should mirror it automatically. To verify:ensure_starter_judgessurfaces it, and a run can go judge-less (code-only judge ⇒ no judge endpoint /secret_referencerequired —_validate_secretsininfra/engine.pymay currently demand one).DecisionTargetbridge wiring (core, worker-side)build_model_auditor()(infra/engine.py) always builds the stock OpenAI-compatibleModelTarget. When the target snapshot hascapabilities.decision, it needs to build aDecisionTargetinstead (endpoint{base_url}/v1/systemone, key via the snapshot'ssecret_reference, Ollama 64 KiB body cap via the.ollama()factory) and callauditor.set_target(...).max_turnsmust be forced to 1 (DecisionTarget.max_turns = 1) —auditor_kwargscurrently hardcodes it from the generation config.install_trace_context_target(infra/trace_target.py) coversDecisionTargettoo, or per-turn traceparent propagation is lost for decision runs.Scenario
decisionblock (biggest piece)ScenarioRevision+scenario_dict()passthrough + form UI for a closed question (fixed options,acceptedanswer key that never reaches the target, optionalstate).decisionblock should require a decision-capable target.Target picker + run detail (UI polish)
decisionscenarios.TargetResponse.decision— chosen option, per-option probabilities, confidence — not just thecontentstring (issue item 2).Overlap note: @avalyset — items 2 (target wiring) and 4 (run detail) look like the scope of your announced PR.
avalyset commentedon Oct 9, 2026
Yes, let's split along those lines. I take 2 (DecisionTarget bridge in build_model_auditor via set_target, max_turns forced to 1, and checking install_trace_context_target covers DecisionTarget) and 4 (decision badge/restriction in the New Experiment picker, and choice/probabilities/confidence in run detail). You take 1 and 3. My PR won't touch ScenarioRevision or the scenario form: the end-to-end test builds its decision scenario as a dict in the test, so it stays mergeable before or after yours.
SushantGautam commentedon Oct 9, 2026
Upstream note for the bridge-wiring item: SimulaMet/SimpleAudit#108 (open) points DecisionTarget.openrouter() at /api/v1/systemone and drops the legacy /api/alpha/decisions URL. So once that lands in an engine release (0.4.1/0.5.0), the Studio bridge can use one canonical endpoint for every provider: {base_url}/v1/systemone for Ollama/vLLM/self-hosted, and the DecisionTarget.openrouter() factory for OpenRouter-hosted Jev. No alpha URL handling needed anywhere.
avalyset commentedon Oct 9, 2026
Studio PR: #20
Send decision-capable registered models to SimpleAudit's DecisionTarget