Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(llm): move the free chain off the retired OpenRouter model id

nirholas79251efea1fa
diff --git a/docs/free-llm-providers.md b/docs/free-llm-providers.md
index 2947d80ec..7957deef3 100644
--- a/docs/free-llm-providers.md
+++ b/docs/free-llm-providers.md
@@ -10,9 +10,10 @@ Free rungs run first, 70B-class models before smaller ones. A keyed rung is skip
| # | Rung | Model | Key | Free tier |
|---|------|-------|-----|-----------|
-| 1 | Groq | `qwen/qwen3.8-27b` | `GROQ_API_KEY` | Per-minute and per-day caps, no card. Llama 3.x left Groq's catalog in August 2026; Qwen 3.8 27B is the fastest non-reasoning model left there. [console.groq.com](https://console.groq.com) |
+| 1 | Groq | `qwen/qwen3.8-27b` | `GROQ_API_KEY` | Per-minute and per-day caps, no card. Llama 3.x left Groq's catalog in August 2026; Qwen 3.8 27B is the fastest non-reasoning model left there. Groq meters tokens PER MODEL ID at 8,000 tokens/minute, so the ceiling is small and the fix is more model ids, not a bigger plan. [console.groq.com](https://console.groq.com) |
+| 1b | Groq | `openai/gpt-oss-120b` | `GROQ_API_KEY` | Same key, a second independent 8,000 tok/min bucket. Added 2026-09-04 to widen the burst Groq absorbs before the chain leaves it. Do not reach for `groq/compound-mini` instead: it advertises 70,000 tok/min but routes internally to `llama-3.3-70b-versatile`, whose 100,000 tokens/DAY org cap makes it 429 while its own headers still read nearly full. |
| 2 | Cerebras | `llama-3.3-70b` | `CEREBRAS_API_KEY` | About 1M tokens/day. [cloud.cerebras.ai](https://cloud.cerebras.ai) |
-| 3 | OpenRouter | `openai/gpt-oss-20b:free` | `OPENROUTER_API_KEY` (+ fallback keys) | `:free` models only; the platform key is never billed. [openrouter.ai](https://openrouter.ai) |
+| 3 | OpenRouter | `google/gemma-4-31b-it:free` | `OPENROUTER_API_KEY` (+ fallback keys) | `:free` models only; the platform key is never billed. OpenRouter retires `:free` slugs with no notice and a retired id 404s every rung built off it, so `/api/cron/free-model-audit` diffs the hardcoded ids against the live list every 6 hours. The extra keys widen nothing on their own when they belong to one account: the free-model cap (1,000 requests/day) is per ACCOUNT, not per key. [openrouter.ai](https://openrouter.ai) |
| 4 | NVIDIA NIM | `nvidia/nemotron-3-super-120b-a12b` | `NVIDIA_API_KEY` | Free developer tier, about 40 req/min. `meta/llama-3.x` on NIM reached end of life on 2026-08-26 (HTTP 410); Nemotron 3 is a reasoning family, so the rung sends `enable_thinking: false` to keep the answer in `content`. [build.nvidia.com](https://build.nvidia.com) |
| 5 | SambaNova | `Meta-Llama-3.3-70B-Instruct` | `SAMBANOVA_API_KEY` | About 20 req/min, 200K tokens/day per model, no card. [cloud.sambanova.ai](https://cloud.sambanova.ai) |
| 6 | Mistral | `mistral-small-latest` | `MISTRAL_API_KEY` | Experiment tier: about 1B tokens/month at 1 req/sec (account opts into data training). [console.mistral.ai](https://console.mistral.ai) |
diff --git a/docs/ops/llm-lanes.md b/docs/ops/llm-lanes.md
index 69279b4a0..e8b0550ca 100644
--- a/docs/ops/llm-lanes.md
+++ b/docs/ops/llm-lanes.md
@@ -19,21 +19,22 @@ production are routinely dead and a chain that depends on them fails:
| # | Rung | Key | Cost to us | State |
|---|---|---|---|---|
-| 1 | Groq `llama-3.3-70b-versatile` | `GROQ_API_KEY` | free | **serving** (200, ~1.0s, 2026-08-02) |
+| 1 | Groq `qwen/qwen3.8-27b` | `GROQ_API_KEY` | free | **serving** (200, ~0.4s, 2026-09-04). Capped at 8,000 tokens/MINUTE, which is ~3 fact-check stance calls: a burst falls past it while it is perfectly healthy. |
+| 1b | Groq `openai/gpt-oss-120b` | `GROQ_API_KEY` | free | **serving** (200, ~1.4s, 2026-09-04). Added 2026-09-04. Same key, separate 8,000 tok/min bucket, because Groq meters per model id. |
| 2 | Cerebras `llama-3.3-70b` | `CEREBRAS_API_KEY` | free | not configured in prod |
-| 3 | OpenRouter `:free` routes, one rung per key | `OPENROUTER_API_KEY`, `OPENROUTER_FALLBACK_KEYS` | free | **serving** on the fallback keys (2026-08-02) |
-| 4 | NVIDIA NIM `meta/llama-3.3-70b-instruct` | `NVIDIA_API_KEY` | free | 429 (rate limited at probe time, 2026-08-02) |
+| 3 | OpenRouter `:free` routes, one rung per key | `OPENROUTER_API_KEY`, `OPENROUTER_FALLBACK_KEYS` | free | **model id was dead 2026-09-04**: `openai/gpt-oss-20b:free` was retired and 404'd all five rungs at once (fixed, now `google/gemma-4-31b-it:free`). The account is separately capped at 1,000 free-model requests/DAY across every key (they share one owner), and was at 0 remaining when measured. |
+| 4 | NVIDIA NIM `nvidia/nemotron-3-super-120b-a12b` | `NVIDIA_API_KEY` | free | **serving** (200, 1.8s-10.5s on a full-size prompt, 2026-09-04). Carried the whole platform on 2026-09-04 when Groq was token-capped, OpenRouter was dead, and both paid anchors were on billing holds. |
| 5 | SambaNova `Meta-Llama-3.3-70B-Instruct` | `SAMBANOVA_API_KEY` | free | added 2026-08-05; skipped when the key is unset |
| 6 | Mistral `mistral-small-latest` (Experiment tier) | `MISTRAL_API_KEY` | free | added 2026-08-05; skipped when the key is unset |
| 7 | Z.AI `glm-4.7-flash` | `ZAI_API_KEY` | free | added 2026-08-05; skipped when the key is unset |
| 8 | Cloudflare Workers AI `@cf/meta/llama-3.3-70b-instruct-fp8-fast` | `CLOUDFLARE_ACCOUNT_ID` + `CLOUDFLARE_AI_API_TOKEN` | free | added 2026-08-05; skipped when either is unset |
| 9 | OVH AI Endpoints `Meta-Llama-3_3-70B-Instruct` | none (keyless) | free | **serving** (200, ~1.2s, 2026-08-02) |
| 10 | Gemini Flash-Lite (AI Studio) | `GEMINI_API_KEY` | free | not configured in prod |
-| 11 | **Vertex Gemini Flash** | GCP service account | GCP credits | **serving**, the reliability anchor |
+| 11 | **Vertex Gemini Flash** | GCP service account | GCP credits | **dead**: 403 `Lightning dunning decision is deny for project` since 2026-08-27, re-measured 2026-09-04. A billing hold on the whole GCP project, not IAM. This is the chain's designed anchor, so while it is down the free rungs above it are load-bearing rather than best-effort. |
| 12 | Pollinations `openai-fast` | none (keyless) | free | **serving** (200, ~3.7s, 2026-08-02) |
| 13 | LLM7.io `gemini-3.1-flash-lite` | `LLM7_API_KEY` | free | **dead without a key**: llm7.io retired the anonymous tier it was added on, and every unauthenticated call answers 401 `invalid_api_key` (measured 2026-09-02, the `unused` token its docs used to accept included). Key-gated since, so a deployment without the key skips it. Free key at https://dash.llm7.io/#/api-keys |
| 14 | SiliconFlow `Qwen/Qwen3-8B` | `SILICONFLOW_API_KEY` | free | added 2026-08-05; skipped when the key is unset |
-| 15 | Groq `llama-3.1-8b-instant` | `GROQ_API_KEY` | free | serving (separate per-model quota) |
+| 15 | Groq `openai/gpt-oss-20b` | `GROQ_API_KEY` | free | serving (a third separate per-model quota) |
| 16 | Vertex Claude | GCP service account + `VERTEX_CLAUDE_ENABLED=1` | GCP credits | **off and unentitled** (see below) |
| 17 | Anthropic first-party | `ANTHROPIC_API_KEY` | paid | **absent** (no key anywhere) |
| 18 | OpenRouter Claude mirror | `OPENROUTER_CLAUDE_MIRROR_MODEL` | paid | off by default (see below) |
diff --git a/tests/api/brain-spend-attribution.test.js b/tests/api/brain-spend-attribution.test.js
index 777b0e091..eab1e5495 100644
--- a/tests/api/brain-spend-attribution.test.js
+++ b/tests/api/brain-spend-attribution.test.js
@@ -59,7 +59,7 @@ describe('a /brain turn on a paid mirror is priced, not zeroed', () => {
});
it('still prices the free default route at zero', () => {
- expect(costMicroUsd({ provider: 'openrouter', model: 'openai/gpt-oss-20b:free', input: 2_000, output: 800 })).toBe(0);
+ expect(costMicroUsd({ provider: 'openrouter', model: 'google/gemma-4-31b-it:free', input: 2_000, output: 800 })).toBe(0);
});
it('prices the credits-funded Vertex Gemini anchor rather than treating it as free', () => {
diff --git a/tests/api/chat-config-upsert.test.js b/tests/api/chat-config-upsert.test.js
index eefec3a19..9aec9d349 100644
--- a/tests/api/chat-config-upsert.test.js
+++ b/tests/api/chat-config-upsert.test.js
@@ -59,8 +59,8 @@ vi.mock('../../api/_lib/env.js', () => ({
}));
vi.mock('../../api/_lib/openrouter-free.js', () => ({
- isLiveFreeModel: async (id) => id === 'openai/gpt-oss-20b:free',
- pickDefaultFreeModel: async () => 'openai/gpt-oss-20b:free',
+ isLiveFreeModel: async (id) => id === 'google/gemma-4-31b-it:free',
+ pickDefaultFreeModel: async () => 'google/gemma-4-31b-it:free',
}));
vi.mock('../../api/_lib/sentry.js', () => ({ captureException: vi.fn() }));
@@ -118,7 +118,7 @@ const VALID = {
name: 'three.ws chat',
accent_color: '#6366f1',
tagline: 'Chat with any AI model',
- default_model: 'openai/gpt-oss-20b:free',
+ default_model: 'google/gemma-4-31b-it:free',
};
beforeEach(() => {
@@ -130,7 +130,7 @@ beforeEach(() => {
logo_url: null,
accent_color: '#000000',
tagline: 'seeded tagline',
- default_model: 'openai/gpt-oss-20b:free',
+ default_model: 'google/gemma-4-31b-it:free',
agent_id: null,
system_prompt: 'seeded prompt',
admin_key: ADMIN_KEY,
@@ -219,6 +219,6 @@ describe('GET /api/chat/config', () => {
store.default_model = 'google/gemini-2.0-flash-exp:free';
const res = makeRes();
await handler(makeReq({ method: 'GET' }), res);
- expect(JSON.parse(res.body).data.default_model).toBe('openai/gpt-oss-20b:free');
+ expect(JSON.parse(res.body).data.default_model).toBe('google/gemma-4-31b-it:free');
});
});
diff --git a/tests/api/chat-models-cache.test.js b/tests/api/chat-models-cache.test.js
index fb3f306a9..0e45f1be0 100644
--- a/tests/api/chat-models-cache.test.js
+++ b/tests/api/chat-models-cache.test.js
@@ -12,7 +12,7 @@ import { describe, it, expect, beforeEach, vi } from 'vitest';
// reference on purpose, exactly like the real one, so a mutating handler shows
// up here as a changed array.
const cachedModels = [
- { id: 'openai/gpt-oss-20b:free', name: 'gpt-oss-20b (free)' },
+ { id: 'google/gemma-4-31b-it:free', name: 'gpt-oss-20b (free)' },
{ id: 'google/gemma-4-31b-it:free', name: 'Gemma 4 31B (free)' },
];
@@ -69,7 +69,7 @@ async function get() {
beforeEach(() => {
cachedModels.length = 0;
cachedModels.push(
- { id: 'openai/gpt-oss-20b:free', name: 'gpt-oss-20b (free)' },
+ { id: 'google/gemma-4-31b-it:free', name: 'gpt-oss-20b (free)' },
{ id: 'google/gemma-4-31b-it:free', name: 'Gemma 4 31B (free)' },
);
});
@@ -80,7 +80,7 @@ describe('GET /api/chat/models', () => {
expect(res.statusCode).toBe(200);
expect(data.filter((m) => m.id === 'three-ws/agent')).toHaveLength(1);
expect(data.map((m) => m.id)).toEqual([
- 'openai/gpt-oss-20b:free',
+ 'google/gemma-4-31b-it:free',
'google/gemma-4-31b-it:free',
'three-ws/agent',
]);
@@ -88,7 +88,7 @@ describe('GET /api/chat/models', () => {
it('never becomes the default: the agent entry is last, never first', async () => {
const { data } = await get();
- expect(data[0].id).toBe('openai/gpt-oss-20b:free');
+ expect(data[0].id).toBe('google/gemma-4-31b-it:free');
expect(data.at(-1).id).toBe('three-ws/agent');
});
@@ -98,7 +98,7 @@ describe('GET /api/chat/models', () => {
await get();
// The cache still holds only the two real free models it started with.
expect(cachedModels.map((m) => m.id)).toEqual([
- 'openai/gpt-oss-20b:free',
+ 'google/gemma-4-31b-it:free',
'google/gemma-4-31b-it:free',
]);
});
diff --git a/tests/api/chat-proxy-retry-after.test.js b/tests/api/chat-proxy-retry-after.test.js
index e363c81eb..a48522e42 100644
--- a/tests/api/chat-proxy-retry-after.test.js
+++ b/tests/api/chat-proxy-retry-after.test.js
@@ -97,7 +97,7 @@ function quotaCapped(resetEpochMs, { retryAfterHeader = null } = {}) {
async function send(upstream) {
fetchMock.mockResolvedValue(upstream);
const res = makeRes();
- await handler(makeReq({ model: 'openai/gpt-oss-20b:free', messages: [] }), res);
+ await handler(makeReq({ model: 'google/gemma-4-31b-it:free', messages: [] }), res);
return res;
}
diff --git a/tests/api/llm-anthropic.test.js b/tests/api/llm-anthropic.test.js
index 106c7e8b5..3fc4d91be 100644
--- a/tests/api/llm-anthropic.test.js
+++ b/tests/api/llm-anthropic.test.js
@@ -253,7 +253,7 @@ const DEFAULT_POLICY = {
proxy_url: null,
monthly_quota: 1000,
rate_limit_per_min: 10,
- model: 'openai/gpt-oss-20b:free',
+ model: 'google/gemma-4-31b-it:free',
},
storage: { primary: 'r2', pinned_ipfs: false, onchain_attested: false },
};
@@ -531,24 +531,24 @@ describe('/api/llm/anthropic: paid-model clamp', () => {
});
it('caller-supplied free model overrides the policy default', async () => {
- policyState.policy.brain.model = 'openai/gpt-oss-20b:free';
+ policyState.policy.brain.model = 'google/gemma-4-31b-it:free';
await invoke({ body: { ...VALID_BODY, model: 'llama-3.3-70b-versatile' } });
const sentBody = JSON.parse(fetchState.calls[0].init.body);
expect(sentBody.model).toBe('llama-3.3-70b-versatile');
});
it('clamps a caller-requested paid model back to the policy model', async () => {
- policyState.policy.brain.model = 'openai/gpt-oss-20b:free';
+ policyState.policy.brain.model = 'google/gemma-4-31b-it:free';
await invoke({ body: { ...VALID_BODY, model: 'claude-opus-5' } });
const sentBody = JSON.parse(fetchState.calls[0].init.body);
- expect(sentBody.model).toBe('openai/gpt-oss-20b:free');
+ expect(sentBody.model).toBe('google/gemma-4-31b-it:free');
});
it('clamps a paid model on the free default policy too', async () => {
delete policyState.policy.brain.model;
await invoke({ body: { ...VALID_BODY, model: 'grok-4.5' } });
const sentBody = JSON.parse(fetchState.calls[0].init.body);
- expect(sentBody.model).toBe('openai/gpt-oss-20b:free');
+ expect(sentBody.model).toBe('google/gemma-4-31b-it:free');
});
});
@@ -642,7 +642,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
body: {
...VALID_BODY,
system: SYSTEM,
- model: 'openai/gpt-oss-20b:free',
+ model: 'google/gemma-4-31b-it:free',
},
});
const call = fetchState.calls[0];
@@ -665,7 +665,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
// it walks the chain and serves from the next configured lane.
delete process.env.OPENROUTER_API_KEY;
const { status } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(status).toBe(200);
// Every attempted call skipped the unkeyed OpenRouter lane.
@@ -690,7 +690,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
});
};
const { status } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(status).toBe(200);
expect(fetchState.calls.length).toBeGreaterThan(1);
@@ -704,7 +704,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
delete process.env.ANTHROPIC_API_KEY;
try {
const { status, body } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(status).toBe(503);
expect(body.error).toBe('provider_unavailable');
@@ -725,7 +725,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
process.env.GOOGLE_CLOUD_PROJECT = 'test-project';
try {
const { status, body } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(status).toBe(200);
const call = fetchState.calls[0];
@@ -746,7 +746,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
await invoke({
body: {
system: SYSTEM,
- model: 'openai/gpt-oss-20b:free',
+ model: 'google/gemma-4-31b-it:free',
max_tokens: 256,
temperature: 0.4,
messages: [
@@ -784,7 +784,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
},
});
const sent = JSON.parse(fetchState.calls[0].init.body);
- expect(sent.model).toBe('openai/gpt-oss-20b:free');
+ expect(sent.model).toBe('google/gemma-4-31b-it:free');
expect(sent.max_tokens).toBe(256);
expect(sent.temperature).toBe(0.4);
// System collapses into the first message.
@@ -862,7 +862,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
usage: { prompt_tokens: 4, completion_tokens: 5 },
});
const { body } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(body.content).toEqual([
{ type: 'tool_use', id: 'call_1', name: 'getTime', input: { tz: 'UTC' } },
@@ -872,7 +872,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
it('debits OpenAI-shape token usage (prompt + completion) onto the agent', async () => {
await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
const monthKey = new Date().toISOString().slice(0, 7);
expect(redisStore.get(`llm:tokens:agent-1:${monthKey}`)).toBe(16);
@@ -880,7 +880,7 @@ describe('/api/llm/anthropic — free-provider routing', () => {
it('records usage with the upstream provider tag', async () => {
await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' },
});
expect(usageEvents[0]).toMatchObject({
kind: 'llm',
@@ -902,7 +902,7 @@ describe('/api/llm/anthropic: fallback chain integrity', () => {
process.env.GROQ_API_KEY = 'gsk-test';
process.env.NVIDIA_API_KEY = 'nv-test';
process.env.SAMBANOVA_API_KEY = 'sn-test';
- const chain = modelFallbackChain('openai/gpt-oss-20b:free');
+ const chain = modelFallbackChain('google/gemma-4-31b-it:free');
expect(chain.length).toBeGreaterThan(1);
for (const rung of chain) {
expect(resolveModelRoute(rung), `rung "${rung}" is not routable`).toBeTruthy();
@@ -910,7 +910,7 @@ describe('/api/llm/anthropic: fallback chain integrity', () => {
});
it('keeps the paid Anthropic rung last among the keyed lanes', () => {
- const chain = modelFallbackChain('openai/gpt-oss-20b:free');
+ const chain = modelFallbackChain('google/gemma-4-31b-it:free');
expect(chain[chain.length - 1]).toBe('claude-haiku-4-5-20251001');
});
});
@@ -947,14 +947,14 @@ describe('/api/llm/anthropic: streaming, OpenAI-shape lanes', () => {
it('asks OpenAI-compatible providers for streaming usage', async () => {
fetchState.response = () => upstreamSse(['data: [DONE]\n\n']);
- await invoke({ body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free', stream: true } });
+ await invoke({ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free', stream: true } });
const sent = JSON.parse(fetchState.calls[0].init.body);
expect(sent.stream).toBe(true);
expect(sent.stream_options).toEqual({ include_usage: true });
});
it('does not send stream_options on a non-streaming request', async () => {
- await invoke({ body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free' } });
+ await invoke({ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free' } });
const sent = JSON.parse(fetchState.calls[0].init.body);
expect(sent.stream_options).toBeUndefined();
});
@@ -969,7 +969,7 @@ describe('/api/llm/anthropic: streaming, OpenAI-shape lanes', () => {
'data: [DONE]\n\n',
]);
const { res } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free', stream: true },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free', stream: true },
});
expect(res.headers['content-type']).toBe('text/event-stream');
expect(res.headers['x-llm-transport']).toBe('openrouter');
@@ -1004,7 +1004,7 @@ describe('/api/llm/anthropic: streaming, OpenAI-shape lanes', () => {
'data: [DONE]\n\n',
]);
const { res } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free', stream: true },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free', stream: true },
});
expect(res.body).toContain('"type":"tool_use","id":"call_1","name":"getTime"');
expect(res.body).toContain('"input_json_delta","partial_json":"{\\"tz\\":"');
@@ -1023,7 +1023,7 @@ describe('/api/llm/anthropic: streaming, OpenAI-shape lanes', () => {
'data: [DONE]\n\n',
]);
const { res } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free', stream: true },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free', stream: true },
});
expect(res.body).toContain('"name":"getTime"');
expect(res.body).not.toContain('"name":"get"');
@@ -1038,7 +1038,7 @@ describe('/api/llm/anthropic: streaming, OpenAI-shape lanes', () => {
'data: [DONE]\n\n',
]);
const { res } = await invoke({
- body: { ...VALID_BODY, model: 'openai/gpt-oss-20b:free', stream: true },
+ body: { ...VALID_BODY, model: 'google/gemma-4-31b-it:free', stream: true },
});
expect(res.body).toContain('"type":"tool_use"');
expect(res.body).toContain('"name":"getTime"');
diff --git a/tests/api/llm-free-chain-reachability.test.js b/tests/api/llm-free-chain-reachability.test.js
index 0389949b4..7279702e7 100644
--- a/tests/api/llm-free-chain-reachability.test.js
+++ b/tests/api/llm-free-chain-reachability.test.js
@@ -166,8 +166,14 @@ describe('free chain: every rung is reachable through a transport-level failure'
expect(idx, `unexpected fetch: ${u} (${requested})`).toBeGreaterThanOrEqual(0);
tried.push(FREE_CHAIN[idx].provider);
// A rung above the target dies at the transport level. Alternate the
- // two shapes so both a dropped socket and an abort are covered.
- if (idx < i) throw transportFailure(idx % 2 === 0 ? 'reset' : 'abort');
+ // two shapes so both a dropped socket and an abort are covered, but
+ // never abort a rung that SHARES the target's host. llmComplete treats
+ // an abort as a host stall and then skips every later rung on that
+ // host, which is deliberate (three Groq rungs must not each burn the
+ // budget while api.groq.com is hanging) and would make this case
+ // measure the stall guard instead of chain reachability.
+ const sameHost = FREE_CHAIN[idx].host === rung.host;
+ if (idx < i) throw transportFailure(!sameHost && idx % 2 === 1 ? 'abort' : 'reset');
return okOpenAiShape(`served by ${FREE_CHAIN[idx].provider}`, rung.model);
});
diff --git a/tests/api/llm-vertex-anchor-surfaces.test.js b/tests/api/llm-vertex-anchor-surfaces.test.js
index a0b53c522..d3534ffa6 100644
--- a/tests/api/llm-vertex-anchor-surfaces.test.js
+++ b/tests/api/llm-vertex-anchor-surfaces.test.js
@@ -250,7 +250,7 @@ describe('anthropic-proxy (api/llm/anthropic.js): model fallback anchor', () =>
it('appends the anchor model as the final fallback when a GCP project is set', () => {
process.env.GOOGLE_CLOUD_PROJECT = 'test-project';
setAllProviderKeys();
- const chain = modelFallbackChain('openai/gpt-oss-20b:free');
+ const chain = modelFallbackChain('google/gemma-4-31b-it:free');
expect(chain[chain.length - 1]).toBe('google/gemini-2.5-flash');
// Paid Anthropic stays ahead of it; the anchor is strictly last resort.
expect(chain.indexOf('claude-haiku-4-5-20251001')).toBeLessThan(
@@ -272,7 +272,7 @@ describe('anthropic-proxy (api/llm/anthropic.js): model fallback anchor', () =>
});
it('without a GCP project the anchor neither resolves nor joins the chain', () => {
- const chain = modelFallbackChain('openai/gpt-oss-20b:free');
+ const chain = modelFallbackChain('google/gemma-4-31b-it:free');
expect(chain).not.toContain('google/gemini-2.5-flash');
expect(resolveModelRoute('google/gemini-2.5-flash')).toBeNull();
});
diff --git a/tests/api/llm.test.js b/tests/api/llm.test.js
index 69b10d1ee..43eae0985 100644
--- a/tests/api/llm.test.js
+++ b/tests/api/llm.test.js
@@ -107,7 +107,9 @@ describe('llmComplete — free platform providers', () => {
const out = await llm.llmComplete({ system: 's', user: 'u' });
expect(out.provider).toBe('openrouter');
expect(out.text).toBe('from openrouter');
- expect(calls.map((c) => c.url.includes(GROQ_HOST) ? 'groq' : 'or')).toEqual(['groq', 'or']);
+ // Groq contributes TWO rungs (per-model token buckets: qwen3.8-27b, then
+ // gpt-oss-120b), so a host-level 500 costs two attempts before OpenRouter.
+ expect(calls.map((c) => c.url.includes(GROQ_HOST) ? 'groq' : 'or')).toEqual(['groq', 'groq', 'or']);
});
it('falls back to NVIDIA NIM when Groq and OpenRouter both fail', async () => {
@@ -198,8 +200,8 @@ describe('llmComplete — multiple OpenRouter keys', () => {
// model). The primary key's :free rung 402s here, so the chain rotates to the
// fallback key's :free model.
expect(calls).toEqual([
- { auth: 'Bearer or-primary', model: 'openai/gpt-oss-20b:free' },
- { auth: 'Bearer or-fallback', model: 'openai/gpt-oss-20b:free' },
+ { auth: 'Bearer or-primary', model: 'google/gemma-4-31b-it:free' },
+ { auth: 'Bearer or-fallback', model: 'google/gemma-4-31b-it:free' },
]);
});
@@ -590,7 +592,8 @@ describe('llmComplete — failure modes', () => {
const out = await llm.llmComplete({ system: 's', user: 'u' });
expect(out.provider).toBe('openrouter');
expect(out.text).toBe('openrouter rescues');
- expect(calls.map((c) => (c.url.includes(GROQ_HOST) ? 'groq' : 'or'))).toEqual(['groq', 'or']);
+ // Both Groq rungs serve the HTML error page before OpenRouter rescues.
+ expect(calls.map((c) => (c.url.includes(GROQ_HOST) ? 'groq' : 'or'))).toEqual(['groq', 'groq', 'or']);
});
it('surfaces upstream_bad_body as the last error when every provider returns an unparseable 200', async () => {
@@ -624,7 +627,8 @@ describe('llmComplete — failure modes', () => {
const out = await llm.llmComplete({ system: 's', user: 'u' });
expect(out.provider).toBe('openrouter');
expect(out.text).toBe('a real answer');
- expect(calls.map((c) => (c.url.includes(GROQ_HOST) ? 'groq' : 'or'))).toEqual(['groq', 'or']);
+ // Both Groq rungs return the empty completion before OpenRouter serves.
+ expect(calls.map((c) => (c.url.includes(GROQ_HOST) ? 'groq' : 'or'))).toEqual(['groq', 'groq', 'or']);
});
// When EVERY provider only yields empty text, returning that empty-but-valid
diff --git a/tests/api/openrouter-free-models.test.js b/tests/api/openrouter-free-models.test.js
index cee071078..285475b84 100644
--- a/tests/api/openrouter-free-models.test.js
+++ b/tests/api/openrouter-free-models.test.js
@@ -23,7 +23,7 @@ const LIVE = {
{ id: 'paid/model', context_length: 999999, supported_parameters: ['tools'] },
{ id: 'zz/no-tools:free', context_length: 900000, supported_parameters: [] },
{ id: 'google/gemma-4-31b-it:free', context_length: 262144, supported_parameters: ['tools'] },
- { id: 'openai/gpt-oss-20b:free', context_length: 131072, supported_parameters: ['tools'] },
+ { id: 'google/gemma-4-31b-it:free', context_length: 131072, supported_parameters: ['tools'] },
],
};
@@ -47,7 +47,7 @@ afterEach(() => {
describe('isFreeModelId', () => {
it('accepts only :free ids', () => {
- expect(isFreeModelId('openai/gpt-oss-20b:free')).toBe(true);
+ expect(isFreeModelId('google/gemma-4-31b-it:free')).toBe(true);
expect(isFreeModelId('openai/gpt-oss-120b')).toBe(false);
expect(isFreeModelId(null)).toBe(false);
expect(isFreeModelId(undefined)).toBe(false);
@@ -63,10 +63,10 @@ describe('rankFreeModels', () => {
it('prefers the gpt-oss family, then gemma, among tool-capable models', () => {
const ranked = rankFreeModels([
{ id: 'google/gemma-4-31b-it:free', context_length: 262144, supported_parameters: ['tools'] },
- { id: 'openai/gpt-oss-20b:free', context_length: 131072, supported_parameters: ['tools'] },
+ { id: 'google/gemma-4-31b-it:free', context_length: 131072, supported_parameters: ['tools'] },
]);
expect(ranked.map((m) => m.id)).toEqual([
- 'openai/gpt-oss-20b:free',
+ 'google/gemma-4-31b-it:free',
'google/gemma-4-31b-it:free',
]);
});
@@ -133,7 +133,7 @@ describe('isLiveFreeModel', () => {
it('accepts an id OpenRouter is serving', async () => {
vi.stubGlobal('fetch', mockFetch(LIVE));
- expect(await isLiveFreeModel('openai/gpt-oss-20b:free')).toBe(true);
+ expect(await isLiveFreeModel('google/gemma-4-31b-it:free')).toBe(true);
});
it('does not declare a model dead during our own outage', async () => {
@@ -150,12 +150,12 @@ describe('isLiveFreeModel', () => {
describe('pickDefaultFreeModel', () => {
it('returns the best-ranked live model', async () => {
vi.stubGlobal('fetch', mockFetch(LIVE));
- expect(await pickDefaultFreeModel()).toBe('openai/gpt-oss-20b:free');
+ expect(await pickDefaultFreeModel()).toBe('google/gemma-4-31b-it:free');
});
it('skips excluded ids so a failed model is not retried', async () => {
vi.stubGlobal('fetch', mockFetch(LIVE));
- expect(await pickDefaultFreeModel({ exclude: ['openai/gpt-oss-20b:free'] })).toBe(
+ expect(await pickDefaultFreeModel({ exclude: ['google/gemma-4-31b-it:free'] })).toBe(
'google/gemma-4-31b-it:free',
);
});
diff --git a/tests/cron-seed-username-claim.test.js b/tests/cron-seed-username-claim.test.js
index b739912a9..432e2b0c4 100644
--- a/tests/cron-seed-username-claim.test.js
+++ b/tests/cron-seed-username-claim.test.js
@@ -51,8 +51,8 @@ test('candidates never repeat a name the caller reported as taken', () => {
// free-model-audit: the verdict that pages ops, and the one that must not.
test('a hardcoded id missing from the live list is reported dead', () => {
const result = diffFreeModels(
- ['openai/gpt-oss-20b:free', 'inclusionai/ling-3.0-flash:free'],
- ['openai/gpt-oss-20b:free', 'google/gemma-4-31b-it:free'],
+ ['google/gemma-4-31b-it:free', 'inclusionai/ling-3.0-flash:free'],
+ ['google/gemma-4-31b-it:free', 'meta-llama/llama-3.3-70b-instruct:free'],
);
expect(result.status).toBe('dead_rungs');
expect(result.dead).toEqual(['inclusionai/ling-3.0-flash:free']);
@@ -63,7 +63,7 @@ test('a hardcoded id missing from the live list is reported dead', () => {
// live list, and calling every model dead on our own outage would page ops with
// a false alarm and invite a pointless catalog rewrite.
test('an empty live list is unknown, never a dead verdict', () => {
- const result = diffFreeModels(['openai/gpt-oss-20b:free'], []);
+ const result = diffFreeModels(['google/gemma-4-31b-it:free'], []);
expect(result.status).toBe('unknown');
expect(result.dead).toEqual([]);
expect(result.checked).toBe(1);
diff --git a/tests/llm-metering-rule.test.js b/tests/llm-metering-rule.test.js
index db5d37f6a..309063942 100644
--- a/tests/llm-metering-rule.test.js
+++ b/tests/llm-metering-rule.test.js
@@ -55,8 +55,8 @@ describe('genuinely free lanes may report $0', () => {
for (const [provider, model] of [
['groq', 'llama-3.3-70b-versatile'],
['groq#instant', 'llama-3.1-8b-instant'],
- ['openrouter', 'openai/gpt-oss-20b:free'],
- ['openrouter#3', 'openai/gpt-oss-20b:free'],
+ ['openrouter', 'google/gemma-4-31b-it:free'],
+ ['openrouter#3', 'google/gemma-4-31b-it:free'],
['nvidia', 'meta/llama-3.3-70b-instruct'],
['ovh', 'Meta-Llama-3_3-70B-Instruct'],
['pollinations', 'openai-fast'],
diff --git a/tests/llm-pricing-granite.test.js b/tests/llm-pricing-granite.test.js
index 03de438a0..26e9275cc 100644
--- a/tests/llm-pricing-granite.test.js
+++ b/tests/llm-pricing-granite.test.js
@@ -27,7 +27,7 @@ describe('llm-pricing — paid Granite lane', () => {
describe('llm-pricing — free lanes stay zero', () => {
it('free OpenRouter models are still $0', () => {
- expect(costMicroUsd({ provider: 'openrouter', model: 'openai/gpt-oss-20b:free', input: M, output: M })).toBe(0);
+ expect(costMicroUsd({ provider: 'openrouter', model: 'google/gemma-4-31b-it:free', input: M, output: M })).toBe(0);
});
it('the free Gemini tier is still $0 (invariant not broken by the paid override)', () => {
diff --git a/tests/llm-pricing-openrouter.test.js b/tests/llm-pricing-openrouter.test.js
index 4d9cdc4a9..7ee6cd637 100644
--- a/tests/llm-pricing-openrouter.test.js
+++ b/tests/llm-pricing-openrouter.test.js
@@ -20,7 +20,7 @@ import {
describe('OpenRouter is free only on its :free routes', () => {
it('prices a :free model at 0 on every key rung', () => {
for (const provider of ['openrouter', 'openrouter#2', 'openrouter#3']) {
- expect(costMicroUsd({ provider, model: 'openai/gpt-oss-20b:free', input: 100_000, output: 50_000 })).toBe(0);
+ expect(costMicroUsd({ provider, model: 'google/gemma-4-31b-it:free', input: 100_000, output: 50_000 })).toBe(0);
}
});
@@ -52,11 +52,11 @@ describe('OpenRouter is free only on its :free routes', () => {
});
it('classifies lanes: :free is free, a mirror is not', () => {
- expect(isFreeLane('openrouter', 'openai/gpt-oss-20b:free')).toBe(true);
- expect(isFreeLane('openrouter#2', 'openai/gpt-oss-20b:free')).toBe(true);
+ expect(isFreeLane('openrouter', 'google/gemma-4-31b-it:free')).toBe(true);
+ expect(isFreeLane('openrouter#2', 'google/gemma-4-31b-it:free')).toBe(true);
expect(isFreeLane('openrouter', 'anthropic/claude-sonnet-5')).toBe(false);
expect(isFreeLane('openrouter', 'ibm-granite/granite-4.1-8b')).toBe(false);
- expect(isOpenRouterFreeModel('openai/gpt-oss-20b:free')).toBe(true);
+ expect(isOpenRouterFreeModel('google/gemma-4-31b-it:free')).toBe(true);
expect(isOpenRouterFreeModel('anthropic/claude-opus-5')).toBe(false);
expect(openRouterBaseId('anthropic/claude-opus-5')).toBe('claude-opus-5');
expect(openRouterBaseId('grok-4.5')).toBe('grok-4.5');
@@ -113,6 +113,6 @@ describe('a provider-reported cost outranks the table', () => {
});
it('a reported 0 on a free route is a real zero, not unknown', () => {
- expect(costMicroUsd({ provider: 'openrouter', model: 'openai/gpt-oss-20b:free', input: 10, output: 10, reportedCostUsd: 0 })).toBe(0);
+ expect(costMicroUsd({ provider: 'openrouter', model: 'google/gemma-4-31b-it:free', input: 10, output: 10, reportedCostUsd: 0 })).toBe(0);
});
});
diff --git a/tests/src/element-brain-config.test.js b/tests/src/element-brain-config.test.js
index 8d8f6d18e..d1d888415 100644
--- a/tests/src/element-brain-config.test.js
+++ b/tests/src/element-brain-config.test.js
@@ -66,7 +66,7 @@ globalThis.fetch = vi.fn(async () => ({
json: async () => ({}),
}));
-const FREE_MODEL = 'openai/gpt-oss-20b:free';
+const FREE_MODEL = 'google/gemma-4-31b-it:free';
beforeEach(async () => {
if (!customElements.get('agent-3d')) {
diff --git a/tests/vertex-claude.test.js b/tests/vertex-claude.test.js
index f4436432a..691916784 100644
--- a/tests/vertex-claude.test.js
+++ b/tests/vertex-claude.test.js
@@ -169,13 +169,13 @@ describe('providerChain ordering under the four flag combinations', () => {
// vertex-gemini reliability rung after the free lanes, plus groq#instant as
// the free-tier capability step-down — both precede the paid backstops.
it('off/off: no vertex-CLAUDE lane; free lanes → vertex-gemini → step-down → paid tail', () => {
- expect(names()).toEqual(['groq', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'anthropic']);
+ expect(names()).toEqual(['groq', 'groq#120b', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'anthropic']);
});
it('enabled/off: vertex claude is a paid backstop AHEAD of first-party anthropic, behind free lanes', () => {
process.env.VERTEX_CLAUDE_ENABLED = '1';
const n = names();
- expect(n).toEqual(['groq', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'vertex-anthropic', 'anthropic']);
+ expect(n).toEqual(['groq', 'groq#120b', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'vertex-anthropic', 'anthropic']);
expect(n.indexOf('groq')).toBeLessThan(n.indexOf('vertex-anthropic'));
expect(n.indexOf('vertex-anthropic')).toBeLessThan(n.indexOf('anthropic'));
});
@@ -192,7 +192,7 @@ describe('providerChain ordering under the four flag combinations', () => {
it('primary flag alone (enabled unset) adds no vertex-claude lane', () => {
process.env.VERTEX_CLAUDE_PRIMARY = '1';
- expect(names()).toEqual(['groq', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'anthropic']);
+ expect(names()).toEqual(['groq', 'groq#120b', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'anthropic']);
});
it('a caller BYOK key still leads even when vertex is primary', () => {
@@ -214,7 +214,7 @@ describe('providerChain free-tier resilience rungs', () => {
it('the OpenRouter host-key rung uses the :free model — never the paid tier', () => {
const chain = providerChain();
const or = chain.find((p) => p.name === 'openrouter');
- expect(or.model).toBe('openai/gpt-oss-20b:free');
+ expect(or.model).toBe('google/gemma-4-31b-it:free');
// The host key must never bill a paid OpenRouter model: no paid rung, and no
// separate openrouter:free rung (the single rung is already :free).
expect(chain.some((p) => p.model === 'meta-llama/llama-3.3-70b-instruct')).toBe(false);