From c9b60d5f5117e7eb0ab83cad179d009a4630ac58 Mon Sep 17 00:00:00 2001 From: sauravniraula Date: Fri, 28 Nov 2025 02:56:33 +0545 Subject: [PATCH] fix: default ollama url --- servers/fastapi/utils/ollama.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers/fastapi/utils/ollama.py b/servers/fastapi/utils/ollama.py index 928ee895..4b545e57 100644 --- a/servers/fastapi/utils/ollama.py +++ b/servers/fastapi/utils/ollama.py @@ -10,7 +10,7 @@ from utils.get_env import get_ollama_url_env async def pull_ollama_model(model: str) -> AsyncGenerator[dict, None]: async with aiohttp.ClientSession() as session: async with session.post( - f"{get_ollama_url_env()}/api/pull", + f"{get_ollama_url_env() or 'http://localhost:11434'}/api/pull", json={"model": model}, ) as response: if response.status != 200: @@ -34,7 +34,7 @@ async def pull_ollama_model(model: str) -> AsyncGenerator[dict, None]: async def list_pulled_ollama_models() -> list[OllamaModelStatus]: async with aiohttp.ClientSession() as session: async with session.get( - f"{get_ollama_url_env()}/api/tags", + f"{get_ollama_url_env() or 'http://localhost:11434'}/api/tags", ) as response: if response.status == 200: pulled_models = await response.json()