explaingit

muratbuker/exporter-litellm

Analysis updated 2026-05-18

0PythonAudience · ops devopsComplexity · 3/5

TLDR

A Prometheus exporter that turns LiteLLM's usage and spend data into dashboard-ready metrics across three fixed time windows.

Mindmap

mindmap
  root((LiteLLM Exporter))
    What it does
      Reads LiteLLM database
      Exposes Prometheus metrics
      Three fixed time windows
    Tech stack
      Python
      Prometheus
      PostgreSQL
      Grafana
    Use cases
      Cost monitoring dashboards
      Per user spend tracking
      Budget alerts
    Audience
      Ops teams
      DevOps engineers
      LiteLLM operators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Feed LiteLLM spend and usage data into a Grafana dashboard for cost monitoring.

USE CASE 2

Track per-user, per-team, or per-API-key spend on AI model requests.

USE CASE 3

Set up alerts on error rates or budget usage across your LiteLLM deployment.

USE CASE 4

Monitor request volume and token consumption at hourly, daily, and monthly resolution.

What is it built with?

PythonPrometheusPostgreSQLGrafana

How does it compare?

muratbuker/exporter-litellm0xhassaan/nn-from-scratch3ks/embedoc
Stars00
LanguagePythonPythonPython
Last pushed2023-06-08
MaintenanceDormant
Setup difficultymoderatehard
Complexity3/54/51/5
Audienceops devopsdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

In plain English

This project is a Prometheus exporter for LiteLLM, a tool that routes requests to different AI language models. In plain terms, it reads usage and cost data out of the database that LiteLLM keeps and turns that data into metrics that monitoring tools like Prometheus and Grafana can display on dashboards. It is a fork of another exporter called ncecere/exporter-litellm, with the main change being how it organizes time periods for the numbers it reports. Instead of letting each person configure their own rolling time window for spend and usage stats, this exporter reports most metrics in three fixed windows: the last 30 days, the last 1 day, and the last 1 hour. Each version of a metric gets its own name, so a Grafana dashboard can pull exactly the time range it needs without extra calculation. The three windows also refresh on different schedules, so the fast moving hourly numbers update often while the slower 30 day totals are not recalculated as frequently, which keeps the load on the underlying Postgres database manageable. The metrics themselves cover things like total spend, spend broken down by user, team, key, or organization, token counts, request counts, error rates, budget usage, and information about active or expired API keys. Some data, like request duration, is reported as a single ongoing measurement since it is meant to be queried across any time range directly in Prometheus. To use this project, you connect it to your LiteLLM Postgres database by setting environment variables for the host, port, database name, and credentials, and the documentation recommends creating a dedicated read only database user for security. You can also configure how often each of the three metric tiers refreshes and which port the exporter listens on. This is a backend infrastructure tool aimed at people already running LiteLLM who want visibility into cost and performance through existing monitoring dashboards.

Copy-paste prompts

Prompt 1
Help me configure the environment variables for exporter-litellm to connect to my LiteLLM Postgres database with a read-only user.
Prompt 2
Explain the difference between the 30day, 1day, and 1hour metric tiers in exporter-litellm and how to set their refresh intervals.
Prompt 3
Write a Grafana dashboard panel that uses the litellm_total_spend_1hour metric from this exporter.
Prompt 4
Walk me through deploying exporter-litellm alongside my existing LiteLLM proxy setup.

Frequently asked questions

What is exporter-litellm?

A Prometheus exporter that turns LiteLLM's usage and spend data into dashboard-ready metrics across three fixed time windows.

What language is exporter-litellm written in?

Mainly Python. The stack also includes Python, Prometheus, PostgreSQL.

Who is exporter-litellm for?

Mainly ops devops.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.