Support separate embedding base URL configuration#1575
Conversation
|
@SyntaxSawdust 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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…ng-base-url # Conflicts: # surfsense_web/content/docs/docker-installation/docker-compose.mdx # surfsense_web/content/docs/manual-installation.mdx
Description
Adds a dedicated embedding endpoint configuration for self-hosted deployments that run embedding models separately from chat/completion models.
Motivation and Context
FIX #1354
SurfSense already lets operators configure
EMBEDDING_MODEL, but there was no separate environment variable for the embedding provider endpoint. This made split deployments harder, such as running chat models on one Ollama instance and embeddings on another machine or port.Chonkie's custom endpoint support for this path is exposed through LiteLLM embeddings, so this change maps
EMBEDDING_BASE_URLto Chonkie'sapi_basekwarg forlitellm://embedding models.OLLAMA_EMBEDDING_BASE_URLis also accepted as an Ollama-specific fallback when the generic variable is unset.Screenshots
N/A - backend configuration and documentation change.
API Changes
Change Type
Testing Performed
Commands:
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 uv run pytest tests/unit/config/test_embedding_settings.pyuv run ruff check app/config/__init__.py app/config/embedding_settings.py tests/unit/config/test_embedding_settings.pyEMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 uv run pytest -m unitgit diff --checkNotes:
Checklist
High-level PR Summary
This PR adds support for configuring a separate embedding endpoint to enable split deployments where embedding models run on different servers than chat/completion models. It introduces
EMBEDDING_BASE_URLandOLLAMA_EMBEDDING_BASE_URLenvironment variables that map to Chonkie'sapi_baseparameter forlitellm://embedding models, while preserving existing Azure OpenAI configuration support. The changes include new configuration logic, comprehensive unit tests, updated environment variable examples, and documentation for self-hosted deployments.⏱️ Estimated Review Time: 15-30 minutes
💡 Review Order Suggestion
surfsense_backend/app/config/embedding_settings.pysurfsense_backend/tests/unit/config/test_embedding_settings.pysurfsense_backend/app/config/__init__.pysurfsense_backend/.env.exampledocker/.env.examplesurfsense_web/content/docs/docker-installation/docker-compose.mdxsurfsense_web/content/docs/local-models/ollama.mdxsurfsense_web/content/docs/manual-installation.mdx