feat(costs): Stufe 2 — geschätzte Quellen (lokaler Strom, Cartesia, Notruf)
Lokales LLM: Call-Dauer gemessen -> Stromkosten je Job ((max-idle)*load*n/ 3.6e6*Preis(EUR/kWh)*usd_per_eur), Kategorie llm_local. Cartesia-TTS: Zeichen x cartesia_usd_per_char (tts). Notruf: pro Webhook-Alarm 0,20€*usd_per_eur (alert), nur Doku, nie Sperre. Helfer in costs.py; neue Settings (GPU-Watt/Last/ Strompreis/usd_per_eur/cartesia/alert). Statistik: "exakt vs. geschätzt" (Tooltip + Summenzeile, Kategorien tts/alert/llm_local). Tests: 318. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
66d6708f59
commit
d45e2c9ae3
8 changed files with 85 additions and 5 deletions
|
|
@ -27,10 +27,16 @@ konfiguriert). €-Umrechnung später optional.
|
|||
| LLM cloud (OpenRouter) | inline `usage.cost` | **exakt** |
|
||||
| Web-Suche (Sonar via OpenRouter) | inline `usage.cost` (~0,005 $/Suche!) | **exakt** |
|
||||
| OpenRouter-TTS (gpt-audio) | inline `usage.cost` | **exakt** |
|
||||
| **Lokales LLM** (Ollama/llama.cpp) | — | **0 $** (nicht über OpenRouter; Strom = amortisierte Infrastruktur, NICHT pro Anfrage) |
|
||||
| **Lokales LLM** (Ollama/llama.cpp, 2× RTX 3090) | Call-Dauer n × Strom-Formel (Kategorie `llm_local`) | geschätzt |
|
||||
| **Cartesia-TTS** | synth. Zeichen × Preis (100k Credits ≈ 100.000 Zeichen → **0,00005 $/Zeichen**) | geschätzt |
|
||||
| piper / Gerät-TTS | — | **0 $** |
|
||||
| **Notruf** (SMS+Voice) | pro `emergency_event` × Preis (≈ 0,22 $) | geschätzt |
|
||||
| **Notruf** (SMS+Voice) | pro Webhook-Alarm × Preis (0,20 € × `usd_per_eur`) | geschätzt |
|
||||
|
||||
**Lokaler-Strom-Formel** (marginaler Verbrauch über Leerlauf, je aktivem GPU-Job):
|
||||
`Kosten = (gpu_max_w − gpu_idle_w) × gpu_avg_load × n_s / 3.600.000 kWh × Preis(EUR/kWh) × usd_per_eur`.
|
||||
Default: (390−40) × 0,85 × n / 3,6e6 × 0,33 × 1,08. Der Leerlauf (40 W/GPU) bleibt
|
||||
Infrastruktur; nur der Delta-Verbrauch eines Jobs zählt. Dauer n wird im lokalen
|
||||
Provider gemessen.
|
||||
| **Multitool (künftig)** | je nach Tool: OpenRouter-geroutet → exakt; externe API → Tool meldet eigene Kosten; lokal/DB → 0 $ | gemischt |
|
||||
|
||||
Die Web-Suche ist der mit Abstand größte Pro-Turn-Treiber (~0,005 $ gegen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue