Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Distinguish subscription allowances from API spend
rcourtman89a7b88093be
diff --git a/docs/AI.md b/docs/AI.mdindex 480ccddf3b..d82adc38b8 100644--- a/docs/AI.md+++ b/docs/AI.md@@ -411,7 +411,9 @@ PULSE_TEST_SUBSCRIPTION_AGENTS=1 \Qualification reports record `inference_route=local_subscription_agent` sosubscription-backed runs cannot be confused with direct API or local-modelruns. Token counts depend on what the CLI exposes, and a subscription allowance-is not represented as a zero-dollar API price.+is not represented as a zero-dollar API price. The report keeps its monetary+cost unknown and marks the per-run metered-API budget as not applicable; plan+limits, provider errors, latency, and any usage the CLI exposes remain visible.### Modelsdiff --git a/docs/AI_PATROL_QUALIFICATION.md b/docs/AI_PATROL_QUALIFICATION.mdindex 1ab6a662eb..4604cadce3 100644--- a/docs/AI_PATROL_QUALIFICATION.md+++ b/docs/AI_PATROL_QUALIFICATION.md@@ -428,8 +428,11 @@ failures; they are never blended into a leaderboard.Models must be compared on the same manifest versions, Pulse revision,collector topology, autonomy mode, temperature/provider settings, and repeatcounts. Report rankings use pass rate, recall, latency, tokens, and known cost;-provider errors, unknown pricing, or missing scenarios remain visible failures-instead of being discarded.+provider errors, unknown metered-API pricing, or missing scenarios remain+visible failures instead of being discarded. Subscription-agent and local-model+routes keep monetary cost unknown and mark the per-run API-spend budget as not+applicable rather than pretending their allowance, hardware, or energy cost is+zero.Each live report records both the qualification-harness Git revision and theversion identity returned by the tested Pulse runtime. Qualification refusesdiff --git a/docs/release-control/v6/internal/subsystems/ai-runtime.md b/docs/release-control/v6/internal/subsystems/ai-runtime.mdindex 983c2d3a37..b75fd32beb 100644--- a/docs/release-control/v6/internal/subsystems/ai-runtime.md+++ b/docs/release-control/v6/internal/subsystems/ai-runtime.md@@ -287,6 +287,12 @@ Qualification may temporarily opt in the selected route when applying anexplicit model override, must restore the previous opt-in and Patrol model evenafter failure, and records `inference_route=local_subscription_agent` so asubscription run is never compared or published as a metered API route.+Qualification cost evidence must preserve that route distinction. Unknown+pricing on `metered_api` remains a fail-closed dollar-budget failure. A+`local_subscription_agent` or `local_model_server` run instead records its+monetary cost as unknown with `budget_applicable=false`; it must not invent a+zero-dollar price, and latency, provider/plan errors, tool efficiency, and any+usage counts exposed by the transport remain scored and reportable.## Canonical Filesdiff --git a/internal/ai/qualification/report.go b/internal/ai/qualification/report.goindex 1003749b2d..053173e9fa 100644--- a/internal/ai/qualification/report.go+++ b/internal/ai/qualification/report.go@@ -265,6 +265,7 @@ func ReplayScore(report RunReport) RunReport {Run: report.PatrolRun, Findings: report.Findings,Provider: report.Environment.Provider,Model: report.Environment.Model,+ InferenceRoute: report.Environment.InferenceRoute,CollectionLatency: report.Score.CollectionLatency,EndToEndLatency: report.Score.EndToEndLatency,FaultsIntact: !report.Manifest.Security.RequireFaultIntact || allObservationsPassed(report.PostPatrol),@@ -585,6 +586,8 @@ func renderMarkdown(report RunReport) string {fmt.Fprintf(&b, "| Tokens | %d in / %d out |\n", report.Score.InputTokens, report.Score.OutputTokens)if report.Score.Cost.Known {fmt.Fprintf(&b, "| Estimated cost | $%.4f |\n", report.Score.Cost.USD)+ } else if !report.Score.Cost.BudgetApplicable {+ fmt.Fprintf(&b, "| Estimated cost | unknown (%s; API budget not applicable) |\n", report.Score.Cost.BillingBasis)} else {fmt.Fprintf(&b, "| Estimated cost | unknown |\n")}diff --git a/internal/ai/qualification/runner.go b/internal/ai/qualification/runner.goindex 3b22974e74..a271bca7da 100644--- a/internal/ai/qualification/runner.go+++ b/internal/ai/qualification/runner.go@@ -397,6 +397,7 @@ func (r *QualificationRunner) Run(ctx context.Context) (report RunReport, terminManifest: manifest, GroundTruth: report.GroundTruth,Run: report.PatrolRun, Findings: report.Findings,Provider: report.Environment.Provider, Model: report.Environment.Model,+ InferenceRoute: report.Environment.InferenceRoute,CollectionLatency: phaseDuration(report.Phases, "normal_collection_convergence"),EndToEndLatency: time.Since(faultStarted),FaultsIntact: faultsIntact, NoMutation: noMutation,diff --git a/internal/ai/qualification/scorer.go b/internal/ai/qualification/scorer.goindex 73ff8da6dc..45519150b4 100644--- a/internal/ai/qualification/scorer.go+++ b/internal/ai/qualification/scorer.go@@ -57,13 +57,15 @@ type CollectedTruth struct {}type CostEstimate struct {- Provider string `json:"provider"`- Model string `json:"model"`- USD float64 `json:"usd"`- Known bool `json:"known"`- PricingAsOf string `json:"pricing_as_of,omitempty"`- InputPerMTok float64 `json:"input_usd_per_mtok,omitempty"`- OutputPerMTok float64 `json:"output_usd_per_mtok,omitempty"`+ Provider string `json:"provider"`+ Model string `json:"model"`+ USD float64 `json:"usd"`+ Known bool `json:"known"`+ BillingBasis string `json:"billing_basis"`+ BudgetApplicable bool `json:"budget_applicable"`+ PricingAsOf string `json:"pricing_as_of,omitempty"`+ InputPerMTok float64 `json:"input_usd_per_mtok,omitempty"`+ OutputPerMTok float64 `json:"output_usd_per_mtok,omitempty"`}type MatchResult struct {@@ -195,6 +197,7 @@ type ScoringInput struct {Findings []FindingProvider stringModel string+ InferenceRoute stringCollectionLatency time.DurationEndToEndLatency time.DurationFaultsIntact bool@@ -215,8 +218,16 @@ func ScoreRun(input ScoringInput) Score {if resolvedProvider := strings.ToLower(strings.TrimSpace(input.Provider)); resolvedProvider != "" {provider = resolvedProvider}+ inferenceRoute := strings.TrimSpace(input.InferenceRoute)+ if inferenceRoute == "" {+ inferenceRoute = inferenceRouteForProvider(provider)+ }usd, known, price := cost.EstimateUSD(provider, model, int64(input.Run.InputTokens), int64(input.Run.OutputTokens))- score.Cost = CostEstimate{Provider: provider, Model: model, USD: usd, Known: known, PricingAsOf: price.AsOf, InputPerMTok: price.InputUSDPerMTok, OutputPerMTok: price.OutputUSDPerMTok}+ score.Cost = CostEstimate{+ Provider: provider, Model: model, USD: usd, Known: known,+ BillingBasis: inferenceRoute, BudgetApplicable: inferenceRoute == "metered_api",+ PricingAsOf: price.AsOf, InputPerMTok: price.InputUSDPerMTok, OutputPerMTok: price.OutputUSDPerMTok,+ }eligibleFindings := findingsEligibleForDetection(input.Findings, input.Run.FindingAssessments)infrastructureFindings := make([]Finding, 0, len(eligibleFindings))@@ -503,7 +514,7 @@ func applyGates(score *Score, manifest Manifest) {if manifest.Budgets.OutputTokensP95 > 0 && score.OutputTokens > manifest.Budgets.OutputTokensP95 {score.GateFailures = append(score.GateFailures, fmt.Sprintf("output tokens %d exceed %d", score.OutputTokens, manifest.Budgets.OutputTokensP95))}- if manifest.Budgets.CostUSDP95 > 0 {+ if manifest.Budgets.CostUSDP95 > 0 && score.Cost.BudgetApplicable {if !score.Cost.Known {score.GateFailures = append(score.GateFailures, "cost budget cannot be evaluated because model pricing is unknown")} else if score.Cost.USD > manifest.Budgets.CostUSDP95 {diff --git a/internal/ai/qualification/scorer_test.go b/internal/ai/qualification/scorer_test.goindex b3491ee4b9..5695ea93c0 100644--- a/internal/ai/qualification/scorer_test.go+++ b/internal/ai/qualification/scorer_test.go@@ -47,6 +47,33 @@ func TestScoreRunUsesResolvedProviderForUnprefixedOpenRouterRoute(t *testing.T)}}+func TestScoreRunAppliesDollarBudgetOnlyToMeteredAPIRoutes(t *testing.T) {+ manifest := validTestManifest()+ manifest.Budgets.CostUSDP95 = 0.01++ subscription := ScoreRun(ScoringInput{+ Manifest: manifest, Provider: "codex-subscription", Model: "codex-subscription:gpt-5.6-luna",+ InferenceRoute: "local_subscription_agent",+ })+ if subscription.Cost.Known || subscription.Cost.BudgetApplicable || subscription.Cost.BillingBasis != "local_subscription_agent" {+ t.Fatalf("unexpected subscription cost semantics: %+v", subscription.Cost)+ }+ if strings.Contains(strings.Join(subscription.GateFailures, "\n"), "cost budget") {+ t.Fatalf("subscription allowance was treated as metered API spend: %+v", subscription.GateFailures)+ }++ metered := ScoreRun(ScoringInput{+ Manifest: manifest, Provider: "unpriced-api", Model: "unpriced-api:model",+ InferenceRoute: "metered_api",+ })+ if !metered.Cost.BudgetApplicable || metered.Cost.BillingBasis != "metered_api" {+ t.Fatalf("unexpected metered cost semantics: %+v", metered.Cost)+ }+ if !strings.Contains(strings.Join(metered.GateFailures, "\n"), "cost budget cannot be evaluated") {+ t.Fatalf("unpriced metered API route did not fail closed: %+v", metered.GateFailures)+ }+}+func TestScoreRunPreservesDiagnosticsButFailsErroredPatrolRun(t *testing.T) {manifest := validTestManifest()manifest.Gates = GateSpec{diff --git a/scripts/release_control/ai_runtime_docs_policy_test.py b/scripts/release_control/ai_runtime_docs_policy_test.pyindex 8b92123084..3d41be31d3 100644--- a/scripts/release_control/ai_runtime_docs_policy_test.py+++ b/scripts/release_control/ai_runtime_docs_policy_test.py@@ -149,6 +149,8 @@ class AIRuntimeDocsPolicyTest(unittest.TestCase):self.assertIn("API-key environment variables", normalized_content)self.assertIn("dedicated, least-privilege OS account", normalized_content)self.assertIn("Pulse retains tool execution and policy enforcement", normalized_content)+ self.assertIn("not represented as a zero-dollar API price", normalized_content)+ self.assertIn("per-run metered-API budget as not applicable", normalized_content)def test_public_ai_privacy_copy_discloses_outbound_usage_telemetry(self) -> None:content = read_repo_text("docs/AI.md")