LiteLLM smart home integration, free and open source

Watch your LiteLLM Proxy: spend, budgets of keys and teams, models down.
Watch your self-hosted LiteLLM Proxy, the gateway that gives one OpenAI-compatible address to many LLM providers, from Gladys: is it up, what did it cost today and this month, how far are your keys and teams from their budget, and which models stopped answering.
This integration only supervises the gateway. Gladys keeps its own AI providers (OpenAI, Mistral, Ollama…): nothing here sends your conversations through LiteLLM.
Tested against a real LiteLLM Proxy 1.112.1 (PostgreSQL database, a mock model and a model pointing to a closed port): spend, budgets crossed, a model going down, a wrong key, a key without admin rights, a proxy without database, a proxy paused and a closed port. Feedback and bug reports are welcome on GitHub.
What you get
- A gateway device: online, LiteLLM version, spend today, this month and over the last 30 days, number of models, healthy and unhealthy models.
- One device per key or team followed: its spend and, when it has one, its max budget, the budget left and the share used (in percent).
- Two scene triggers: "LiteLLM model unhealthy" and "LiteLLM budget threshold reached".
- A scene action, "Read LiteLLM spend", for a weekly message or a condition.
- A dashboard widget, "LiteLLM", with the gateway, the spend, the models down and the budgets.
Amounts are in US dollars: LiteLLM counts every spend in dollars.
Requirements
- LiteLLM Proxy reachable from Gladys over the network: not
localhost, the integration runs in its own container. - A database for the proxy (
DATABASE_URL, PostgreSQL): LiteLLM keeps the spend, the keys and the teams there. Without one, only the online state, the version and the models are shown. - An admin key. Best: create a user with the
proxy_admin_viewerrole (read-only) in the admin interface (Internal users → Add user), then a key for that user. The master key works too, but it can change everything.
Configuration
- Address: the address of the proxy, with its port, e.g.
http://192.168.1.20:4000. The address of the admin interface (/ui) or of the OpenAI-compatible base (/v1) is accepted too. - Admin key: see above. It is only sent to the proxy, and never logged.
- Keys and teams to follow: their aliases or ids, separated by commas (20
at most). A key can be written as its alias, its short name (
sk-...abcd) or the start of its hash. Empty: every key and every team that has a max budget. - Spend refresh interval: from 1 minute to 1 hour (5 minutes by default). Six light requests each time; no model is called.
- Model health check: never, every 15 minutes, every hour (default) or every 6 hours. See "Costs and limits".
- Language of the names: the language of the names of the new devices and features, and of the messages of the scenes.
Test the connection reads the proxy at once and tells its version, the models, the spend, the keys and teams found, the entries of the follow list that match nothing, and the last health check.
Devices
Open the Discover tab of the integration and add the devices you want.
| Device | Features |
|---|---|
| LiteLLM | Online, Version, Spend today, Spend this month, Spend over 30 days, Models, Healthy and Unhealthy models |
| LiteLLM key / team | Spend, and with a budget: Max budget, Budget left, Budget used (%) |
Days and months are the days of the LiteLLM spend logs (UTC). The spend of a key or team is the one LiteLLM shows: since its creation, or since its last budget reset when it has a budget duration. A key or team that gets a budget later is offered with its new features in the Discover tab ("Update").
Scenes
Triggers
- LiteLLM model unhealthy: a model that answered fails the health check. Once per failure, never at the first check after the integration starts. Filter: the model name (empty: any). Variables: model, provider model, error.
- LiteLLM budget threshold reached: the spend of a key or team followed reaches 50, 80, 90 or 100 % of its max budget. Once per crossing, never at the first reading; again after a budget reset. Filters: the key or team, the threshold. Variables: key or team, threshold, budget used, spend, max budget.
To react to the gateway going offline, use the "Online" feature of the LiteLLM device in a device trigger.
Actions
- Read LiteLLM spend: reads the proxy now and returns the spend today, this
month and over 30 days, and, when a key or team is chosen, its spend, max
budget, budget left and budget used. Example: every Monday, send "LiteLLM:
spend_month$ this month". It fails, with the reason, when the proxy cannot be read.
Dashboard
The LiteLLM widget shows the spend today and this month, the number of models down, the gateway (online, version), the models down by name, and the budget of every key and team followed (or the ones chosen), in green, orange from 80 % and red from 100 %. Each block can be hidden in the widget settings, and so can the Refresh button.
Costs and limits
- A health check calls every model: LiteLLM sends a short request to each
one, which costs a little on paid providers. Choose a slow interval, or
"Never". If the proxy runs
background_health_checks: true, the integration reads its last result instead, at no cost. - The spend over 30 days and per day comes from LiteLLM's 30-day view: there is no all-time total of the gateway.
- At most 20 keys and teams are followed. 10 000 keys are read at most.
- Read-only: the integration never changes anything in LiteLLM.
- Not affiliated with BerriAI or the LiteLLM project.
Troubleshooting
- "This key is not an admin one": the key is a plain virtual key. Use a key
of a
proxy_admin_vieweruser, or the master key. - "LiteLLM has no database": set
DATABASE_URLon the proxy to see spend, keys and teams. - "This address does not answer like LiteLLM Proxy": check the port (4000 by default) and the path, if the proxy is behind a reverse proxy.
- A key or team is missing: "Test the connection" lists the entries of the follow list that match nothing; check the alias.
- More details in the logs of the integration (
LOG_LEVEL=debug).
Configuration settings
These are the settings LiteLLM asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your LiteLLM Proxy | section | No | Supervision only: Gladys keeps its own AI providers. Enter the address of the proxy and an admin key, then add the devices from the Discover tab. |
| Address | string | Yes | Address of the proxy as seen from Gladys (not localhost), with its port. |
| Admin key | secret | Yes | Best: a key of a user with the proxy_admin_viewer role (read-only). The master key works too. |
| Keys and teams to follow | string | No | Aliases or ids, separated by commas (20 at most). Empty: every key and team that has a budget. |
| Spend refresh interval | select | No | How often spend, keys and teams are read: six light requests, no model called. |
| Model health check | select | No | Each check sends a short request to every model (a small cost), unless the proxy runs background_health_checks. |
| Language of the names | select | No | Names of the new devices and features (frozen once added), and scene messages. |
How to install LiteLLM in Gladys
- In Gladys, open Integrations: LiteLLM appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-litellm:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-litellm.
LiteLLM requires Gladys >=5.1.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.
Not running Gladys yet? It is free and open source: follow the installation guide to get started.
About external integrations
LiteLLM is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by guim31, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation