patch ollama context window error when unreachable

This commit is contained in:
timothycarambat 2025-10-06 16:25:06 -07:00
parent f6f566792d
commit 0a1a5a216a

View File

@ -79,7 +79,9 @@ class OllamaAILLM {
headers: authToken ? { Authorization: `Bearer ${authToken}` } : {},
});
const { models } = await client.list();
const { models } = await client.list().catch(() => ({ models: [] }));
if (!models.length) return;
const infoPromises = models.map((model) =>
client
.show({ model: model.name })