Skip to content

Commit 6102d2e

Browse files
committed
changing ollama port
1 parent 26d5dfc commit 6102d2e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/backends/test_openai_ollama.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# test/rits_backend_tests/test_openai_integration.py
2+
import os
3+
24
import pydantic
35
import pytest
46
from typing_extensions import Annotated
@@ -18,14 +20,14 @@ def backend(gh_run: int):
1820
return OpenAIBackend(
1921
model_id=META_LLAMA_3_2_1B,
2022
formatter=TemplateFormatter(model_id=META_LLAMA_3_2_1B),
21-
base_url="http://localhost:11434/v1",
23+
base_url=f"http://{os.environ.get('OLLAMA_HOST', 'localhost:11434')}/v1",
2224
api_key="ollama",
2325
)
2426
else:
2527
return OpenAIBackend(
2628
model_id="granite3.3:8b",
2729
formatter=TemplateFormatter(model_id="ibm-granite/granite-3.2-8b-instruct"),
28-
base_url="http://localhost:11434/v1",
30+
base_url=f"http://{os.environ.get('OLLAMA_HOST', 'localhost:11434')}/v1",
2931
api_key="ollama",
3032
)
3133

test/stdlib_basics/test_session.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@ def test_start_session_openai_with_kwargs(gh_run):
1616
m = start_session(
1717
"openai",
1818
model_id="llama3.2:1b",
19-
base_url="http://localhost:11434/v1",
19+
base_url=f"http://{os.environ.get('OLLAMA_HOST', 'localhost:11434')}/v1",
2020
api_key="ollama",
2121
)
2222
else:
2323
m = start_session(
2424
"openai",
2525
model_id="granite3.3:8b",
26-
base_url="http://localhost:11434/v1",
26+
base_url=f"http://{os.environ.get('OLLAMA_HOST', 'localhost:11434')}/v1",
2727
api_key="ollama",
2828
)
2929
response = m.instruct("testing")

0 commit comments

Comments
 (0)