File size: 1,707 Bytes
d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a f8a2d6d d807f4a | 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 | """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"
|