Repository navigation
fix(embeddings): leave out every embedding fallback but Ollama behind Ollama (#853) - #865
Merged
Merged
Conversation
… Ollama Closes #853. Setup builds one embedding client per provider type (per server for Ollama), so a second OpenAI-compatible, OpenAI or Gemini provider in the embedding chain resolved to the primary's own client and was dropped by the chain's identity check without a word. Rather than give each OpenAI-compatible server its own client, enforce the rule the #751 form and repair text already state: split_embedding_chain keeps a fallback only when it and the primary are both Ollama, whose build is checked against the primary's (#855). Two OpenAI-compatible servers can serve other weights under one model name, which nothing can check. - A chosen fallback left out raises the embedding_fallback_other_model repair (WARNING); one HGA added on its own logs at INFO. The repair text now gives both reasons: no failover for a second OpenAI or Gemini provider, possibly mixed models otherwise (en, cs, zh-Hans). - The size check (#760) measures only a non-Ollama primary, with the primary's own client. The fallback size issue, added after the last pre-release and never raised, is removed with its strings. - Text that still described Ollama fallbacks behind a non-Ollama primary (the Ollama fallback size repair, docs, code comments) is updated. - TODOS: the size issue is cleared on every unload, so an unmeasured primary loses it across a reload (pre-existing, #760). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019kuwyteUa5Q6rkkB8hgwwj
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #853.
What was wrong
Setup builds one embedding client per provider type (one per server for Ollama). A second OpenAI-compatible server in the embedding chain therefore got the primary's own client. After the #751 review, the chain dropped it as a duplicate and logged nothing, so the fallback the user picked was never used. A second OpenAI or Gemini provider was dropped the same way.
Decision
We are not giving each OpenAI-compatible server its own client. Instead this enforces the rule that the #751 form and repair text already state: an embedding fallback is kept only when the primary and the fallback are both Ollama. Each Ollama server's build of the model is checked against the primary's (#855). Two OpenAI-compatible servers can serve different weights under the same model name, and nothing can check that, so failing over between them could mix models in the memory store without anyone noticing.
Changes
split_embedding_chainleaves out every other fallback.embedding_fallback_other_modelrepair and logs a WARNING.fallback_embedding_dims_mismatchissue and its strings. It was added after v3.45.0-beta.4 and could no longer be raised, so no installed release has it.docs/configuration.mdand code comments.Users who saved a same-type non-Ollama embedding fallback before #751 will now see the repair issue after upgrading. Saving the Embeddings feature clears it.
Testing
make lintpasses andmake typecheckreports 0 errors.make test: 6470 passed, 1 skipped.Review
gstack
/reviewconverged after 3 cycles (2 of them made edits)._embedding_instance_for_providerShips in the 3.45.0 bundle.
🤖 Generated with Claude Code
https://claude.ai/code/session_019kuwyteUa5Q6rkkB8hgwwj