router: bypass local routing rules for cloud-first agents
This commit is contained in:
@@ -1463,6 +1463,12 @@ async def agent_infer(agent_id: str, request: InferRequest):
|
||||
default_llm = "cloud_deepseek"
|
||||
|
||||
routing_rules = router_config.get("routing", [])
|
||||
if agent_id.lower() in _CLOUD_FIRST_AGENT_SET and not (metadata or {}).get("force_local_model"):
|
||||
# For cloud-first agents, ignore local-only routing rules unless explicitly forced.
|
||||
routing_rules = [
|
||||
rule for rule in routing_rules
|
||||
if not (isinstance(rule.get("use_llm"), str) and not rule.get("use_llm", "").startswith("cloud_"))
|
||||
]
|
||||
default_llm = _select_default_llm(agent_id, metadata, default_llm, routing_rules)
|
||||
|
||||
# Get LLM profile configuration
|
||||
|
||||
Reference in New Issue
Block a user