-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathagent_profiles.py
More file actions
55 lines (45 loc) · 2.06 KB
/
Copy pathagent_profiles.py
File metadata and controls
55 lines (45 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Per-agent KPI weights (cost / latency / quality) and Groq model tier pools.
Senior Dev may only use mid + top tiers; other agents may use cheap + mid + top.
"""
from __future__ import annotations
from typing import Dict, List
AGENT_CANONICAL_NAMES = (
"Pathfinder",
"Triage Nurse",
"Archaeologist",
"Senior Dev",
"Testing Agent",
"Learning Reviewer",
)
# One Groq API key per agent (different accounts) to spread rate limits.
GROQ_API_KEY_ENV: Dict[str, str] = {
"Pathfinder": "GROQ_API_KEY_PATHFINDER",
"Triage Nurse": "GROQ_API_KEY_TRIAGE_NURSE",
"Archaeologist": "GROQ_API_KEY_ARCHAEOLOGIST",
"Senior Dev": "GROQ_API_KEY_SENIOR_DEV",
"Testing Agent": "GROQ_API_KEY_TESTING_AGENT",
"Learning Reviewer": "GROQ_API_KEY_REVIEWER",
}
KPI_WEIGHTS: Dict[str, Dict[str, float]] = {
"Pathfinder": {"cost": 0.60, "latency": 0.30, "quality": 0.10},
"Triage Nurse": {"cost": 0.30, "latency": 0.50, "quality": 0.20},
"Archaeologist": {"cost": 0.33, "latency": 0.34, "quality": 0.33},
"Senior Dev": {"cost": 0.15, "latency": 0.25, "quality": 0.60},
"Testing Agent": {"cost": 0.40, "latency": 0.35, "quality": 0.25},
"Learning Reviewer": {"cost": 0.25, "latency": 0.35, "quality": 0.40},
}
# Logical tier labels → Groq model *keys* understood by integrations.groq_client.GroqClient.MODELS
_LLAMA_4_SCOUT = "meta-llama/llama-4-scout-17b-16e-instruct"
_GPT_OSS_120B = "openai/gpt-oss-120b"
_CHEAP_KEYS = ["qwen-qwq-32b-instruct", "llama-3.1-8b", _LLAMA_4_SCOUT]
_MID_KEYS = ["qwen-qwq-32b", "mixtral-8x7b", _GPT_OSS_120B]
_TOP_KEYS = ["llama-3.3-70b", _GPT_OSS_120B]
def model_pool_for_agent(agent_name: str) -> List[str]:
"""Resolved model keys allowed for routing for this agent."""
name = agent_name.strip() if agent_name else ""
if name == "Senior Dev":
return list(dict.fromkeys(_MID_KEYS + _TOP_KEYS))
return list(dict.fromkeys(_CHEAP_KEYS + _MID_KEYS + _TOP_KEYS))
def kpi_weights_for_agent(agent_name: str) -> Dict[str, float]:
return dict(KPI_WEIGHTS.get(agent_name, KPI_WEIGHTS["Pathfinder"]))