81 lines
1.9 KiB
Text
81 lines
1.9 KiB
Text
|
|
let C = import "../nickel/llm-router/contracts.ncl" in
|
||
|
|
|
||
|
|
{
|
||
|
|
routing | C.RoutingConfig = {
|
||
|
|
default_provider = "claude",
|
||
|
|
cost_tracking_enabled = true,
|
||
|
|
fallback_enabled = true,
|
||
|
|
},
|
||
|
|
|
||
|
|
providers = {
|
||
|
|
claude | C.ProviderConfig = {
|
||
|
|
enabled = true,
|
||
|
|
api_key = "${ANTHROPIC_API_KEY}",
|
||
|
|
model = "claude-sonnet-4-5-20250929",
|
||
|
|
max_tokens = 8192,
|
||
|
|
temperature = 0.7,
|
||
|
|
cost_per_1m_input = 3.00,
|
||
|
|
cost_per_1m_output = 15.00,
|
||
|
|
},
|
||
|
|
|
||
|
|
openai | C.ProviderConfig = {
|
||
|
|
enabled = true,
|
||
|
|
api_key = "${OPENAI_API_KEY}",
|
||
|
|
model = "gpt-4o",
|
||
|
|
max_tokens = 4096,
|
||
|
|
temperature = 0.7,
|
||
|
|
cost_per_1m_input = 2.50,
|
||
|
|
cost_per_1m_output = 10.00,
|
||
|
|
},
|
||
|
|
|
||
|
|
gemini | C.ProviderConfig = {
|
||
|
|
enabled = true,
|
||
|
|
api_key = "${GOOGLE_API_KEY}",
|
||
|
|
model = "gemini-2.0-flash",
|
||
|
|
max_tokens = 8192,
|
||
|
|
temperature = 0.7,
|
||
|
|
cost_per_1m_input = 0.30,
|
||
|
|
cost_per_1m_output = 1.20,
|
||
|
|
},
|
||
|
|
|
||
|
|
ollama | C.ProviderConfig = {
|
||
|
|
enabled = true,
|
||
|
|
url = "${OLLAMA_URL:-http://localhost:11434}",
|
||
|
|
model = "llama3.2",
|
||
|
|
max_tokens = 4096,
|
||
|
|
temperature = 0.7,
|
||
|
|
cost_per_1m_input = 0.00,
|
||
|
|
cost_per_1m_output = 0.00,
|
||
|
|
},
|
||
|
|
},
|
||
|
|
|
||
|
|
routing_rules | Array C.RoutingRule = [
|
||
|
|
{
|
||
|
|
name = "architecture_design",
|
||
|
|
condition = { task_type = "architecture" },
|
||
|
|
provider = "claude",
|
||
|
|
model_override = "claude-opus-4-20250514",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name = "code_generation",
|
||
|
|
condition = { task_type = "development" },
|
||
|
|
provider = "claude",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name = "documentation",
|
||
|
|
condition = { task_type = "documentation" },
|
||
|
|
provider = "openai",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name = "monitoring",
|
||
|
|
condition = { task_type = "monitoring" },
|
||
|
|
provider = "gemini",
|
||
|
|
},
|
||
|
|
{
|
||
|
|
name = "local_testing",
|
||
|
|
condition = { environment = "development" },
|
||
|
|
provider = "ollama",
|
||
|
|
},
|
||
|
|
],
|
||
|
|
}
|