feat: add Gemini and Bedrock model providers

Add native GeminiClient using @google/generative-ai SDK and BedrockClient
using @aws-sdk/client-bedrock-runtime. Replace the previous Gemini fallback
(OpenAI-compatible shim) with the real implementation. Add OpenRouter as a
provider option (OpenAI-compatible with custom baseURL). Update model costs,
doctor CLI checks, and client factory tests.
This commit is contained in:
William Valentin
2026-02-06 16:51:32 -08:00
parent e8e4fcd758
commit 0eb1f7a073
8 changed files with 908 additions and 5 deletions
+7 -2
View File
@@ -123,9 +123,14 @@ const checkModelConnectivity: Check = async (ctx) => {
}
// Check if API key is present for providers that need one
const needsKey = ['anthropic', 'openai', 'gemini'];
const needsKey = ['anthropic', 'openai', 'gemini', 'openrouter'];
if (needsKey.includes(model.provider) && !model.api_key && !model.auth_token) {
const envVar = model.provider === 'anthropic' ? 'ANTHROPIC_API_KEY' : model.provider === 'openai' ? 'OPENAI_API_KEY' : undefined;
const envVarMap: Record<string, string> = {
anthropic: 'ANTHROPIC_API_KEY',
openai: 'OPENAI_API_KEY',
openrouter: 'OPENROUTER_API_KEY',
};
const envVar = envVarMap[model.provider];
const hasEnv = envVar && process.env[envVar];
if (!hasEnv) {
return { status: 'warn', label: 'Model connectivity', detail: `${model.provider}/${model.model} — no API key or auth token found` };