From c8bb15908fbc7d17fd0412dda7e93bd25bb2f2d3 Mon Sep 17 00:00:00 2001 From: Lukas Rump Date: Fri, 25 Oct 2024 17:24:27 +0200 Subject: [PATCH] feat: add base url envvar for ollama --- src/crllm/model/provider/ollama.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/crllm/model/provider/ollama.py b/src/crllm/model/provider/ollama.py index e5e4b6d..3212301 100644 --- a/src/crllm/model/provider/ollama.py +++ b/src/crllm/model/provider/ollama.py @@ -1,9 +1,13 @@ +import os from langchain_ollama import ChatOllama from crllm.model.model import Model class OllamaModel(Model): def _get_model(self, model_config): + if os.environ.get("OLLAMA_URL"): + model_config["base_url"] = os.environ.get("OLLAMA_URL") + return ChatOllama(**model_config) @staticmethod