Skip to content

Support separate embedding base URL configuration#1575

Merged
MODSetter merged 2 commits into
MODSetter:devfrom
dpersek:feature/1354-embedding-base-url
Jul 9, 2026
Merged

Support separate embedding base URL configuration#1575
MODSetter merged 2 commits into
MODSetter:devfrom
dpersek:feature/1354-embedding-base-url

Conversation

@dpersek

@dpersek dpersek commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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_URL to Chonkie's api_base kwarg for litellm:// embedding models. OLLAMA_EMBEDDING_BASE_URL is also accepted as an Ollama-specific fallback when the generic variable is unset.

Screenshots

N/A - backend configuration and documentation change.

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Testing Performed

  • Tested locally
  • Manual/QA verification

Commands:

  • EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 uv run pytest tests/unit/config/test_embedding_settings.py
    • 6 passed
  • uv run ruff check app/config/__init__.py app/config/embedding_settings.py tests/unit/config/test_embedding_settings.py
    • passed
  • EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2 uv run pytest -m unit
    • 2384 passed, 1 skipped, 636 deselected
  • git diff --check
    • passed

Notes:

  • Scope is backend config, env examples, and docs only.
  • No model-connection UI, database/API schema, dependency, or native Chonkie provider changes.
  • No live external embedding server smoke test was run.

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

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_URL and OLLAMA_EMBEDDING_BASE_URL environment variables that map to Chonkie's api_base parameter for litellm:// 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
Order File Path
1 surfsense_backend/app/config/embedding_settings.py
2 surfsense_backend/tests/unit/config/test_embedding_settings.py
3 surfsense_backend/app/config/__init__.py
4 surfsense_backend/.env.example
5 docker/.env.example
6 surfsense_web/content/docs/docker-installation/docker-compose.mdx
7 surfsense_web/content/docs/local-models/ollama.mdx
8 surfsense_web/content/docs/manual-installation.mdx

Need help? Join our Discord

@vercel

vercel Bot commented Jul 6, 2026

Copy link
Copy Markdown

@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.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 777e83b1-742f-4775-a797-bcabbd009ec6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dpersek
dpersek marked this pull request as ready for review July 6, 2026 02:56
…ng-base-url

# Conflicts:
#	surfsense_web/content/docs/docker-installation/docker-compose.mdx
#	surfsense_web/content/docs/manual-installation.mdx
@MODSetter
MODSetter merged commit 3eb485f into MODSetter:dev Jul 9, 2026
1 of 2 checks passed
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