Skip to content

Conversation

yaonyan
Copy link

@yaonyan yaonyan commented Sep 23, 2025

Ollama Configuration Inconsistency

🐛 Problem

An inconsistency in URL field naming across different parts of the codebase prevented users from correctly configuring Ollama providers.

  • Zod Schema: The MemoryConfigSchema only supported the baseURL field for both embedder and LLM configurations.
  • Ollama Implementation: The OllamaEmbedder and OllamaLLM classes expected a field named url.
  • ConfigManager: The ConfigManager returned different field names, which led to Zod schema validation failures and caused the url configuration to be ignored.

This conflict resulted in validation errors and made it impossible to set the Ollama service URL correctly.


🔧 Solution

To resolve this, the configuration handling was unified and made more flexible.

  • Updated Zod Schema: The schema now accepts both url and baseURL fields in the embedder and LLM configurations, providing backward compatibility and flexibility.
  • Enhanced ConfigManager: The manager was modified to handle both url and baseURL fields, implementing fallback logic to prioritize one while still recognizing the other.
  • Updated Ollama Providers: The OllamaEmbedder and OllamaLLM classes were updated to support both url and baseURL, ensuring the correct endpoint is used regardless of which field is provided.
  • Improved Type Definitions: The url field was added to the EmbeddingConfig and LLMConfig TypeScript interfaces to reflect the changes and improve type safety.

@CLAassistant
Copy link

CLAassistant commented Sep 23, 2025

CLA assistant check
All committers have signed the CLA.

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.

2 participants