diff --git a/backend/api/v1/models.py b/backend/api/v1/models.py index f395b90..4d169f4 100644 --- a/backend/api/v1/models.py +++ b/backend/api/v1/models.py @@ -43,6 +43,12 @@ async def get_model_info(): async def update_model_info(): import httpx + # 🔹 Invalida la cache prima di ricostruire + try: + redis_service.r.delete("modelInfoList") + except Exception: + logger.exception("Errore durante la cancellazione della cache Redis") + try: async with httpx.AsyncClient(timeout=settings.REQUEST_TIMEOUT) as client: resp = await client.get(settings.LM_STUDIO_MODELS) diff --git a/frontend/src/ModelOverview.jsx b/frontend/src/ModelOverview.jsx index d477ba5..9728c8d 100644 --- a/frontend/src/ModelOverview.jsx +++ b/frontend/src/ModelOverview.jsx @@ -29,7 +29,7 @@ export default function ModelOverview({ onBackToChat }) { const updateModelData = async () => { setLoading(true); try { - const res = await fetch("/v1/model-info/update", { method: "POST" }); + const res = await fetch("/v1/models-info/update", { method: "POST" }); if (res.ok) { const updated = await res.json(); setModelInfo(Array.isArray(updated) ? updated : []); @@ -83,7 +83,7 @@ export default function ModelOverview({ onBackToChat }) {