| """ACO Configuration.""" |
| from dataclasses import dataclass, field |
| from typing import Dict, List, Optional |
| from enum import IntEnum |
|
|
| class ModelTier(IntEnum): |
| TINY_LOCAL = 1 |
| CHEAP_CLOUD = 2 |
| MEDIUM = 3 |
| FRONTIER = 4 |
| SPECIALIST = 5 |
|
|
| @dataclass |
| class ModelConfig: |
| tier: int |
| provider: str |
| model_id: str |
| cost_per_1k_input: float |
| cost_per_1k_output: float |
| max_context: int |
| supports_tools: bool = True |
| supports_vision: bool = False |
|
|
| @dataclass |
| class RoutingPolicy: |
| safety_threshold: float = 0.30 |
| downgrade_threshold: float = 0.90 |
| max_retries: int = 3 |
| max_cost_per_task: float = 5.0 |
| use_dynamic_difficulty: bool = True |
| use_ml_confirmation: bool = True |
|
|
| @dataclass |
| class ACOConfig: |
| routing_policy: RoutingPolicy = field(default_factory=RoutingPolicy) |
| models: Dict[int, ModelConfig] = field(default_factory=dict) |
| task_floors: Dict[str, int] = field(default_factory=lambda: { |
| "legal_regulated": 4, "long_horizon": 3, "research": 3, |
| "coding": 3, "unknown_ambiguous": 3, "quick_answer": 1, |
| "document_drafting": 2, "tool_heavy": 2, "retrieval_heavy": 2, |
| }) |
| tier_costs: Dict[int, float] = field(default_factory=lambda: { |
| 1: 0.05, 2: 0.15, 3: 0.75, 4: 1.0, 5: 1.5 |
| }) |
| tier_strengths: Dict[int, float] = field(default_factory=lambda: { |
| 1: 0.35, 2: 0.55, 3: 0.80, 4: 0.93, 5: 0.97 |
| }) |
| router_model_path: str = "router_models/router_bundle_v8.pkl" |
| enable_cache_aware: bool = True |
| enable_tool_gate: bool = True |
| enable_verifier_budgeter: bool = True |
| enable_doom_detector: bool = True |
| enable_meta_tools: bool = True |
| telemetry_file: str = "aco_traces.jsonl" |
|
|