fix: add OLLAMA_BASE_URL support to backend config#605
fix: add OLLAMA_BASE_URL support to backend config#605shamil2 wants to merge 1 commit intoMODSetter:mainfrom
Conversation
|
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. |
There was a problem hiding this comment.
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
|
@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. |
|
Sure I will test it and confirm |
|
@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 Yes we need a DB-based solution similar to how LLM configs work. Should I implement an Embedding Configuration UI/table that stores the |
…ith bug fixes PR MODSetter#893 — fix: BookStack + Obsidian missing from periodic scheduler - Add index_bookstack_pages_task and index_obsidian_vault_task to schedule_checker_task.py imports and task_map PR MODSetter#894 — feat: BookStack shelf exclusion filter - bookstack_connector.py: get_all_shelves(), build_book_to_shelf_map() returning dict[int, set[int]] (fixes book-in-multiple-shelves edge case) get_all_pages/get_pages_by_date_range cache shelf map once (fixes N+1) - search_source_connectors_routes.py: POST /bookstack/shelves endpoint - bookstack_indexer.py: pass BOOKSTACK_EXCLUDED_SHELF_IDS to indexer - bookstack-connect-form.tsx + bookstack-config.tsx: shelf picker UI with loading guard to prevent race condition on rapid clicks - connectors-api.service.ts: listBookStackShelves() API method PR MODSetter#605 — fix: OLLAMA_BASE_URL support for external Ollama embeddings - config/__init__.py: add OLLAMA_BASE_URL env var; only inject base_url into embedding_kwargs when EMBEDDING_MODEL starts with "ollama://" (fixes original PR's bug: was unconditionally injected for all providers) - .env.example: document OLLAMA_BASE_URL with usage notes Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ith bug fixes PR MODSetter#893 — fix: BookStack + Obsidian missing from periodic scheduler - Add index_bookstack_pages_task and index_obsidian_vault_task to schedule_checker_task.py imports and task_map PR MODSetter#894 — feat: BookStack shelf exclusion filter - bookstack_connector.py: get_all_shelves(), build_book_to_shelf_map() returning dict[int, set[int]] (fixes book-in-multiple-shelves edge case) get_all_pages/get_pages_by_date_range cache shelf map once (fixes N+1) - search_source_connectors_routes.py: POST /bookstack/shelves endpoint - bookstack_indexer.py: pass BOOKSTACK_EXCLUDED_SHELF_IDS to indexer - bookstack-connect-form.tsx + bookstack-config.tsx: shelf picker UI with loading guard to prevent race condition on rapid clicks - connectors-api.service.ts: listBookStackShelves() API method PR MODSetter#605 — fix: OLLAMA_BASE_URL support for external Ollama embeddings - config/__init__.py: add OLLAMA_BASE_URL env var; only inject base_url into embedding_kwargs when EMBEDDING_MODEL starts with "ollama://" (fixes original PR's bug: was unconditionally injected for all providers) - .env.example: document OLLAMA_BASE_URL with usage notes Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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_URLenvironment 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
surfsense_backend/.env.examplesurfsense_backend/app/config/__init__.py