How tag-based routing in LiteLLM separates free, paid and tenant capacity
Tag-based routing sends each request to the deployments that carry a matching tag, so one model name can point at different capacity for different groups. In LiteLLM, you attach tags to model deployments, set enable_tag_filtering under router_settings, and define a default tag that catches requests sent without one. The LiteLLM tag routing docs describe this mechanism and are the reference to check against your LiteLLM version before you build on it. Teams usually reach for it when a shared gateway serves several groups that need different capacity for the same model, such as a free pool of deployments for low-priority internal work and a paid pool for production, or a dedicated deployment for one tenant whose data or quota must stay separate.
Tags do not enforce who may use a deployment. A caller that sends a tag it should not have will be routed to that tag's deployments unless something else stops it. Access control belongs to virtual keys, model restrictions and team settings, which you should design alongside the tags, not after them. Before you rely on routing for separation, confirm how your version handles requests that carry a tag the key is not meant to use, and test that case directly. Also confirm which tags the gateway accepts from callers and which it sets itself, because a tag supplied by the client is only as trustworthy as the process that sets it.
Plan the tag scheme before you add deployments. Decide which tag names map to free, paid and tenant capacity, which deployment gets the default tag, and who owns each tag. Then verify the routing with test requests for each tag and for untagged traffic, and confirm where the tag appears in request logs so that spend can be attributed later. Ask your LiteLLM contact or check the documentation for any limits on tag filtering in your release line, since the facts available here do not cover them.
How a tagged request reaches a matching deployment
The walk-through starts with a client request that carries a tag and enters the LiteLLM proxy. With enable_tag_filtering set in router_settings, the router keeps only the deployments whose tags match the request, then picks one among them. Requests without a tag follow the default tag path, so they still reach a deployment. Check that each deployment has the tags you expect and that the default tag maps to the capacity you intend untagged traffic to use.
Tagged and untagged requests take different paths through the router to provider deployments.
Which tag configuration fits which capacity pattern
This table compares three tag-based patterns: splitting free and paid capacity, dedicating deployments to tenants, and using a shared default pool for untagged traffic. Read each row for the config element it relies on, when it fits, and where it breaks down, then confirm the exact tag behavior against the LiteLLM tag routing documentation for your release.
| Pattern | Config elements used | When it fits | When it does not fit |
|---|---|---|---|
| Free versus paid capacity | Deployment tags for each tier, enable_tag_filtering, callers send a tier tag per request | You want paid callers to reach a higher-quota or better-priced deployment while free callers stay on a limited one | Tiers need hard per-key spend caps or rate limits, which belong in key budgets and limits rather than tags alone |
| Dedicated tenant deployments | Tenant-specific deployment tags, enable_tag_filtering, tenant tag sent by the calling application | A tenant needs its own provider account, region, or data-handling path for the same model name | Many small tenants would multiply deployments and configuration, so model access groups or key-level restrictions may be easier to maintain |
| Shared default pool for untagged traffic | Default tag on the general deployments, enable_tag_filtering, untagged requests fall through to this pool | Most traffic has no special requirement and you want a single fallback that never rejects unlabeled calls | Untagged traffic must never reach a tenant or paid deployment, so confirm the default tag targets only the intended pool |
| Tag filtering disabled | No tag filtering, deployments are chosen by the normal router across all matching deployments | Every deployment of the model is interchangeable and no caller needs to be steered | Callers depend on being kept off certain capacity, because tags have no effect until filtering is turned on |
| Tags for cost or quota only | Deployment tags used as labels, enable_tag_filtering with callers tagging their own traffic | You want to direct traffic by capacity and track it, but trust callers to send correct tags | Callers are untrusted or external, since a caller that sends another tenant's tag can reach that capacity |
| Tag and key controls combined | Tags for placement, virtual key model restrictions and budgets for access and spend | You need routing to a specific deployment and also a guarantee that a key cannot reach models it should not | Tags are used alone to enforce access, which leaves the control dependent on every caller sending the right tag |
Design choices before you tag deployments
The platform team owns the tag model: the names, the number of tags, the default tag and how many deployments back each model. Tags are cheap to add and expensive to rename once applications send them, so treat the vocabulary as an interface. Keep it small enough that every tag has a clear meaning and a named owner.
- Tag naming: Choose names that describe the capacity or tenancy they represent, such as a paid or free pool, not the team that happens to use it today. Document the meaning of each tag in one place.
- Default tag ownership: Decide which deployments serve untagged traffic and who answers when that pool fills up. Untagged requests are often the largest group, so the default pool needs an explicit owner.
- Deployments per model: More deployments give finer isolation but add configuration, health checks and capacity planning. Fewer deployments are simpler but share failure and throughput across more traffic.
- Configuration as code: Keep tags in the proxy configuration under version control so changes are reviewed like any other infrastructure change.
Confirm with your LiteLLM version how enable_tag_filtering and the default tag behave before you publish a naming scheme, and test the scheme against a staging gateway first.
Application teams decide which tag their requests carry and what happens when a request arrives without one. Their choice determines whether a workload lands on paid capacity, a dedicated tenant deployment or the shared default pool. Agree on the rules with the platform team before an application goes live, not after an incident.
- Tag selection: Map each application or workload to one tag in its configuration, so the choice is visible in code review and is not left to individual developers.
- Untagged traffic: Decide whether untagged calls should fall to the default pool or fail. A silent fallback can move production traffic onto capacity meant for batch or test work.
- Tag changes: Plan how an application moves from one tag to another, including whether in-flight sessions are affected, and test the switch in a non-production environment.
- Client libraries: Confirm how your SDKs and developer tools pass tags, since a tag that is set in one client may be missing from another.
For each application, check that a request with the intended tag reaches the expected deployment and that a request with no tag behaves as the team intends.
Finance and security teams care less about how requests are routed and more about what the routing record says. Tags can tie spend and access decisions to a named capacity pool, but only if the tag model is consistent and logged. Ask for these mappings before the tag model is in production, because changing them later breaks historical comparisons.
- Budget mapping: Confirm whether budgets and spend reports are set per key, team or project, and how a tag relates to those boundaries. A tag that spans several budgets will make chargeback harder to explain.
- Audit records: Check which request and routing details are written to logs, and whether the tag appears in those records. Without it, an auditor cannot tell which pool served a request.
- Access boundaries: Dedicated tenant deployments can separate data handling by tag, but the separation holds only if keys and teams cannot send requests with a tag they should not use. Test this directly.
- Retention and ownership: Agree who owns the tag definitions and how long historical tag data is kept for reporting.
Ask the platform team to show a sample log entry for a tagged request and an untagged request before signing off on the design.
Configure tag routing on a self-hosted LiteLLM proxy
This sequence turns a set of model deployments into tag-scoped capacity, so requests carrying a tag reach only the matching deployments and untagged traffic lands on a known default.
Inventory the model deployments and providers
The platform team lists every model deployment the proxy should expose, including the provider, the model name, and the credential reference each one uses. Keep provider keys in your secret manager and reference them from the config rather than pasting them into the file. Write down which deployments are free or shared capacity, which are paid, and which are dedicated to a single tenant, because those groupings become your tags. The step is done when each deployment has a clear owner and a purpose, and the list can be read back without guessing. Check the provider documentation for the exact model identifiers and authentication fields your proxy version expects.
Define the deployments in the proxy config
Add each deployment to the model_list section of the proxy configuration file, giving every entry a model_name that callers use and a litellm_params block that names the provider model and credential reference. Two entries can share one model_name when they represent different capacity for the same model, which is the case tag routing is built for. Validate the YAML syntax before going further. The check is that the proxy starts in a test environment and its model listing shows every deployment you expected, with no missing or duplicated entries.
Assign tags to each deployment
Attach a tags list to each deployment in litellm_params, using names that reflect the routing decision, such as a free-capacity tag on shared deployments and a tenant-specific tag on dedicated ones. Keep tag names lowercase and stable, since callers and dashboards will depend on them. Avoid tagging a deployment with a tag that also means something different for another team. The check is a written tag map showing each deployment, its tags, and the caller group allowed to request each tag. Confirm the exact tag field name and placement against the tag routing documentation for your proxy version.
Enable tag filtering in router settings
Set enable_tag_filtering to true under router_settings in the same config file. Without this switch the proxy does not narrow candidate deployments by the tag a request carries, so tags on deployments have no routing effect. Make this change in the file under version control so the review history shows when filtering was turned on. The check is a config diff that contains only the intended router_settings change, reviewed by someone other than the author.
Set the default tag for untagged requests
Decide which deployments serve requests that arrive without a tag and assign them the default tag in the configuration. This determines where unlabeled traffic goes, so choose the deployment that matches your cost and capacity policy, not whichever one happened to be listed first. Document the decision next to the tag map. The check is a short written statement that names the default tag, the deployments that carry it, and the team that owns that choice. Confirm how default tags are expressed in your proxy version before editing.
Restart or reload the proxy and confirm it loads
Apply the configuration by restarting the proxy or reloading its config, according to how your deployment handles changes. Watch startup logs for errors about unknown fields, missing credentials, or deployments that failed to register. Plan the restart in a maintenance window, since requests in flight can fail during a restart. The check is a clean startup log and a health check that returns healthy for every instance behind your load balancer.
Send tagged and untagged test requests
Send a set of test requests from a non-production key: some with each tag, and some with no tag at all. Use a distinct prompt marker in each request so the results are easy to trace. Include at least one request tagged with a value that matches no deployment, to see how the proxy responds. The check is a results table listing each request, the tag sent, and the response status.
Verify which deployment served each request
For every test request, open the proxy logs or request metadata and confirm which deployment handled it. Tagged requests should appear only on deployments carrying that tag, and untagged requests should appear on the default-tag deployments. Any mismatch means the tag map, the filtering switch, or the default assignment needs correction before production traffic is routed. Record the results alongside the config version so a later change can be compared against a known baseline. The step is done when every test request maps to the expected deployment and the record is stored with the configuration.
Security risks when tags decide where traffic goes
Tag routing decides which deployment serves a request, but it does not decide who is allowed to ask for that deployment. The cards below cover the places where a tag-based design can leak tenant traffic, bill the wrong capacity, or leave no record of where a request went.
Callers can set their own tags
A tag is only a routing hint carried with the request. If callers can attach any tag they like, a tenant can ask for another tenant's dedicated or paid deployment just by naming it. Tags alone do not isolate tenants. Check which keys are allowed to send which tags, and confirm that the gateway, not the application, decides the tag for each key. Test this by sending a tag that belongs to another team with a key that should not be able to use it.
Tag routing docsEnforce access with virtual keys
Model restrictions on virtual keys are the layer that decides which capacity a caller may use, independent of any tag in the request. Restrict each tenant's key to the models and deployments it owns, and confirm that a request for a model outside that list is refused even when the tag matches. Virtual keys need a PostgreSQL database, so confirm that key state survives restarts and is shared across proxy instances.
Virtual keys docsKeep dedicated tenant credentials separate
A dedicated tenant deployment is only dedicated if its provider credentials, endpoint and network path are also separate. If every deployment shares one upstream API key or one egress route, a routing mistake exposes the tenant's data path, not just its label. Give each dedicated deployment its own credential, store it in a secret manager, and confirm which network route each deployment uses.
- Per-worker sizing guide
- 1 vCPU
Watch default-tag traffic
Requests without a tag fall through to the default tag. If that tag points at paid or sensitive capacity, untagged traffic from a forgotten integration can be billed or processed there without anyone choosing it. Decide deliberately which deployment the default tag maps to, prefer a low-cost or non-sensitive default, and alert when the default path receives unexpected volume.
Log the chosen deployment
Audit and cost reports need to show which deployment actually served each request, not only which tag the caller sent. Confirm that request logs record the selected deployment, the tag applied, the key and team, and whether the default tag was used. Without this, a routing error can be found only through a bill or a complaint. Confirm the exact log fields with the version you run.
Test routing before changes go live
Routing rules change over time as capacity is added, and a rule that was safe last quarter may not be safe now. Keep a short test set that sends tagged and untagged requests with each key class and checks which deployment answers. Re-run it after every change to deployment tags, default tags or key restrictions, and store the results with the change record.
Questions teams ask before setting up tag routing
What drives the cost and effort of setting up tag routing in LiteLLM?
The main drivers are the number of deployments you tag, the number of tenants or traffic classes that need their own routing, and the testing and logging work needed to prove each tag reaches the right capacity. Tag routing itself is configuration in router_settings, so the cost comes from the surrounding work: inventorying provider accounts and model deployments, agreeing tag names, validating the default tag for untagged traffic, and confirming that logs show which tag and deployment served each request. Each additional tenant or capacity pool adds configuration, test cases and review. Ask any partner for a quote that lists these items separately, and note which parts are one-time (design and first verification) and which recur (adding deployments, changing tags, re-testing after upgrades).
How long does tag routing setup take?
Duration depends on scope, not on the feature itself. A single gateway with two or three tagged deployment groups and a default tag takes less time than a multi-tenant setup where each tenant has dedicated deployments, separate provider accounts and its own verification evidence. The main variables are how many deployments need tags, how many approvals the naming and capacity decisions require, whether provider capacity must be provisioned first, and how much testing and logging validation your security or compliance team requires before production. Confirm the timeline against a written scope rather than a generic estimate.
Can our team set up tag routing without outside help?
Yes, for a small configuration. An engineer who knows the LiteLLM proxy can add tags to deployments, enable tag filtering and set a default tag in a test environment. Effort rises when the setup must be reviewed for security and cost. Your team will still need to verify that tagged requests reach only the intended deployments, that untagged traffic lands on the default tag as expected, that failover behaves correctly when a tagged deployment is down, and that the configuration is stored and changed under version control. Those checks, plus any security review of provider credentials and logs, are the parts teams most often underestimate.
What do we need to provide before the work starts?
Plan to provide access to a test and production LiteLLM proxy, the provider accounts and model deployments you want to route between, and a current inventory of which models, regions and capacity pools exist. You will also need decisions on tag naming, such as which tags mark free versus paid capacity or dedicated tenant deployments, and which tag handles untagged requests. Name the owners who approve each decision. Confirm with your provider which credentials and quotas apply to each deployment, because routing cannot send traffic to capacity you have not provisioned.
Does tag routing replace access control in LiteLLM?
No. Tag routing decides which deployment serves a request that already reached the gateway. It does not decide who is allowed to send that request. Access is controlled separately through virtual keys, team and user assignments, and model restrictions on keys. A caller with a key that can reach a model can still be routed by tag, and a tag does not stop an unauthorized caller from using a model. Design both layers together: use keys and teams to decide who can call a model, and use tags to decide which capacity serves the call.
How do we check that tagged requests go to the right deployment?
Test with requests that carry each tag and with untagged requests, then confirm in the logs which deployment served each one. Include negative tests, such as a request tagged for paid capacity that must not reach free capacity, and failover tests where the target deployment is unavailable. Record the results as evidence for your change review. Retest after each LiteLLM upgrade, because routing behavior is part of the release you run.
What happens to requests with no tag, and what risks should we plan for?
Untagged requests go to the default tag you configure. Decide that tag deliberately, because it may receive traffic you did not intend for premium or dedicated capacity. Common risks include tenant traffic landing on shared deployments, cost spikes when untagged traffic reaches expensive capacity, and misreporting when logs do not record the tag used. Confirm the exact behavior for your LiteLLM version against the tag routing documentation before relying on it.
How DeployOpen scopes and delivers LiteLLM tag routing
DeployOpen plans tag routing as part of the wider LiteLLM gateway, so deployment tags, the default tag and the router settings are agreed before anything is configured. The work is delivered inside your own infrastructure, with a written scope, tested routing behavior and documentation your platform team can run after handover.
How we scope
- We list which models, deployments and capacity pools need tags, such as free versus paid or dedicated tenant deployments.
- We define the default tag for untagged traffic and decide which callers are allowed to send which tags.
- We agree the written scope, deliverables and timeline with you before work starts, since most engagements are fixed-scope.
How we build
- We assign tags to each deployment in the proxy configuration and enable tag filtering in router settings.
- We keep the tag and deployment configuration under version control so changes are reviewed like other infrastructure code.
- We test that tagged requests reach matching deployments, untagged requests reach the default tag, and mismatched tags fail as designed.
How we hand over
- We document the tag map, the default tag behavior, and the steps to add a deployment or tag without disrupting callers.
- We walk your platform and operations staff through the configuration, test cases and known failure modes.
- We deliver runbook notes for checking routing decisions, so your team can confirm which deployment served a request.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, including after LiteLLM version changes.
- We can retest tag routing after new deployments are added, after the gateway is upgraded, or when tenant capacity changes.
- Confirm with us which support level, response times and upgrade coverage your retainer includes before you sign.

