Skip to main content

llm_cost_dashboard/
lib.rs

1#![deny(missing_docs)]
2//! # llm-cost-dashboard
3//!
4//! Real-time terminal dashboard for LLM token spend.
5//!
6//! This crate provides the library components consumed by the `llm-dash`
7//! binary.  It can also be used as a library to embed cost tracking in other
8//! Rust applications.
9//!
10//! ## Modules
11//!
12//! - [`budget`] - hard budget enforcement and soft alert thresholds
13//! - [`cost`] - per-request cost records and the append-only ledger
14//! - [`cost::pricing`] - static pricing table and cost computation helpers
15//! - [`error`] - unified error type
16//! - [`log`] - newline-delimited JSON log ingestion
17//! - [`trace`] - lightweight distributed tracing
18//! - [`ui`] - ratatui TUI application state and event loop
19//!
20//! ## Related Projects
21//!
22//! - [Reddit-Options-Trader-ROT](https://github.com/Mattbusel/Reddit-Options-Trader-ROT-)
23//! - [tokio-prompt-orchestrator](https://github.com/Mattbusel/tokio-prompt-orchestrator)
24//! - [rot-signals-api](https://github.com/Mattbusel/rot-signals-api)
25
26pub mod budget;
27pub mod cost;
28pub mod error;
29pub mod log;
30pub mod trace;
31pub mod ui;
32
33pub use budget::BudgetEnvelope;
34pub use cost::{CostLedger, CostRecord, ModelStats};
35pub use error::DashboardError;
36pub use log::{LogEntry, RequestLog};
37pub use trace::{SpanStore, TraceSpan};
38pub use ui::App;