diff --git a/ai/setup.py b/ai/setup.py index 19c8667..e30a0f6 100644 --- a/ai/setup.py +++ b/ai/setup.py @@ -34,7 +34,7 @@ def get_optimal_model(base_type="pro"): def get_default_models(): return { - "logic": {"model": "models/gemini-2.0-pro-exp", "reason": "Fallback: Gemini 2.0 Pro for complex reasoning and JSON adherence.", "estimated_cost": "$0.00/1M (Experimental)"}, + "logic": {"model": "models/gemini-2.0-flash", "reason": "Fallback: Gemini 2.0 Flash for cost-effective logic and JSON adherence.", "estimated_cost": "$0.10/1M"}, "writer": {"model": "models/gemini-2.0-flash", "reason": "Fallback: Gemini 2.0 Flash for fast, high-quality creative writing.", "estimated_cost": "$0.10/1M"}, "artist": {"model": "models/gemini-2.0-flash", "reason": "Fallback: Gemini 2.0 Flash for visual prompt design.", "estimated_cost": "$0.10/1M"}, "ranking": [] @@ -86,17 +86,18 @@ def select_best_models(force_refresh=False): - Gemini 1.5 Pro: ~$1.25 Input / $5.00 Output. (Legacy, expensive). CRITERIA: - - LOGIC: Needs complex reasoning, strict JSON adherence, plot consistency, and instruction following. - -> Prefer: Gemini 2.5 Pro > 2.0 Pro > 2.0 Flash > 1.5 Pro + - LOGIC: Needs JSON adherence, plot consistency, and instruction following. COST IS THE PRIORITY — use Flash unless no Flash 2.x exists. + -> Prefer: Gemini 2.5 Flash > 2.0 Flash > 1.5 Flash > 2.5 Pro > 2.0 Pro > 1.5 Pro - WRITER: Needs creativity, prose quality, long-form text generation, and speed. - -> Prefer: Gemini 2.5 Flash/Pro > 2.0 Flash > 1.5 Flash (balance quality/cost) + -> Prefer: Gemini 2.5 Flash > 2.0 Flash > 1.5 Flash (balance quality/cost; avoid Pro) - ARTIST: Needs rich visual description, prompt understanding for cover art design. -> Prefer: Gemini 2.0 Flash > 1.5 Flash (speed and visual understanding) CONSTRAINTS: + - Strongly prefer Flash over Pro for all roles — Pro models are expensive and only used selectively at runtime for critical rewrites. - Strongly prefer Gemini 2.x over 1.5 where available. - Avoid 'experimental' or 'preview' only if a stable 2.x version exists; otherwise experimental 2.x is fine. - - 'thinking' models are too slow/expensive for Writer/Artist roles. + - 'thinking' models are too slow/expensive for any role. - Provide a ranking of ALL available models from best to worst overall. OUTPUT_FORMAT (JSON only, no markdown):