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
Clarify AI cost estimates with pricing coverage
rcourtman21abb6ef01e3
diff --git a/frontend-modern/src/components/AI/AICostDashboard.tsx b/frontend-modern/src/components/AI/AICostDashboard.tsxindex b290e4b99c..3a1a28b826 100644--- a/frontend-modern/src/components/AI/AICostDashboard.tsx+++ b/frontend-modern/src/components/AI/AICostDashboard.tsx@@ -65,6 +65,12 @@ export const AICostDashboard: Component = () => {return data.provider_models.some((pm) => pm.pricing_known);});+ const unpricedProviderModels = createMemo(() => {+ const data = summary();+ if (!data) return [];+ return (data.provider_models ?? []).filter((pm) => !pm.pricing_known && (pm.total_tokens ?? 0) > 0);+ });+const estimatedTotalUSD = createMemo(() => {const data = summary();if (!data || !anyPricingKnown()) return null;@@ -412,6 +418,25 @@ export const AICostDashboard: Component = () => {<div class="text-xs text-gray-500 dark:text-gray-400">USD is an estimate based on public list prices. It may differ from billing.+ <Show when={unpricedProviderModels().length > 0}>+ <span class="ml-2">+ Estimated spend is partial. Pricing is unknown for{' '}+ {unpricedProviderModels()+ .slice(0, 6)+ .map(+ (pm) =>+ `${PROVIDER_NAMES[pm.provider as keyof typeof PROVIDER_NAMES] || pm.provider}/${pm.model}`,+ )+ .join(', ')}+ <Show when={unpricedProviderModels().length > 6}>+ <span> (+{unpricedProviderModels().length - 6} more)</span>+ </Show>+ .+ </span>+ </Show>+ <Show when={summary()?.pricing_as_of}>+ <span class="ml-2">Prices as of {summary()?.pricing_as_of}.</span>+ </Show></div><div class="flex items-center justify-between gap-3">diff --git a/frontend-modern/src/types/ai.ts b/frontend-modern/src/types/ai.tsindex 82d3aa76b5..d73cde21f5 100644--- a/frontend-modern/src/types/ai.ts+++ b/frontend-modern/src/types/ai.ts@@ -220,6 +220,7 @@ export interface AICostSummary {retention_days: number;effective_days: number;truncated: boolean;+ pricing_as_of?: string;provider_models: AICostProviderModelSummary[];use_cases: AICostUseCaseSummary[];targets: AICostTargetSummary[];diff --git a/internal/ai/cost/pricing.go b/internal/ai/cost/pricing.goindex 95da791448..de2585c281 100644--- a/internal/ai/cost/pricing.go+++ b/internal/ai/cost/pricing.go@@ -31,6 +31,11 @@ type modelPrice struct {const pricingAsOf = "2025-12"+// PricingAsOf indicates the effective date of the pricing table used for estimation.+func PricingAsOf() string {+ return pricingAsOf+}+// NOTE: Keep this table small and conservative.// The goal is quick estimation and relative comparisons, not exact billing.var providerPrices = map[string][]modelPrice{diff --git a/internal/ai/cost/store.go b/internal/ai/cost/store.goindex 0fd6e17f24..c7c81cec92 100644--- a/internal/ai/cost/store.go+++ b/internal/ai/cost/store.go@@ -237,6 +237,7 @@ func (s *Store) GetSummary(days int) Summary {RetentionDays: retentionDays,EffectiveDays: effectiveDays,Truncated: truncated,+ PricingAsOf: PricingAsOf(),ProviderModels: providerModels,UseCases: summarizeUseCases(events),Targets: summarizeTargets(events),@@ -356,6 +357,8 @@ type Summary struct {EffectiveDays int `json:"effective_days"`Truncated bool `json:"truncated"`+ PricingAsOf string `json:"pricing_as_of,omitempty"`+ProviderModels []ProviderModelSummary `json:"provider_models"`UseCases []UseCaseSummary `json:"use_cases"`Targets []TargetSummary `json:"targets"`diff --git a/internal/ai/service.go b/internal/ai/service.goindex a8670be542..8f2fde9191 100644--- a/internal/ai/service.go+++ b/internal/ai/service.go@@ -138,6 +138,7 @@ func (s *Service) GetCostSummary(days int) cost.Summary {RetentionDays: cost.DefaultMaxDays,EffectiveDays: effectiveDays,Truncated: truncated,+ PricingAsOf: cost.PricingAsOf(),ProviderModels: []cost.ProviderModelSummary{},UseCases: []cost.UseCaseSummary{},DailyTotals: []cost.DailySummary{},diff --git a/internal/api/ai_handlers.go b/internal/api/ai_handlers.goindex def16eebc6..93761dd1cf 100644--- a/internal/api/ai_handlers.go+++ b/internal/api/ai_handlers.go@@ -2441,6 +2441,7 @@ func (h *AISettingsHandler) HandleGetAICostSummary(w http.ResponseWriter, r *htt} else {summary = cost.Summary{Days: days,+ PricingAsOf: cost.PricingAsOf(),ProviderModels: []cost.ProviderModelSummary{},DailyTotals: []cost.DailySummary{},Totals: cost.ProviderModelSummary{Provider: "all"},