( baseUrl: string = 'http://localhost:11434' )
| 71 | } |
| 72 | |
| 73 | export 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 | |
| 90 | export async function fetchLlamaCppModels( |
| 91 | baseUrl: string = 'http://localhost:8080' |
no test coverage detected
searching dependent graphs…