models: add synthetic provider

This commit is contained in:
William Valentin
2026-02-14 09:34:39 -08:00
parent b22d6fa0ce
commit 184ebe4480
6 changed files with 218 additions and 3 deletions
+3 -1
View File
@@ -1,5 +1,5 @@
import type { Config, ModelConfig } from '../config/index.js';
import { AnthropicClient, OpenAIClient, OllamaClient, LlamaCppClient, GeminiClient, BedrockClient, GitHubModelsClient, ModelRouter, DEFAULT_RETRY_CONFIG } from '../models/index.js';
import { AnthropicClient, OpenAIClient, OllamaClient, LlamaCppClient, GeminiClient, BedrockClient, GitHubModelsClient, SyntheticClient, ModelRouter, DEFAULT_RETRY_CONFIG } from '../models/index.js';
import type { ModelClient, RetryConfig, ModelTier } from '../models/index.js';
import { logger } from '../logger.js';
import { getZaiApiKey } from '../auth/zai.js';
@@ -132,6 +132,8 @@ export function createClientFromConfig(cfg: ModelConfig): ModelClient {
});
},
});
case 'synthetic':
return new SyntheticClient({ model: cfg.model });
default:
throw new Error(`Unknown model provider: ${(cfg as Record<string, unknown>).provider}`);
}