Skip to content
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

Unable to configure ollama via 3rd party url #1721

Open
yrobla opened this issue Feb 26, 2025 · 1 comment
Open

Unable to configure ollama via 3rd party url #1721

yrobla opened this issue Feb 26, 2025 · 1 comment

Comments

@yrobla
Copy link

yrobla commented Feb 26, 2025

Bug description

I am trying to use MetaGPT via a third party url wrapper. It works for me with openai and claude:

llm:
  api_type: "openai"  # or azure / ollama / groq etc.
  model: "gpt-4-turbo"  # or gpt-3.5-turbo
  base_url: "http://localhost:8989/openai"
  api_key: "xxxx"

But when i configure ollama, i have a problem:

llm:
  api_type: "ollama"  # or azure / ollama / groq etc.
  model: "llama2"  # or gpt-3.5-turbo
  base_url: "http://localhost:8989/ollama"

But it fails with a 404 not found, because the base URL needs to be:
/api/chat and it just gets /chat

    @property
    def api_suffix(self) -> str:
        return "/chat"

I also tried to setup a proxy:

llm:
  api_type: "ollama"  # or azure / ollama / groq etc.
  model: "llama2"  # or gpt-3.5-turbo
  base_url: "http://localhost:11434/api"  # or forward url / other llm url
  proxy: "http://localhost:8989"

But it doesn't seem to be even picked. How can i configure ollama via this wrapper url?

Environment information
mac os m2
llm type -> ollama

@iorisa
Copy link
Collaborator

iorisa commented Mar 4, 2025

llm:
  api_type: "ollama" 
  model: "llama3.2"  # or gpt-3.5-turbo
  base_url: "http://localhost:11434/api" 
  api_key: "any string will be ok"

Sovled by: #1710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants