You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
add wrapEmbeddingModel to allow overwriting dimensions #7947
ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelfeatureNew feature or requestmerged-mainprovider/openaiIssues related to the @ai-sdk/openai providertask-identify-issue-type-done
I would like to request a wrapEmbeddingModel function similar to the existing wrapLanguageModel function to allow overwriting the dimensions for an embedding model:
changed the title [-][Feature] add `wrapEmbeddingModel` to allow overwriting dimensions[/-][+]add `wrapEmbeddingModel` to allow overwriting dimensions[/+]on Aug 11, 2025
Hi @gr2m , This pattern should work for OpenAI and other embedding models as well, since it uses embeddingModelV3 shared base property providerOptions that directly bind properties to the specific model.
This is an API expansion and ergonomics request for embedding-model middleware, not a report of broken existing behavior.
Evidence
The issue requests a new wrapEmbeddingModel API analogous to wrapLanguageModel.
The intended capability is to apply default provider options such as OpenAI embedding dimensions.
The comment references an embedding middleware implementation and shared providerOptions, but does not report a concrete failure of documented behavior.
ai/corecore functions like generateText, streamText, etc. Provider utils, and provider spec.ai/providerrelated to a provider package. Must be assigned together with at least one `provider/*` labelfeatureNew feature or requestmerged-mainprovider/openaiIssues related to the @ai-sdk/openai providertask-identify-issue-type-done
Activity
[-][Feature] add `wrapEmbeddingModel` to allow overwriting dimensions[/-][+]add `wrapEmbeddingModel` to allow overwriting dimensions[/+]0xlakshan commentedon Oct 16, 2025
Hi @gr2m , This pattern should work for
OpenAIand other embedding models as well, since it usesembeddingModelV3shared base propertyproviderOptionsthat directly bind properties to the specific model.ai/packages/provider/src/embedding-model/v3/embedding-model-v3.ts
Lines 68 to 73 in 34407b2
And in here any custom provider specific options like
dimensionsandclassificationTypesare bound through params, anddoTransform.ai/packages/ai/src/middleware/wrap-embedding-model.ts
Lines 53 to 59 in ad4d806
ai/packages/ai/src/middleware/wrap-embedding-model.ts
Lines 61 to 83 in ad4d806
feat: embedding model middleware (#9437)
lgrammel commentedon Jul 22, 2026
Identify issue type
Identified as Feature
Confidence: High
Rationale
This is an API expansion and ergonomics request for embedding-model middleware, not a report of broken existing behavior.
Evidence
wrapEmbeddingModelAPI analogous towrapLanguageModel.providerOptions, but does not report a concrete failure of documented behavior.