diff --git a/src/models.js b/src/models.js index 15ad546..54539c9 100644 --- a/src/models.js +++ b/src/models.js @@ -9,7 +9,18 @@ export const modelRegistry = {}; export async function fetchModelsFromEndpoints() { const cacheKey = "modelRegistryCache"; const endpointsKey = "vllmEndpointsHash"; - const endpointsString = JSON.stringify(VLLM_ENDPOINTS); + + // Include custom API config in cache key to bust cache when it changes + const customAPIConfig = { + useCustomAPI: localStorage.getItem("useCustomAPI"), + customBaseURL: localStorage.getItem("customBaseURL"), + customAPIKey: localStorage.getItem("customAPIKey") + }; + const endpointsString = JSON.stringify({ + vllm: VLLM_ENDPOINTS, + custom: customAPIConfig + }); + const cachedEndpoints = localStorage.getItem(endpointsKey); const cacheItem = localStorage.getItem(cacheKey); const now = Date.now();