llm_cost_tracker 0.8.0 — track OpenAI/Anthropic/Gemini spend from your Rails app
llm_cost_tracker is a Rails-engine cost ledger that hooks into Faraday and the official OpenAI, Anthropic, and Gemini SDKs to capture token usage and tool charges per request, prices them against a pluggable rate snapshot, and persists everything via a durable inbox to Postgres or MySQL — with a built-in dashboard that slices spend by model, provider, tags, and pricing mode.
Version 0.8.0 is a storage rebuild. Tokens and tool/runtime charges (web search, code execution, file search, Gemini grounding, OpenAI Code Interpreter sessions) now share one shape and live in a dedicated line items table. Tags moved to a normalized table for consistent JOIN-based filtering on Postgres and MySQL.
Compound pricing modes like priority_batch_data_residency resolve via permuted lookup. Call rollups gained a currency column with a (period, period_start, currency) unique index, ahead of v0.9 multi-currency. The dashboard got shared filter/sort partials, sticky table headers, and a full prefers-color-scheme dark palette.
Breaking renames and column removals — there is no rolling-deploy upgrade. See the upgrading guide and the CHANGELOG before bumping.
Post a comment