feat(llm): full multi-tier S/A/B/C/D with routing + pricing

Estende ModelTier a 5 livelli (S/A/B/C/D) con routing automatico:
S/A/B via Anthropic SDK, C/D via OpenRouter (OpenAI SDK). Aggiunge
prezzi per tier S (Opus), A (Sonnet placeholder) e D (Llama). Refactor
LLMClient.complete con dispatch tramite tier_models map e helper
_call_anthropic / _call_openrouter. Settings esposte per tutti e 5
i modelli env-configurabili.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-10 09:18:57 +02:00
parent 7482600146
commit 33d8e275e7
10 changed files with 241 additions and 36 deletions
+4 -1
View File
@@ -26,8 +26,11 @@ class Settings(BaseSettings):
openrouter_api_key: SecretStr
anthropic_api_key: SecretStr | None = None
llm_model_tier_c: str = "qwen/qwen-2.5-72b-instruct"
llm_model_tier_s: str = "claude-opus-4-7"
llm_model_tier_a: str = "claude-sonnet-4-6"
llm_model_tier_b: str = "claude-sonnet-4-6"
llm_model_tier_c: str = "qwen/qwen-2.5-72b-instruct"
llm_model_tier_d: str = "meta-llama/llama-3.3-70b-instruct"
openrouter_base_url: str = "https://openrouter.ai/api/v1"
run_name: str = "phase1-spike-001"