RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

LLM Cost Tracker 0.12 — self-hosted LLM spend tracking for Rails

💎 https://rubygems.org/gems/llm_cost_tracker
📝 https://github.com/sergey-homenko/llm_cost_tracker

A Rails engine that logs every call your app makes to OpenAI, Anthropic, Gemini, RubyLLM, or any OpenAI-compatible API - tokens, cost, latency, tags - into an ActiveRecord ledger with a built-in dashboard. Calls go app -> provider direct: no proxy, no prompts or traces, just spend attribution.

0.12 adds OpenRouter pricing, OpenAI + Anthropic batch-API capture, audio-minute / image-generation / hosted-tool line items, and fixes RubyLLM streaming capture for Anthropic and Gemini. A few breaking changes (the event cost payload shape, manual track token keys) - see the changelog.

Ruby 3.4+, Rails 7.1+, PostgreSQL or MySQL.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in