fix: update free AI models to confirmed-working OpenRouter models

Previous models (llama-3.1-8b, gemma-3-4b, mistral-7b) returned 404 unavailable.
Tested and confirmed working: openai/gpt-oss-20b:free and google/gemma-4-31b-it:free.
Keep llama-3.3-70b as quality option when not rate-limited.

Co-authored-by: shakespeare.diy <assistant@shakespeare.diy>
This commit is contained in:
shakespeare.diy 2026-06-17 12:20:28 +07:00
parent cb7714d875
commit c672066c2c

View file

@ -24,10 +24,9 @@ const FREE_MODEL = 'meta-llama/llama-3.3-70b-instruct:free';
// Try multiple free models in order — if one is rate-limited, fall back to the next
const FREE_MODELS = [
'meta-llama/llama-3.3-70b-instruct:free',
'meta-llama/llama-3.1-8b-instruct:free',
'google/gemma-3-4b-it:free',
'mistralai/mistral-7b-instruct:free',
'openai/gpt-oss-20b:free', // Fast, reliable
'google/gemma-4-31b-it:free', // Good fallback
'meta-llama/llama-3.3-70b-instruct:free', // Best quality, sometimes rate-limited
];
async function callAI(messages: Array<{ role: 'user' | 'assistant'; content: string }>): Promise<string> {