feat(admin): decision model grid in router panel

This commit is contained in:
2026-11-25 13:59:39 +00:00
parent f8a38e10da
commit 5d4a9e6cad
5 changed files with 168 additions and 0 deletions
+24
View File
@@ -267,6 +267,25 @@ export interface AdminRouterOutcomeView {
count: number
}
/** One heuristic-tier by model-tier decision cell (admin_routers.go: adminRouterDecisionTierView). */
export interface AdminRouterDecisionTierView {
heuristic: string
model: string
count: number
}
/** Decision-model settings of a router (admin_routers.go: adminRouterDecisionView); absent when not configured. */
export interface AdminRouterDecisionView {
provider: string
path: string
mode: 'live' | 'shadow'
timeout: string
/** Minimum model probability in per-mille. */
minProb: number
/** Score distance from a tier boundary in per-mille that triggers a call. */
band: number
}
/** Router counters (admin_routers.go: adminRouterStatsView); scope "shared" sums all gateway instances this month, "instance" is this process since start. */
export interface AdminRouterStatsView {
scope: 'shared' | 'instance'
@@ -277,6 +296,10 @@ export interface AdminRouterStatsView {
/** Non-zero cells of the live-by-shadow tier matrix; empty without shadowWeights. */
shadow: AdminRouterShadowView[]
outcomes: AdminRouterOutcomeView[]
/** Non-zero heuristic-by-model cells; empty without a decision block. */
decision?: AdminRouterDecisionTierView[]
/** One row per decision outcome, zeros included; empty without a decision block. */
decisionOutcomes?: AdminRouterCountView[]
}
/** One tier's calibration offset: points its threshold sits below the configured minScore. */
@@ -335,6 +358,7 @@ export interface AdminRouterView {
contextEscalation: boolean
/** Advertised context window in tokens; absent when no target declares one. */
contextTokens?: number
decision?: AdminRouterDecisionView
stats?: AdminRouterStatsView
}