Repository navigation
fix(inference): let embedding requests omit dimensions - #1755
Merged
PsiACE merged 1 commit intoSep 28, 2026
Merged
Conversation
SiliconFlow BAAI/bge-m3 rejects the dimensions field. Keep the stored dimension required, and add a switch that still sends it by default.
knqiufan
requested review from
AlexStocks,
PsiACE,
Teingi,
frostming and
zhanghuidinah
as code owners
September 28, 2026 01:44
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.
Which issue or RFC does this PR close?
Closes #1754.
Rationale for this change
#1386 always sends the configured embedding dimension as the OpenAI-compatible
dimensionsfield. Models that accept the field, such astext-embedding-3, still need that behavior. SiliconFlowBAAI/bge-m3does not accept the field at all. Its output width is fixed at 1024, and a request that includesdimensionsreturns HTTP 400 (code20015,The parameter is invalid). Memory writes then fail while attaching embeddings.EMBEDDING_DIMENSIONcannot be omitted to work around this. The model, profile ID, and dimension must be configured together, and that dimension is the stored vector width.embedding_model_settingsalso cannot suppress the field, because composition overwrites it with the profile dimension.What changes are included in this PR?
embedding_send_dimensions/POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_SEND_DIMENSIONS, defaulttrue.true, embedding requests still send the profile dimension and still override adimensionsvalue in model settings. This keeps the fix: pass embedding dimension to provider and surface sqlite-vec probe failures #1386 behavior.false, the provider request omitsdimensions, including adimensionsentry from model settings. Returned vectors are still validated againstEMBEDDING_DIMENSION..env.example(English and Chinese).No persisted format, HTTP API, or profile identity change. Existing deployments keep sending
dimensionsuntil the new variable is set tofalse.Are there any user-facing changes?
Operators of a fixed-dimension model can set:
POWERCONTEXT_SERVER_INFERENCE_EMBEDDING_DIMENSIONstays required. For SiliconFlowBAAI/bge-m3, keep it at1024.The default remains
true, so providers that requiredimensionsare unchanged.How was this change tested?
26 tests passed. Ruff check and format check passed.
The new wire test remembers one entry with
embedding_send_dimensions=falseand asserts every/v1/embeddingsbody has nodimensionskey while other settings remain. The existing endpoint test still assertsdimensions == 3when the switch is left at its default.AI usage statement
Grok 4.7 assisted with the implementation, tests, and this description. The change was limited to the embedding dimensions switch and reviewed against the existing #1386 send behavior.