Skip to content

ollama python client wants OLLAMA_HOST or host #603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ MISTRAL_API_KEY=
MISTRAL_ENDPOINT=https://api.mistral.ai/v1

OLLAMA_ENDPOINT=http://localhost:11434
OLLAMA_HOST=http://localhost:11434

ALIBABA_ENDPOINT=https://dashscope.aliyuncs.com/compatible-mode/v1
ALIBABA_API_KEY=
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
- DEEPSEEK_ENDPOINT=${DEEPSEEK_ENDPOINT:-https://api.deepseek.com}
- DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY:-}
- OLLAMA_ENDPOINT=${OLLAMA_ENDPOINT:-http://localhost:11434}
- OLLAMA_HOST=${OLLAMA_HOST:-http://localhost:11434}
- MISTRAL_ENDPOINT=${MISTRAL_ENDPOINT:-https://api.mistral.ai/v1}
- MISTRAL_API_KEY=${MISTRAL_API_KEY:-}
- ALIBABA_ENDPOINT=${ALIBABA_ENDPOINT:-https://dashscope.aliyuncs.com/compatible-mode/v1}
Expand Down
3 changes: 1 addition & 2 deletions src/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
"google": ["gemini-2.0-flash", "gemini-2.0-flash-thinking-exp", "gemini-1.5-flash-latest",
"gemini-1.5-flash-8b-latest", "gemini-2.0-flash-thinking-exp-01-21", "gemini-2.0-pro-exp-02-05",
"gemini-2.5-pro-preview-03-25", "gemini-2.5-flash-preview-04-17"],
"ollama": ["qwen2.5:7b", "qwen2.5:14b", "qwen2.5:32b", "qwen2.5-coder:14b", "qwen2.5-coder:32b", "llama2:7b",
"deepseek-r1:14b", "deepseek-r1:32b"],
"ollama": ["qwen2.5:14b", "codellama:7b-instruct-q4_0"],
"azure_openai": ["gpt-4o", "gpt-4", "gpt-3.5-turbo"],
"mistral": ["pixtral-large-latest", "mistral-large-latest", "mistral-small-latest", "ministral-8b-latest"],
"alibaba": ["qwen-plus", "qwen-max", "qwen-vl-max", "qwen-vl-plus", "qwen-turbo", "qwen-long"],
Expand Down
2 changes: 1 addition & 1 deletion src/utils/llm_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def get_llm_model(provider: str, **kwargs):
)
elif provider == "ollama":
if not kwargs.get("base_url", ""):
base_url = os.getenv("OLLAMA_ENDPOINT", "http://localhost:11434")
base_url = os.getenv("OLLAMA_ENDPOINT", "http://ollama:11434")
else:
base_url = kwargs.get("base_url")

Expand Down
6 changes: 3 additions & 3 deletions src/webui/components/agent_settings_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ def create_agent_settings_tab(webui_manager: WebuiManager):
llm_provider = gr.Dropdown(
choices=[provider for provider, model in config.model_names.items()],
label="LLM Provider",
value="openai",
value="ollama",
info="Select LLM provider for LLM",
interactive=True
)
llm_model_name = gr.Dropdown(
label="LLM Model Name",
choices=config.model_names['openai'],
value="gpt-4o",
choices=config.model_names['ollama'],
value="qwen2.5:14b",
interactive=True,
allow_custom_value=True,
info="Select a model in the dropdown options or directly type a custom model name"
Expand Down
2 changes: 2 additions & 0 deletions src/webui/components/browser_use_agent_tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,8 @@ def done_callback_wrapper(history: AgentHistoryList):
raise ValueError(
"Browser or Context not initialized, cannot create agent."
)
print("OLLAMA_ENDPOINT:", os.environ.get("OLLAMA_ENDPOINT"))
print("OLLAMA_HOST:", os.environ.get("OLLAMA_HOST"))
webui_manager.bu_agent = BrowserUseAgent(
task=task,
llm=main_llm,
Expand Down