Open-source SDK - install in 30 seconds

Your LLM bill isn't random.You just can't see it.

LeanLLM shows exactly where your LLM cost comes from - per feature, per user, per request.

code.py
from leanllm import LeanLLM
client = LeanLLM()
client.chat(model="gpt-4o", messages=[...], labels={"feature": "chat"},)

One import. One label. Full cost visibility.

The Problem

You're flying blind with LLM costs.

Your OpenAI bill went up 40% last month. You don't know why. Nobody does. That's the problem.

10%

Power users drive spend

3x

Costs inflated by retries

70%

Budget hidden in one flow

The Solution

You don't need more logs.You need answers.

LeanLLM is a cost intelligence layer. Not another logging tool. It tells you where the money goes and what to do about it.

Cost per feature

Know exactly which product feature is expensive.

Cost per user

Find the users driving your LLM spend.

Most expensive requests

Surface the outliers that spike your bill.

Token + latency tracking

Correlate cost with performance in one view.

How It Works

Three steps. Under two minutes.

Install the SDK, connect your database, and start tracking every LLM call with cost and latency context in minutes.

Want deeper insights? Send events to LeanLLM Cloud
Step 1

Install the SDK

pip install leanllm

One line. No config files.

Step 2

Set your database URI

export LEANLLM_DATABASE_URI="postgres://..."

Events are stored where you control them.

Step 3

See structured events

# Every LLM call is now tracked
# with cost, tokens, latency, labels

Immediate visibility. No waiting.

Developer Experience

Built for engineers who ship.

client.py
# Works with any OpenAI-compatible API
from leanllm import LeanLLM
client = LeanLLM()
response = client.chat(  model="gpt-4o",  messages=[{"role": "user", "content": "..."}],  labels={"feature": "summarize", "user_id": "u_123"},)
Zero config - works out of the box
OpenAI & LiteLLM compatible
Async safe - no performance overhead
Production ready from day one

Outcomes

Not features.Decisions.

Every capability in LeanLLM exists to help you make a cost decision - not to look pretty on a dashboard.

See which feature is burning your budget

Label every LLM call by feature. Instantly know what costs the most.

Find your most expensive users instantly

Track cost per user. Identify power users skewing your spend.

Detect waste in retries and fallbacks

Hidden retry logic inflates your bill. LeanLLM exposes it.

Correlate cost with latency

Expensive doesn't always mean slow. Know which calls are both.

Track model usage across your stack

GPT-4o, Claude, Gemini - see costs by model in one place.

Export events. Query anything.

Your data, your database. Run any SQL query you want.

Pricing

Choose the plan that fits your team.

Value
Starter
The perfect plan to get started
$9.99/month
Billed monthly
  • Feature 1
  • Feature 2
  • Feature 3
Popular
Pro
The perfect plan for professionals
$19.99/month
Billed monthly
  • Feature 1
  • Feature 2
  • Feature 3
  • Feature 4
  • Feature 5
Enterprise
The perfect plan for enterprises
$29.99/month
Billed monthly
  • Feature 1
  • Feature 2
  • Feature 3
  • Feature 4
  • Feature 5
  • Feature 6
  • Feature 7

Why LeanLLM

Built for LLM cost decisions,not generic telemetry.

Others

Generic logging tools

LeanLLM

Built for LLM cost decisions

Others

Dashboards you never check

LeanLLM

Actionable answers you act on

Others

Observability platforms

LeanLLM

Cost intelligence layer

Others

Weeks to set up

LeanLLM

Two minutes to first insight

Open Source + SaaS

Your data. Your rules.

The SDK is fully open-source. Self-host, inspect, contribute. LeanLLM Cloud is optional - for teams that want aggregation, alerts, and zero maintenance.

Self-hosted

Use it locally

Install the SDK. Point to your own Postgres. Full control. No data leaves your infra.

View on GitHub
Managed

Use LeanLLM Cloud

Aggregated dashboards, alerts, team access, and deeper cost analysis. No infra to manage.

Get Started

Stop guessing your LLM costs.Start controlling them.

Two minutes to install. Immediate cost visibility. Open source.