MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / fetchOllamaModels

Function fetchOllamaModels

out/cli.cjs:86236–86247  ·  view source on GitHub ↗
(baseUrl = "http://localhost:11434")

Source from the content-addressed store, hash-verified

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}
86242async 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 {

Callers 2

fetchModelsForProviderFunction · 0.70
setupOllamaFunction · 0.70

Calls 1

jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…