Skip to content

Fix #1721: Add support for Ollama with third-party URL wrappers #1735

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 1 commit into
base: main
Choose a base branch
from

Conversation

dbsectrainer
Copy link

Features

Fixed issue #1721: Unable to configure Ollama via third-party URL wrapper
Added support for three different ways to configure Ollama with third-party wrappers:
Base URL with /api at the end
Base URL without /api (automatically handled)
Proxy configuration option
Added comprehensive documentation and example configurations
Added test scripts to verify URL construction
Feature Docs

Added new tutorial: docs/tutorial/ollama_third_party_wrapper.md
Added example config: config/examples/ollama-third-party-wrapper.yaml
Added test scripts:
examples/ollama_url_test.py
examples/ollama_wrapper_test.py
Influence
This fix enables users to:

Use MetaGPT with Ollama through third-party URL wrappers
Configure the base URL in multiple ways to suit different wrapper setups
Easily verify their configuration with provided test scripts
Follow clear documentation for setup and troubleshooting
Result

Testing Ollama URL construction...

Test: Direct Ollama URL
Base URL: http://localhost:11434
Suffix: /chat
Result URL: http://localhost:11434/api/chat
Expected: http://localhost:11434/api/chat
✅ PASS

Test: Wrapper URL with /api at end
Base URL: http://localhost:8989/ollama/api
Suffix: /chat
Result URL: http://localhost:8989/ollama/api/chat
Expected: http://localhost:8989/ollama/api/chat
✅ PASS

Test: Wrapper URL without /api
Base URL: http://localhost:8989/ollama
Suffix: /chat
Result URL: http://localhost:8989/ollama/api/chat
Expected: http://localhost:8989/ollama/api/chat
✅ PASS

Test: Wrapper URL with /api/ in middle
Base URL: http://localhost:8989/api/ollama
Suffix: /chat
Result URL: http://localhost:8989/api/ollama/chat
Expected: http://localhost:8989/api/ollama/chat
✅ PASS

Other
The changes maintain backward compatibility with existing Ollama configurations while adding support for third-party URL wrappers. The solution is flexible enough to handle various wrapper URL patterns and includes comprehensive documentation to help users set up their preferred configuration.

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

Successfully merging this pull request may close these issues.

1 participant