Skip to content
railsengines.com

LLM Cost Tracker

Rails-native LLM cost ledger: track spend by provider, model, and feature with self-hosted storage and budget guardrails

No ratings yet
Gem
llm_cost_tracker
Repository
sergey-homenko/llm_cost_tracker
License
MIT
Stars
44
Added
August 14, 2026

About

Rails-native LLM cost ledger: track spend by provider, model, and feature with self-hosted storage and budget guardrails.

Every call your app makes through RubyLLM, the official OpenAI and Anthropic SDKs, Gemini, or any OpenAI-compatible API gets logged: tokens, cost, latency, tags. Calls go app → provider direct. No proxy.

What you get

  • No proxy. Direct calls only.
  • No prompts. Token counts and metadata only.
  • No traces, evals, or prompt management. Different product, different gem.
  • Not multi-service. Built for a Rails monolith.

Mounting it

ruby
# Gemfile
gem "llm_cost_tracker"

# config/routes.rb
mount LlmCostTracker::Engine, at: "/llm-cost-tracker"

Details

44 stars on GitHub · MIT licensed · maintained by sergey-homenko. Source: https://github.com/sergey-homenko/llm_cost_tracker

Discussion (0)

Sign in to join the discussion.

No comments yet.