From 251351e43ec88dbfa5be3139e8a62368b9a84b0f Mon Sep 17 00:00:00 2001 From: nb213 Date: Tue, 14 Jul 2026 10:27:23 +0800 Subject: [PATCH] Add Atlas Cloud gateway preset --- src/setup/gateways.ts | 11 +++++++++++ test/gateways.test.ts | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/setup/gateways.ts b/src/setup/gateways.ts index cde03b7..d05a216 100644 --- a/src/setup/gateways.ts +++ b/src/setup/gateways.ts @@ -65,6 +65,17 @@ export const KNOWN_GATEWAYS: Record = { suggestedToolCalls: true, note: 'Very fast. Free tier has generous but real rate limits.', }, + atlascloud: { + name: 'atlascloud', + title: 'Atlas Cloud', + baseUrl: 'https://api.atlascloud.ai/v1', + apiKeyEnv: 'ATLASCLOUD_API_KEY', + keyHint: 'Get a key at https://www.atlascloud.ai/console/api-keys.', + suggestedModel: 'qwen/qwen3.5-flash', + suggestedContextWindow: 1000000, + suggestedToolCalls: true, + note: 'OpenAI-compatible LLM endpoint. Atlas Cloud media generation uses a separate API and is not configured by this LLM gateway.', + }, mistral: { name: 'mistral', title: 'Mistral', diff --git a/test/gateways.test.ts b/test/gateways.test.ts index c1f207a..4b64cd7 100644 --- a/test/gateways.test.ts +++ b/test/gateways.test.ts @@ -27,7 +27,7 @@ console.log('— normalizeBaseUrl (strip pasted endpoint paths) —'); console.log('— registry —'); { - check('has openrouter, gemini, groq', !!findGateway('openrouter') && !!findGateway('gemini') && !!findGateway('groq')); + check('has openrouter, gemini, groq, atlascloud', !!findGateway('openrouter') && !!findGateway('gemini') && !!findGateway('groq') && !!findGateway('atlascloud')); check('lookup is case-insensitive', findGateway('OpenRouter')?.name === 'openrouter'); check('unknown returns undefined', findGateway('nope') === undefined); check('lists several gateways', listGatewayIds().length >= 8); @@ -38,6 +38,8 @@ console.log('— registry —'); if (!g.name || !g.baseUrl || !g.apiKeyEnv || !/^https?:\/\//.test(g.baseUrl)) allValid = false; } check('every gateway has name/baseUrl/apiKeyEnv with valid URL', allValid); + check('atlascloud uses the Atlas OpenAI-compatible LLM endpoint', findGateway('atlascloud')?.baseUrl === 'https://api.atlascloud.ai/v1'); + check('atlascloud uses ATLASCLOUD_API_KEY', findGateway('atlascloud')?.apiKeyEnv === 'ATLASCLOUD_API_KEY'); } console.log('— buildCustomEntry —'); @@ -47,6 +49,10 @@ console.log('— buildCustomEntry —'); check('pins suggested model', !!e.models && e.models[0].id.includes('llama')); check('model has tool calls on', e.models![0].supportsToolCalls === true); + const atlas = buildCustomEntry({ spec: findGateway('atlascloud')! }); + check('builds Atlas Cloud from spec', atlas.name === 'atlascloud' && atlas.baseUrl === 'https://api.atlascloud.ai/v1'); + check('pins Atlas Cloud suggested model', atlas.models?.[0].id === 'qwen/qwen3.5-flash'); + // explicit override for an unlisted gateway const c = buildCustomEntry({ name: 'mygw', baseUrl: 'https://x.example/v1', apiKeyEnv: 'MYGW_KEY' }); check('builds from explicit fields', c.name === 'mygw' && c.apiKeyEnv === 'MYGW_KEY');