Skip to content

Conversation

@shamil2
Copy link

@shamil2 shamil2 commented Dec 20, 2025

Fixes #587. Adds support for OLLAMA_BASE_URL environment variable to allow connection to external Ollama instances for embeddings, which fixes connection refused errors during document and YouTube video uploads in Docker.

High-level PR Summary

This PR adds support for the OLLAMA_BASE_URL environment variable to enable connections to external Ollama instances for embeddings. This resolves connection refused errors that occur during document and YouTube video uploads when running in Docker environments by allowing users to specify a custom Ollama endpoint (e.g., http://host.docker.internal:11434).

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_backend/.env.example
2 surfsense_backend/app/config/__init__.py

Need help? Join our Discord

Analyze latest changes

@vercel
Copy link

vercel bot commented Dec 20, 2025

Someone is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

@recurseml recurseml bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review by RecurseML

🔍 Review performed on 48ea41a..3772901

✨ No bugs found, your code is sparkling clean

✅ Files analyzed, no issues (2)

surfsense_backend/.env.example
surfsense_backend/app/config/__init__.py

@MODSetter
Copy link
Owner

MODSetter commented Dec 20, 2025

@AnishSarkar22 Can you test if it fixes the original issue. IMO I think we should be storing this in db and passing this var on runtime. Can you try that.

@shamil2 Can you raise this PR for 'dev' branch.

@AnishSarkar22
Copy link
Contributor

Sure I will test it and confirm

@AnishSarkar22
Copy link
Contributor

@MODSetter Tested this locally but the solution by @shamil2 does not fix the original issue. Chonkie doesn't have native Ollama support, so it crashes with TypeError: SentenceTransformer.__init__() got an unexpected keyword argument 'base_url'.

Yes we need a DB-based solution similar to how LLM configs work. Should I implement an Embedding Configuration UI/table that stores the base_url (and potentially model name, dimension) in the database?

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.

[BUG] Ollama, connection refused

3 participants