fix refresh models button: include custom API config in cache key to properly bust cache
This commit is contained in:
parent
02e614d733
commit
cd218cc4a1
1 changed files with 12 additions and 1 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue