(baseUrl = "http://localhost:11434")
| 86234 | const models = data.data.map((m5) => m5.id).filter( |
| 86235 | (id) => id.startsWith("gpt-") || id.startsWith("o1") || id.startsWith("o3") || id.startsWith("o4") |
| 86236 | ).sort(); |
| 86237 | return models.length > 0 ? models : MODEL_LIST.openai; |
| 86238 | } catch { |
| 86239 | return MODEL_LIST.openai; |
| 86240 | } |
| 86241 | } |
| 86242 | async function fetchOllamaModels(baseUrl = "http://localhost:11434") { |
| 86243 | try { |
| 86244 | const response = await fetch(`${baseUrl}/api/tags`); |
| 86245 | if (!response.ok) { |
| 86246 | return []; |
| 86247 | } |
| 86248 | const data = await response.json(); |
| 86249 | return data.models?.map((m5) => m5.name) || []; |
| 86250 | } catch { |
no test coverage detected
searching dependent graphs…