MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / getModelIdForProvider

Function getModelIdForProvider

apps/cli/src/lib/utils/context-window.ts:37–59  ·  view source on GitHub ↗

* Gets the model ID from the API configuration based on the provider type. * * Different providers store their model ID in different fields of ProviderSettings.

(config: ProviderSettings)

Source from the content-addressed store, hash-verified

35 * Different providers store their model ID in different fields of ProviderSettings.
36 */
37function getModelIdForProvider(config: ProviderSettings): string | undefined {
38 switch (config.apiProvider) {
39 case "openrouter":
40 return config.openRouterModelId
41 case "ollama":
42 return config.ollamaModelId
43 case "lmstudio":
44 return config.lmStudioModelId
45 case "openai":
46 return config.openAiModelId
47 case "requesty":
48 return config.requestyModelId
49 case "unbound":
50 return config.unboundModelId
51 case "litellm":
52 return config.litellmModelId
53 case "vercel-ai-gateway":
54 return config.vercelAiGatewayModelId
55 default:
56 // For anthropic, bedrock, vertex, gemini, xai, etc.
57 return config.apiModelId
58 }
59}
60
61export { DEFAULT_CONTEXT_WINDOW }

Callers 1

getContextWindowFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected