Skip to content

fix(oss): OllamaLLM now respects configured url instead of always falling back to localhost#4320

Merged
whysosaket merged 2 commits intomainfrom
fix/ollama-url-config-passthrough
Mar 16, 2026
Merged

fix(oss): OllamaLLM now respects configured url instead of always falling back to localhost#4320
whysosaket merged 2 commits intomainfrom
fix/ollama-url-config-passthrough

Conversation

@kartik-mem0
Copy link
Copy Markdown
Contributor

Description

OllamaLLM in the TypeScript SDK ignored the user-provided url config and always connected to localhost:11434, even when a remote Ollama server was configured.

Root cause: The constructor used config.config?.url (double-nested, always undefined) instead of config.url. Additionally, the url field was missing from the LLM config pipeline —
ConfigManager didn't pass it through, and Zod validation stripped it.

Fix: Three changes to match how the embedder side already works correctly:

  • ollama.ts — Fix config.config?.urlconfig.url || config.baseURL
  • config/manager.ts — Pass url through in LLM config
  • types/index.ts — Add url to LLMConfig interface and Zod schema

Fixes #4059, fixes #4104

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • Unit Test

4 new tests in config-manager.test.ts covering:

  • URL preserved in LLM config when provided
  • baseURL and url coexist without interference
  • Default baseURL fallback when neither is provided
  • Both embedder and LLM url preserved independently

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Maintainer Checklist

@kartik-mem0 kartik-mem0 requested a review from whysosaket March 14, 2026 10:37
@kartik-mem0 kartik-mem0 removed the request for review from whysosaket March 14, 2026 14:40
@whysosaket whysosaket merged commit b4b73de into main Mar 16, 2026
3 checks passed
jamebobob pushed a commit to jamebobob/mem0-vigil-recall that referenced this pull request Mar 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants