Dev.to AI πŸ€– Ai πŸ‘ 0 πŸ“– 1 min read

I built a local-first CLI proxy to track LLM tokens, latency, and USD cost across providers

When working across multiple side projects and LLM APIs (OpenAI, Anthropic, Gemini, OpenRouter), keeping track of exact token usage and real-time USD cost gets messy fast. Most observability tools require routing your pr

I built a local-first CLI proxy to track LLM tokens, latency, and USD cost across providers
Cover image for I built a local-first CLI proxy to track LLM tokens, latency, and USD cost across providers
Mostafa Orazani
Mostafa Orazani

Posted on Nov 24

I built a local-first CLI proxy to track LLM tokens, latency, and USD cost across providers

When working across multiple side projects and LLM APIs (OpenAI, Anthropic, Gemini, OpenRouter), keeping track of exact token usage and real-time USD cost gets messy fast. Most observability tools require routing your prompts through a hosted third-party SaaSβ€”which is overkill (and a privacy headache) if you just want to know how much your scripts are spending.

So I built llm-ledger (llm-ledger-cli)β€”a lightweight, local-first HTTP proxy and Rich CLI dashboard written in Python.

llm-ledger terminal demo


Try it in 10 seconds (zero install)

If you use uv, you can spin up the local proxy immediately without installing anything:


bash
uvx --from llm-ledger-cli llm-ledger start
Enter fullscreen mode Exit fullscreen mode
DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.