Skip to content

Require explicit opt-in and compatible model for local-to-API embedding fallback - #68

Merged
spelech merged 4 commits into
mainfrom
fix-embeddings-fallback-opt-in-10830566446682326892
Oct 28, 2026
Merged

spelech merged 4 commits into
mainfrom
fix-embeddings-fallback-opt-in-10830566446682326892

Conversation

@spelech

@spelech spelech commented Oct 27, 2026

Copy link
Copy Markdown
Owner

Require explicit opt-in (allow_fallback) and a compatible API model (fallback_dense_model) before falling back from local FastEmbed to API embeddings. If fallback is not explicitly enabled, local FastEmbed initialization failure raises a visible error and remains in local mode without making outbound API requests. Track requested vs. effective provider and dense model in system configuration metadata and response schemas.

Fixes #52


PR created automatically by Jules for task 10830566446682326892 started by @spelech

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

…lback

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@spelech

spelech commented Oct 28, 2026

Copy link
Copy Markdown
Owner Author

@jules Please review and address the following items for this PR:

Issues to Fix

  1. Handle Invalid Models with HTTP 400 Bad Request:
    • In app/api/routers/settings.py:445, when allow_fallback=True is supplied alongside an unknown/invalid model, catch ValueError and return an HTTP 400 Bad Request ({"status": "error", "error": str(ve)}) rather than an unhandled 500 error.
  2. Test Case Coverage:
    • Add a test case in tests/backend/test_indexer_and_embeddings.py validating that invalid fallback model names produce a 400 response with descriptive error message.
  3. Requirement Traceability:
    • Tag the test with @pytest.mark.requirement("EMB-FALLBACK-01").
    • Update docs/REQUIREMENTS.md.

How to Confirm the Fix

Run the following commands to confirm everything passes:

pytest tests/backend/test_indexer_and_embeddings.py -v
python3 scripts/generate_requirements.py
pytest tests/backend/test_requirements_sync.py

spelech and others added 2 commits October 28, 2026 01:57
…lback

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
}
except ValueError as ve:
logger.warning(f"Validation error updating embedding settings: {ve}")
return JSONResponse(status_code=400, content={"status": "error", "error": str(ve), "message": str(ve)})
@spelech
spelech merged commit 2a9997e into main Oct 28, 2026
10 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.

fix(embeddings): require explicit opt-in and compatible models for local-to-API fallback

2 participants