updated ollama to use defined base URL for model calls

This commit is contained in:
noobydp
2024-10-24 16:49:11 +08:00
parent 94fa108142
commit 8ce82b5a1c
4 changed files with 9 additions and 5 deletions

View File

@@ -38,7 +38,7 @@ async function getOllamaModels(): Promise<ModelInfo[]> {
try {
const base_url =import.meta.env.OLLAMA_API_BASE_URL || "http://localhost:11434";
const url = new URL(base_url).toString();
const response = await fetch(`${url}/api/tags`);
const response = await fetch(`${url}api/tags`);
const data = await response.json();
return data.models.map((model: any) => ({