LiteLLM provider dynamic model fetching (#7679)

* add dynamic model fetching for litellm provider and get rid of manual model config; also implement dynamic modelinfo lookup

* don't clear the models list when a fetch fails
This commit is contained in:
celestial-vault authored and GitHub committed 2025-11-26 10:54:51 -08:00
1 parent 22c22a1cfc
commit 550428eabd
12 files changed
+349 -261

No files matched your search

@@ -8,6 +8,7 @@ import { sendMcpMarketplaceCatalogEvent } from "../mcp/subscribeToMcpMarketplace
import { refreshBasetenModels } from "../models/refreshBasetenModels"
import { refreshGroqModels } from "../models/refreshGroqModels"
import { refreshHicapModels } from "../models/refreshHicapModels"
import { refreshLiteLlmModels } from "../models/refreshLiteLlmModels"
import { refreshOpenRouterModels } from "../models/refreshOpenRouterModels"
import { sendOpenRouterModelsEvent } from "../models/subscribeToOpenRouterModels"
@@ -194,6 +195,9 @@ export async function initializeWebview(controller: Controller, _request: EmptyR
}
})
// State update event sent within the refreshLiteLlmModels function
refreshLiteLlmModels()
// GUI relies on model info to be up-to-date to provide the most accurate pricing, so we need to fetch the latest details on launch.
// We do this for all users since many users switch between api providers and if they were to switch back to openrouter it would be showing outdated model info if we hadn't retrieved the latest at this point
// (see normalizeApiConfiguration > openrouter)