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.14.1: RubyLLM 2.x, long streams, transaction-safe writes

llm_cost_tracker is self-hosted LLM cost tracking for Rails: every call through RubyLLM, the OpenAI and Anthropic SDKs, Gemini, or any OpenAI-compatible API is logged with tokens, cost, and tags, with no proxy. 0.14.1 is a bug-fix release:

  • RubyLLM 2.x calls are recorded again
  • Long streams record their real usage instead of $0, with flat memory
  • A failed ledger write no longer breaks your app’s own database transaction
  • An LLM call never fails just because the gem couldn’t record it
  • Ruby 3.3 is supported

Security: from v0.9.0 to v0.14.0, a provider API key passed in the URL (Gemini ?key=, Azure ?api-key=) could be stored in call tags. Upgrade and rotate the key; the changelog has the cleanup SQL.

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