Skip to content

Commit 0920abd

Browse files
committed
refactor(api): only fetch router models for providers with configured profiles. Fixes #4065
Add hasConfiguredProfile helper to filter model fetch candidates based on listApiConfigMeta, preventing unnecessary API calls for providers without configured profiles. - Extract listApiConfigMeta from state to check configured providers - Filter candidates to only fetch models for providers in use - Make litellm and io-intelligence type properties optional - Add apiKey to glama and vercel-ai-gateway candidate options - Update tests to verify profile-based filtering behavior
1 parent 80a8734 commit 0920abd

File tree

4 files changed

+227
-202
lines changed

4 files changed

+227
-202
lines changed

src/api/providers/fetchers/modelCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const getModels = async (options: GetModelsOptions): Promise<ModelRecord>
9696
break
9797
case "litellm":
9898
// Type safety ensures apiKey and baseUrl are always provided for LiteLLM.
99-
models = await getLiteLLMModels(options.apiKey, options.baseUrl)
99+
models = await getLiteLLMModels(options.apiKey || "", options.baseUrl || "")
100100
break
101101
// kilocode_change start
102102
case "kilocode": {

0 commit comments

Comments
 (0)