Group Based Routing
Simple routing based on LangDB cost groups for different teams and departments.
Use Case
Configuration
{
"model": "router/dynamic",
"router": {
"type": "conditional",
"routes": [
{
"name": "development_group",
"conditions": {
"all": [
{
"metadata.group_name": {
"$eq": "development"
}
}
]
},
"targets": "openai/gpt-5"
},
{
"name": "testing_group",
"conditions": {
"all": [
{
"metadata.group_name": {
"$eq": "testing"
}
}
]
},
"targets": "openai/gpt-4o-mini"
},
{
"name": "production_group",
"conditions": {
"all": [
{
"metadata.group_name": {
"$eq": "production"
}
}
]
},
"targets": {
"$any": [
"gemini/gemini-2.5-pro",
"xai/grok-4"
],
"sort_by": "ttft",
"sort_order": "min"
}
},
{
"name": "executive_group",
"conditions": {
"all": [
{
"metadata.group_name": {
"$eq": "executive"
}
}
]
},
"targets": "anthropic/claude-sonnet-4"
},
{
"name": "fallback_group",
"conditions": {
"all": []
},
"targets": "openai/gpt-4.1-nano"
}
]
}
}How It Works
Variables Used
Group Setup
Customization
Last updated
Was this helpful?