Refactor: Pricing/Draft-Pfad als Single Source of Truth (Phase 1)

- Neuer services/pricing.py: PRICING-Dict + compute_savings() aus dem
  system-Router extrahiert; Router ist jetzt dünn (nur role_map + Aufruf).
- /system/token-stats liefert zusätzlich das pricing-Dict → Frontend zeigt
  die Tarife daraus an statt sie im Text zu hartkodieren.
- SPEC_DRAFT_MODEL_PATH in config.py (MC_SPEC_DRAFT_MODEL); llamaswap.py und
  migrate_config.py referenzieren die Konstante statt des doppelten Literals.
- Ersparnis-Berechnung verhaltensneutral verifiziert (35,09 $ / 32,28 €).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hitonabi
2026-06-26 14:28:26 +02:00
parent 35dcc69ba5
commit a7c3f8f516
8 changed files with 155 additions and 133 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -7,7 +7,7 @@
<link rel="manifest" href="/manifest.webmanifest" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>Mission Control 2.0</title>
<script type="module" crossorigin src="/assets/index-CJm59bcL.js"></script>
<script type="module" crossorigin src="/assets/index-BYvMJHPL.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DiSNgbNY.css">
</head>
<body>
+5 -1
View File
@@ -49,6 +49,7 @@ export function DashboardView() {
total_tokens: number
saved_usd: number
saved_eur: number
pricing?: Record<string, { in: number; out: number }>
} | null>(null)
// Sudo & Action states
@@ -777,7 +778,10 @@ export function DashboardView() {
)}
</div>
<div className="mt-4 text-[9px] text-muted-foreground/70 border-t border-border/30 pt-2.5 leading-normal">
Berechnet im Vergleich zu Cloud-APIs von Juni 2026 (Ø 15,00 $ / 75,00 $ pro 1M tkn).
Berechnet im Vergleich zu Cloud-APIs von Juni 2026
{tokenStats?.pricing?.heavy
? `${tokenStats.pricing.heavy.in.toFixed(2).replace(".", ",")} $ / ${tokenStats.pricing.heavy.out.toFixed(2).replace(".", ",")} $ pro 1M tkn).`
: "."}
</div>
</div>
</div>