Skip to content

Commit

Permalink
feat: add base url envvar for ollama
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrump committed Oct 25, 2024
1 parent e97996b commit c8bb159
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/crllm/model/provider/ollama.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit c8bb159

Please sign in to comment.