docs+router: formalize runtime policy and remove temporary cloud-first code override
This commit is contained in:
@@ -48,14 +48,6 @@ except ImportError:
|
||||
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
logger = logging.getLogger(__name__)
|
||||
_CLOUD_FIRST_AGENT_SET = {
|
||||
x.strip().lower()
|
||||
for x in os.getenv(
|
||||
"CLOUD_FIRST_AGENTS",
|
||||
"daarwizz,helion,alateya,druid,nutra,agromatrix,greenfood,clan,eonarch,yaromir,soul,senpai,oneok,sofiia,monitor",
|
||||
).split(",")
|
||||
if x.strip()
|
||||
}
|
||||
|
||||
TRUSTED_DOMAINS_CONFIG_PATH = os.getenv("TRUSTED_DOMAINS_CONFIG_PATH", "./trusted_domains.yml")
|
||||
_trusted_domains_cache: Dict[str, Any] = {"mtime": None, "data": {}}
|
||||
@@ -1459,16 +1451,8 @@ async def agent_infer(agent_id: str, request: InferRequest):
|
||||
logger.exception(f"❌ CrewAI error: {e}, falling back to direct LLM")
|
||||
|
||||
default_llm = agent_config.get("default_llm", "qwen3:8b")
|
||||
if agent_id.lower() in _CLOUD_FIRST_AGENT_SET and not (metadata or {}).get("force_local_model"):
|
||||
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