Overview
Tag Filtering allows LLMGrid to route requests to model deployments based on matching tags. This is useful when multiple deployments share the same public model name but serve different purposes, such as:freevspaidstandardvspremiumregion:usvsregion:eu- Provider-specific deployments
- Team-specific deployments
- Workload-specific deployments
Enable Tag Filtering
To enable Tag Filtering:- Sign in to the LLMGrid console.
- Select the appropriate Tenant.
- Navigate to Router Settings.
- Open the Loadbalancing tab.
- Locate Enable Tag Filtering.
- Turn on Enable Tag Filtering.
- Select Save Changes.
Tag Filtering should be enabled only after the model deployments that participate in tag-based routing have been assigned appropriate tags.
How Tag Filtering Works
Consider three deployments that expose the same public model:
An application always requests
enterprise-chat. The tag determines which deployment pool is eligible.
free.
Send a Tagged Request
Tags can be included directly in the request body.Route to free
Route to paid
Passing Tags Through Metadata
Tags can also be provided within request metadata.Passing Tags Through a Request Header
Tags can also be supplied through thex-litellm-tags request header. Multiple tags are comma-separated.
Default Tag
Use the reserveddefault tag to provide a deployment pool for requests that do not specify routing tags.
When a
default deployment is available, it provides the candidate pool for an untagged request.
Configure a deliberate default deployment when applications may send requests without routing tags.
Negation Tags
Prefix a tag with! to exclude deployments carrying that exact tag.
Exclude Multiple Deployment Groups
Required Tags
Prefix a tag with& when a deployment must contain that tag to remain eligible.
Tag Types
These conditions can be combined.
No Matching Deployment
Tag constraints can eliminate all available deployments. If no eligible deployment remains, LLMGrid rejects the request because the routing requirements cannot be satisfied. This behavior is particularly important when tags represent mandatory requirements.Fail-Open Behavior
Advanced configurations can allow a model group to fail open when caller-supplied required or negation tags eliminate all candidate deployments. Instead of failing the request, routing can return to the configured default deployment pool.Use fail-open carefully. A default deployment might not satisfy the original caller-suppliedDo not use fail-open behavior when a tag represents a mandatory compliance, provider, security, or regional requirement.!or&constraint.
Team-Based Tag Routing
Tags can also be associated with teams.- Department-specific deployments
- Dedicated capacity
- Customer-specific model pools
- Business-unit isolation
- Environment-specific routing
Recommended Tag Naming
Use structured tag names that remain understandable as the number of deployments grows.Verify Tag Routing
After enabling Tag Filtering:- Send a request with a known routing tag.
- Open Request Logs.
- Locate the request.
- Verify the model and deployment selected for the request.
- Repeat using a different tag.
free followed by paid and verify that LLMGrid selects the expected deployment pool.
Troubleshooting
Tags do not affect routing
Verify that:- Enable Tag Filtering is enabled in Router Settings.
- Tags have been assigned to the applicable model deployments.
- The request tag exactly matches a deployment tag.
- The requested public model has eligible tagged deployments.
- The Virtual Key is authorized to use the requested model.
Untagged requests are not routing as expected
Verify that the applicable model group has a deployment taggeddefault.
Required tags cause requests to fail
A required tag such as®ion:us must exist on an eligible deployment. If no deployment satisfies all required tags, the request cannot be routed.
Negation tags remove all deployments
Review the! tags supplied with the request. Multiple exclusions may leave no eligible deployment.
Best Practices
- Configure deployment tags before enabling Tag Filtering.
- Use consistent namespaces such as
provider:,region:,tier:,team:, andworkload:. - Configure a
defaultdeployment for requests that do not send routing tags. - Use
&for requirements that must all be satisfied. - Use
!to explicitly remove deployment groups. - Avoid using caller-controlled tags alone as a security or compliance boundary.
- Use team and Virtual Key policies for administrator-controlled routing requirements.
- Test tag routing before enabling it for production workloads.
- Use Request Logs to validate routing outcomes.

