[Feature] Support for Local & Custom OpenAI-Compatible Endpoints (Ollama/vLLM)
Is your feature request related to a problem?
Currently, the OpenAIIntegration appears to default to the official OpenAI API (api.openai.com). While this works perfectly for standard use cases, many developers (myself included) are moving towards local inference using tools like Ollama, LocalAI, or vLLM for privacy and cost reasons. These tools often expose an OpenAI-compatible endpoint (e.g., http://localhost:11434/v1), but Memori doesn't currently offer a streamlined way to point the client to these custom URLs.
The Solution
I propose updating the Memori configuration and OpenAIIntegration to accept an optional base_url parameter.
Specifically:
- Update
ConfigManager(andMemoriinit) to accept abase_urlargument. - Pass this
base_urlinto theopenai.Clientinstantiation withinmemori/integrations/openai_integration.py.
This would allow users to initialize Memori with local models effortlessly:
# Example Usage
memori = Memori(
api_key="ollama",
base_url="http://localhost:11434/v1" # Local endpoint
)Alternatives Considered
I have analyzed the codebase and believe this change is primarily isolated to openai_integration.py and the configuration logic.
I would be happy to implement this myself and submit a PR. Please let me know if this aligns with the roadmap!
Affected Components
Other
Participation
- I am willing to submit a pull request for this feature.
Source: MemoriLabs/Memori