Update uncloseai.js

This commit is contained in:
Russell Ballestrini 2025-02-28 13:37:07 +00:00
parent f143d4180c
commit 0414ed3ad8

View file

@ -48,8 +48,8 @@ const VLLM_ENDPOINTS = [
// This registry maps a model's ID to the endpoint where it resides.
const modelRegistry = {};
// Fetch models from each endpoint with caching (TTL: 1 hour)
// Cache is busted if the endpoint array changes.
// Fetch models from each endpoint with caching.
// Cache is busted if the endpoint array changes or TTL.
async function fetchModelsFromEndpoints() {
const cacheKey = 'modelRegistryCache';
const endpointsKey = 'vllmEndpointsHash';
@ -57,7 +57,7 @@ async function fetchModelsFromEndpoints() {
const cachedEndpoints = localStorage.getItem(endpointsKey);
const cacheItem = localStorage.getItem(cacheKey);
const now = Date.now();
const TTL = 3600000; // 1 hour in milliseconds
const TTL = 300000; // 5 minutes in milliseconds
if (cacheItem && cachedEndpoints === endpointsString) {
try {