* 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)
| 35 | * Different providers store their model ID in different fields of ProviderSettings. |
| 36 | */ |
| 37 | function 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 | |
| 61 | export { DEFAULT_CONTEXT_WINDOW } |