Usage view: per-model breakdown, daily trend and CSV export
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, rust, tauri, typescript
- Ambito
- analytics, backend-api-design, data-visualization, desktop
Direzione di ricerca
Start with docs/guide/llm-call-ledger.md and crates/agent-core/src/usage.rs, then trace usage aggregation in crates/daemon-api/src/routes.rs and crates/daemon-api/src/dto.rs; review apps/desktop/ui/src/views/UsageView.tsx for the existing range selector and UI patterns. Propose the response shape in the issue before implementing, as requested. Done means model totals, daily local-time buckets, unknown usage, CSV export, and the specified tests and schema updates meet the acceptance criteria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
size: M · first-timer: no
Summary
Extend the Usage view with a per-model breakdown, a daily trend and CSV export, so users can see which model costs what, how usage develops over time, and take the numbers elsewhere.
Why it matters
The usage view answers "which bot used how much". People choosing between models (or between a cloud model and a local one) need "which model", and people with a budget need to see whether the trend is going up. It also complements per-bot limits (#210), which need a clear picture of past spend.
Current state
GET /v1/usageaggregates over runs and returns a total,by_botandby_purpose(UsageSummaryincrates/daemon-api/src/dto.rs, computed inroutes.rs). The UI (apps/desktop/ui/src/views/UsageView.tsx) shows totals and a per-bot table with a range selector (all, day, week, month).- Every model call is recorded in the LLM call ledger with purpose, model, tokens and optional
cost_usd(UsageCallincrates/agent-core/src/usage.rs,docs/guide/llm-call-ledger.md), so the data for a per-model view exists; it is not aggregated or returned. - The ledger doc is explicit that unknown token counts do not mean zero, and cost can be unknown (CLI engines, failed calls, embeddings); the view must not present unknown as zero.
- There is no time series and no export.
Proposal and suggested approach
- Daemon. Add
by_modeland a daily series (bucketed in the user's local time zone, bounded number of days) to the usage summary, keeping existing fields unchanged (additive, optional for older clients). Calls with unknown tokens or cost are counted separately ("n calls without usage data"). - UI. A model table next to the bot table, and a small bar or sparkline per day with an accessible text alternative (a table behind it); an "unknown" marker wherever cost is not known. Use the shared design tokens and the existing chart conventions if any; do not add a heavy charting dependency without discussing it in the issue.
- Export. "Download CSV" of the current range (day, bot, model, purpose, calls, tokens in/out, cost or empty); in the app through a save action. Formula-injection safe (cells that start with
=,+,-or@are prefixed). - Tests for the aggregation (unknown usage, several models per run, subagents counted once, time-zone edges), UI helper tests, and golden CSV.
Acceptance criteria
- Per-model totals add up to the overall total for calls that report usage; calls without usage are shown separately.
- The daily series respects the selected range and local midnight.
- The OpenAPI snapshot and the generated schema are updated (
CONTRIBUTING.md);check:i18n, lint, typecheck,cargo test -p daemon-api -p agent-corepass.
Out of scope
Budgets and limits (#210), price changes or catalog edits, provider balance lookups, and cross-device aggregation.
How to get started
Read docs/guide/llm-call-ledger.md, crates/agent-core/src/usage.rs, the usage code in crates/daemon-api/src/routes.rs, and views/UsageView.tsx. Comment here with the response shape you propose.
- Lingua principale
- Rust
- Stelle
- 0
- Fork
- 1
- Merge medio
- 6h 54m
- PR unite (30g)
- 152
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di emreocell/Praxi-Bot
-
area: desktop-ui enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Add an LLM provider presetApertaarea: daemon enhancement good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
Contribute example skillsApertadocumentation enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
emreocell/Praxi-Bot#168 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
documentation good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di emreocell/Praxi-Bot
Issue simili
-
bug ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
userFRM/egui-charts#3363 ·
I maintainer di solito rispondono entro 1 giorno
-
ada documentation mobile report
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
physicsdolphin/nv-uefi-unlocker#254 · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
kindraywind/rustnarok-client#1382 ·
I maintainer di solito rispondono entro 1 giorno
-
area:accessibility bug good first issue help wanted priority:p3-low size:small
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NecturaLabs/Canopy#209 ·
-
CLI config custom-model enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno