An overview of what the open-source LLM gateway can do
LLMs have arrived in many teams: developers use Claude Code, Copilot, or Codex, in support they help with triaging inquiries and drafting responses, and in some places automated agents independently take on tasks like monitoring or ticket sorting. In many companies, however, the adoption of LLM-based tools is outpacing the ability of internal governance to keep up. One of the fundamental questions that keeps coming up is: Where exactly are LLM costs actually being incurred?
Without answering that, all that’s left at the end of the month are numbers on invoices from various model providers, without context, without any starting point for optimization, sometimes not even broken down by user ID. The remedy here is a centralized gateway approach for offering LLMs within the company: all LLM traffic, whether triggered by humans or by software, runs through an internal gateway. LiteLLM, an open-source proxy for accessing a wide range of AI models, is one such gateway. With LiteLLM, you can consolidate access to services from different LLM providers (SaaS or self-hosted) as well as internal MCP servers, while controlling and attributing costs.
The first step is simple: each team gets its own budget and its own overview in LiteLLM. This makes it possible to see at a glance how intensively a given department is working and whether it’s still within its allotted range:

Support team: roughly a third of the budget used
Legal department: moderate usage, well under the limit
Data science team: highest utilization, close to the budget ceiling
In doing so, LiteLLM consolidates access to models and allocates the costs from different providers directly to teams and users, eliminating the need to manually reconcile multiple invoices at the end of the month.
Something that’s often overlooked in discussions about AI costs: automated agents for system monitoring, incident management, or code reviews, for instance, often run in the background, continuously and unsupervised. An agent that monitors metrics around the clock can rack up more costs in a month than an entire development team combined.

That’s why LiteLLM treats agents as their own cost center, each with its own model, its own consumption, and its own visibility. This makes it possible to spot early on when the costs for a single agent start running out of bounds.
Transparency is one side of the coin, control is the other. LiteLLM lets you set budgets at both the team and user level: once a limit is reached, further requests can be automatically stopped or redirected, with no manual intervention required. This creates an early-warning system that lets teams keep their LLM usage in check before an unpleasant surprise shows up on the invoice at the end of the month.
Budgets govern how much a team consumes in tokens. Just as important, though, is the question of what a request to a model is allowed to look like, and what happens to the response before it comes back. For this, LiteLLM offers guardrails for requests: automated checks that run before, during, or after a model call. Among other things, these can detect attempts to deliberately manipulate a model. Personal data such as email addresses or credit card numbers can be automatically masked, accidentally included credentials can be intercepted, and content can be checked against defined policies.
Because these checks can be configured not just globally but specifically per team or per access credential, the finance department, for example, can be subject to stricter checks than an internal development team. Individual guardrails can be bundled into policies, which can then be assigned to specific teams.
For LiteLLM to calculate costs at all, it needs a pricing basis. At the moment, this is handled via a stored price list. To do this, the system relies on a public, community-maintained price list, which records context limits as well as costs per token, per request, or per unit of time for common models. Every request is calculated based on this price table.

This means, on the one hand, that this price list has to be maintained manually in-house; on the other hand, LiteLLM also offers the option to configure custom overrides, such as percentage-based discounts. Beyond that, this also makes it easy to record costs for self-hosted models, so they can be charged back internally.
Things get especially revealing once you look at usage over time. In our sample data, for instance, there was a noticeable drop in costs over the weekend: A clear sign that the bulk of spending is actually driven by employees, not by agents running continuously. Insights like these are enormously helpful when figuring out where optimization would pay off the most.

For detail questions along the lines of “What exactly did this one expensive request cost, who triggered it, which model was used?”, LiteLLM lets you drill all the way down to the individual request. The log shows, line by line, the cost, duration, model used, token count, and the responsible cost center, calculated based on exactly those stored prices.
Controlling LLM costs requires the right monitoring infrastructure. With LiteLLM as a central gateway, every request, whether from a developer or an agent, whether purchased externally or run internally, can be attributed to a clear point of origin, while at the same time enforcing what content and data those requests are actually allowed to contain. That doesn’t just create cost transparency; it also helps protect the company from manipulation attempts or data leaks caused by sensitive information accidentally ending up in prompts.
Senior consultant
Optimize alignment between IT and business with expert advice and clear strategies.