MCPcopy
hub / github.com/continuedev/continue / fetchModels

Function fetchModels

core/llm/fetchModels.ts:241–258  ·  view source on GitHub ↗
(
  provider: string,
  apiKey?: string,
  apiBase?: string,
)

Source from the content-addressed store, hash-verified

239}
240
241export async function fetchModels(
242 provider: string,
243 apiKey?: string,
244 apiBase?: string,
245): Promise<FetchedModel[]> {
246 switch (provider) {
247 case "ollama":
248 return fetchOllamaModels();
249 case "openrouter":
250 return fetchOpenRouterModels();
251 case "anthropic":
252 return fetchAnthropicModels(apiKey);
253 case "gemini":
254 return fetchGeminiModels(apiKey, apiBase);
255 default:
256 return fetchProviderModelsViaListModels(provider, apiKey, apiBase);
257 }
258}

Callers 1

Calls 5

fetchOllamaModelsFunction · 0.85
fetchOpenRouterModelsFunction · 0.85
fetchAnthropicModelsFunction · 0.85
fetchGeminiModelsFunction · 0.85

Tested by

no test coverage detected