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

Function fetchOllamaModels

src/utils/modelCache.ts:73–88  ·  view source on GitHub ↗
(
  baseUrl: string = 'http://localhost:11434'
)

Source from the content-addressed store, hash-verified

71}
72
73export async function fetchOllamaModels(
74 baseUrl: string = 'http://localhost:11434'
75): Promise<string[]> {
76 try {
77 const response = await fetch(`${baseUrl}/api/tags`);
78
79 if (!response.ok) {
80 return [];
81 }
82
83 const data = await response.json();
84 return data.models?.map((m: { name: string }) => m.name) || [];
85 } catch {
86 return [];
87 }
88}
89
90export async function fetchLlamaCppModels(
91 baseUrl: string = 'http://localhost:8080'

Callers 2

setupOllamaFunction · 0.90
fetchModelsForProviderFunction · 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…