File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ AZURE_OPENAI_API_KEY=
11
11
DEEPSEEK_ENDPOINT = https://api.deepseek.com
12
12
DEEPSEEK_API_KEY =
13
13
14
+ OLLAMA_ENDPOINT = http://localhost:11434
15
+
14
16
# Set to false to disable anonymized telemetry
15
17
ANONYMIZED_TELEMETRY = true
16
18
Original file line number Diff line number Diff line change @@ -89,11 +89,16 @@ def get_llm_model(provider: str, **kwargs):
89
89
google_api_key = api_key ,
90
90
)
91
91
elif provider == "ollama" :
92
+ if not kwargs .get ("base_url" , "" ):
93
+ base_url = os .getenv ("OLLAMA_ENDPOINT" , "http://localhost:11434" )
94
+ else :
95
+ base_url = kwargs .get ("base_url" )
96
+
92
97
return ChatOllama (
93
98
model = kwargs .get ("model_name" , "qwen2.5:7b" ),
94
99
temperature = kwargs .get ("temperature" , 0.0 ),
95
100
num_ctx = kwargs .get ("num_ctx" , 32000 ),
96
- base_url = kwargs . get ( " base_url" , "http://localhost:11434" ) ,
101
+ base_url = base_url ,
97
102
)
98
103
elif provider == "azure_openai" :
99
104
if not kwargs .get ("base_url" , "" ):
You can’t perform that action at this time.
0 commit comments