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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user