From cd218cc4a1301a138d600472dec35ef4e1849ff1 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Fri, 11 Jul 2025 01:08:57 -0400 Subject: [PATCH] fix refresh models button: include custom API config in cache key to properly bust cache --- src/models.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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();