69 lines
2.0 KiB
JSON
69 lines
2.0 KiB
JSON
{
|
|
"$schema": "https://www.getbifrost.ai/schema",
|
|
"config_store": {
|
|
"enabled": true,
|
|
"type": "sqlite",
|
|
"config": {
|
|
"path": "./config.db"
|
|
}
|
|
},
|
|
"governance": {
|
|
"routing_rules": [
|
|
{
|
|
"id": "rule-gpt4-to-azure",
|
|
"name": "Route GPT-4 to Azure",
|
|
"description": "Route all GPT-4 model requests to Azure provider",
|
|
"enabled": true,
|
|
"cel_expression": "model.startsWith('gpt-4')",
|
|
"targets": [
|
|
{ "provider": "azure", "weight": 1.0 }
|
|
],
|
|
"fallbacks": ["openai"],
|
|
"scope": "global",
|
|
"priority": 0
|
|
},
|
|
{
|
|
"id": "rule-high-budget-fallback",
|
|
"name": "Use fallback when budget high",
|
|
"description": "Route to fallback providers when budget usage exceeds 80%",
|
|
"enabled": true,
|
|
"cel_expression": "budget_used >= 80.0",
|
|
"targets": [
|
|
{ "provider": "anthropic", "weight": 0.5 },
|
|
{ "provider": "openai", "weight": 0.5 }
|
|
],
|
|
"fallbacks": ["anthropic", "openai"],
|
|
"scope": "global",
|
|
"priority": 10
|
|
},
|
|
{
|
|
"id": "rule-embedding-lightweight",
|
|
"name": "Use lightweight embeddings",
|
|
"description": "Route embedding requests to cost-effective provider",
|
|
"enabled": true,
|
|
"cel_expression": "request_type == 'embedding'",
|
|
"targets": [
|
|
{ "provider": "openai", "model": "text-embedding-3-small", "weight": 1.0 }
|
|
],
|
|
"fallbacks": [],
|
|
"scope": "global",
|
|
"priority": 5
|
|
},
|
|
{
|
|
"id": "rule-premium-vk-azure",
|
|
"name": "Premium VK gets Azure",
|
|
"description": "Premium virtual keys always use Azure",
|
|
"enabled": true,
|
|
"cel_expression": "virtual_key_name == 'premium-tier'",
|
|
"targets": [
|
|
{ "provider": "azure", "weight": 1.0 }
|
|
],
|
|
"fallbacks": ["openai", "anthropic"],
|
|
"scope": "virtual_key",
|
|
"scope_id": "premium-tier",
|
|
"priority": 0
|
|
}
|
|
]
|
|
}
|
|
}
|