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.

test(llm): treat LLM7 as a key-gated rung now that its anonymous tier is retired

nirholasc6cd32ae6286
diff --git a/tests/api/llm-free-chain-reachability.test.js b/tests/api/llm-free-chain-reachability.test.js
index 92e1ff6cc..5a0467727 100644
--- a/tests/api/llm-free-chain-reachability.test.js
+++ b/tests/api/llm-free-chain-reachability.test.js
@@ -70,6 +70,7 @@ const ENV_KEYS = [
'CLOUDFLARE_ACCOUNT_ID',
'CLOUDFLARE_AI_API_TOKEN',
'SILICONFLOW_API_KEY',
+ 'LLM7_API_KEY',
'GEMINI_API_KEY',
'GOOGLE_CLOUD_PROJECT',
'GOOGLE_CLOUD_LOCATION_GEMINI',
@@ -97,6 +98,7 @@ function configureFreeLanes() {
process.env.CLOUDFLARE_ACCOUNT_ID = 'cf-acct';
process.env.CLOUDFLARE_AI_API_TOKEN = 'cf-token';
process.env.SILICONFLOW_API_KEY = 'sf';
+ process.env.LLM7_API_KEY = 'l7';
process.env.GEMINI_API_KEY = 'gem';
process.env.GOOGLE_CLOUD_PROJECT = 'test-project';
// The NIM lane's own cap is floored at 2s; keep it there so a transport
@@ -207,18 +209,36 @@ describe('free chain: every rung is reachable through a transport-level failure'
expect(out.text).toBe('keyless floor');
}, 20_000);
- // Third keyless rung: with nothing configured and BOTH OVH and Pollinations
- // dead at the transport level, LLM7 must still answer.
- it('serves from LLM7 when OVH and Pollinations both die and nothing is configured', async () => {
+ // LLM7 was the third keyless rung until llm7.io retired its anonymous tier
+ // (401 invalid_api_key on every unauthenticated call, measured 2026-09-02),
+ // so it is key-gated now: with nothing configured it must NOT be dialled,
+ // because the answer cannot arrive and the round trip is pure latency on a
+ // chain that has already exhausted itself.
+ it('does not dial LLM7 with nothing configured, and reports the two keyless rungs it did try', async () => {
+ globalThis.fetch = vi.fn(async (url) => {
+ const u = String(url);
+ if (u.includes(HOSTS.llm7)) throw new Error('llm7 must not be dialled without a key');
+ throw transportFailure('reset');
+ });
+ await expect(llm.llmComplete({ user: 'u', timeoutMs: 20_000 })).rejects.toThrow(/ovh|pollinations/);
+ const dialled = globalThis.fetch.mock.calls.map(([u]) => String(u));
+ expect(dialled.some((u) => u.includes(HOSTS.ovh))).toBe(true);
+ expect(dialled.some((u) => u.includes(HOSTS.pollinations))).toBe(true);
+ expect(dialled.some((u) => u.includes(HOSTS.llm7))).toBe(false);
+ }, 20_000);
+
+ // With the key present it is a normal rung again, behind the other two.
+ it('serves from LLM7 when OVH and Pollinations both die and the key is set', async () => {
+ process.env.LLM7_API_KEY = 'l7';
globalThis.fetch = vi.fn(async (url) => {
const u = String(url);
if (u.includes(HOSTS.ovh)) throw transportFailure('reset');
if (u.includes(HOSTS.pollinations)) throw transportFailure('abort');
- if (u.includes(HOSTS.llm7)) return okOpenAiShape('third keyless floor', 'gemini-3.1-flash-lite');
+ if (u.includes(HOSTS.llm7)) return okOpenAiShape('keyed step-down', 'gemini-3.1-flash-lite');
throw new Error(`unexpected fetch: ${u}`);
});
const out = await llm.llmComplete({ user: 'u', timeoutMs: 20_000 });
expect(out.provider).toBe('llm7');
- expect(out.text).toBe('third keyless floor');
+ expect(out.text).toBe('keyed step-down');
}, 20_000);
});
diff --git a/tests/api/llm.test.js b/tests/api/llm.test.js
index e4a02a2f8..c959e5d79 100644
--- a/tests/api/llm.test.js
+++ b/tests/api/llm.test.js
@@ -13,6 +13,7 @@ function clearKeys() {
delete process.env.OPENROUTER_API_KEY;
delete process.env.OPENROUTER_FALLBACK_KEYS;
delete process.env.NVIDIA_API_KEY;
+ delete process.env.LLM7_API_KEY;
delete process.env.ANTHROPIC_API_KEY;
delete process.env.OPENAI_API_KEY;
}
@@ -213,9 +214,11 @@ describe('llmComplete — multiple OpenRouter keys', () => {
await expect(llm.llmComplete({ system: 's', user: 'u' })).rejects.toMatchObject({ status: 502 });
// or-same is deduped to a single key (one :free rung), then or-extra's :free
// rung, two OpenRouter fetches (without dedup or-same would be tried again as
- // a fallback too). The chain then falls through the three unconditional
- // keyless lanes (OVH, Pollinations, LLM7) before giving up: five fetches total.
- expect(n).toBe(5);
+ // a fallback too). The chain then falls through the two unconditional keyless
+ // lanes (OVH, Pollinations) before giving up: four fetches total. LLM7 is not
+ // among them any more; llm7.io retired its anonymous tier, so that rung is
+ // gated on LLM7_API_KEY (see api/_lib/llm.js).
+ expect(n).toBe(4);
});
it('llmConfigured is true with only fallback keys set', () => {
diff --git a/tests/vertex-claude.test.js b/tests/vertex-claude.test.js
index 7a303b934..f4436432a 100644
--- a/tests/vertex-claude.test.js
+++ b/tests/vertex-claude.test.js
@@ -23,6 +23,7 @@ const TOUCHED = [
'OPENROUTER_API_KEY',
'OPENROUTER_FALLBACK_KEYS',
'NVIDIA_API_KEY',
+ 'LLM7_API_KEY',
'ANTHROPIC_API_KEY',
'OPENAI_API_KEY',
];
@@ -168,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', 'llm7', 'groq#instant', 'anthropic']);
+ expect(names()).toEqual(['groq', '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', 'llm7', 'groq#instant', 'vertex-anthropic', 'anthropic']);
+ expect(n).toEqual(['groq', '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'));
});
@@ -191,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', 'llm7', 'groq#instant', 'anthropic']);
+ expect(names()).toEqual(['groq', 'ovh', 'vertex-gemini', 'pollinations', 'groq#instant', 'anthropic']);
});
it('a caller BYOK key still leads even when vertex is primary', () => {