Skip to content

fix: embedMany over-batches @ai-sdk/google embedding models - #16575

Merged
lgrammel merged 2 commits into
mainfrom
bugfix/16101-2
Jul 2, 2026
Merged

fix: embedMany over-batches @ai-sdk/google embedding models#16575
lgrammel merged 2 commits into
mainfrom
bugfix/16101-2

Conversation

@lgrammel

@lgrammel lgrammel commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Background

Google Gemini batch embedding requests are capped at 100 items, but @ai-sdk/google advertised 2048, causing embedMany to send oversized batches and receive 400 errors for inputs over 100 values.

Summary

Changed GoogleEmbeddingModel.maxEmbeddingsPerCall from 2048 to 100 so embedMany chunks Google embedding requests within the API limit.

Testing

Updated Google embedding model regression coverage to assert the 100-item batch limit and the TooManyEmbeddingValuesForCallError behavior at 101 values.

Related Issues

Fixes #16101

@lgrammel
lgrammel merged commit bd8d172 into main Jul 2, 2026
54 checks passed
@lgrammel
lgrammel deleted the bugfix/16101-2 branch July 2, 2026 14:17
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🚀 Published in:

Package Version
ai 7.0.12 github npm
@ai-sdk/alibaba 2.0.5 github npm
@ai-sdk/amazon-bedrock 5.0.9 github npm
@ai-sdk/angular 3.0.12 github npm
@ai-sdk/anthropic 4.0.6 github npm
@ai-sdk/assemblyai 3.0.4 github npm
@ai-sdk/azure 4.0.6 github npm
@ai-sdk/baseten 2.0.4 github npm
@ai-sdk/black-forest-labs 2.0.4 github npm
@ai-sdk/bytedance 2.0.5 github npm
@ai-sdk/cerebras 3.0.4 github npm
@ai-sdk/cohere 4.0.4 github npm
@ai-sdk/deepgram 3.0.4 github npm
@ai-sdk/deepinfra 3.0.4 github npm
@ai-sdk/deepseek 3.0.4 github npm
@ai-sdk/elevenlabs 3.0.5 github npm
@ai-sdk/fal 3.0.5 github npm
@ai-sdk/fireworks 3.0.5 github npm
@ai-sdk/gateway 4.0.9 github npm
@ai-sdk/gladia 3.0.4 github npm
@ai-sdk/google 4.0.7 github npm
@ai-sdk/google-vertex 5.0.9 github npm
@ai-sdk/groq 4.0.4 github npm
@ai-sdk/harness 1.0.15 github npm
@ai-sdk/harness-claude-code 1.0.15 github npm
@ai-sdk/harness-codex 1.0.16 github npm
@ai-sdk/harness-deepagents 1.0.14 github npm
@ai-sdk/harness-opencode 1.0.15 github npm
@ai-sdk/harness-pi 1.0.15 github npm
@ai-sdk/huggingface 2.0.4 github npm
@ai-sdk/hume 3.0.4 github npm
@ai-sdk/klingai 4.0.5 github npm
@ai-sdk/langchain 3.0.12 github npm
@ai-sdk/llamaindex 3.0.12 github npm
@ai-sdk/lmnt 3.0.4 github npm
@ai-sdk/luma 3.0.5 github npm
@ai-sdk/mcp 2.0.6 github npm
@ai-sdk/mistral 4.0.4 github npm
@ai-sdk/moonshotai 3.0.6 github npm
@ai-sdk/open-responses 2.0.4 github npm
@ai-sdk/openai 4.0.6 github npm
@ai-sdk/openai-compatible 3.0.4 github npm
@ai-sdk/otel 1.0.12 github npm
@ai-sdk/perplexity 4.0.5 github npm
@ai-sdk/policy-opa 1.0.12 github npm
@ai-sdk/prodia 2.0.5 github npm
@ai-sdk/provider-utils 5.0.4 github npm
@ai-sdk/quiverai 2.0.4 github npm
@ai-sdk/react 4.0.13 github npm
@ai-sdk/replicate 3.0.5 github npm
@ai-sdk/revai 3.0.4 github npm
@ai-sdk/rsc 3.0.12 github npm
@ai-sdk/sandbox-just-bash 1.0.15 github npm
@ai-sdk/sandbox-vercel 1.0.15 github npm
@ai-sdk/svelte 5.0.12 github npm
@ai-sdk/togetherai 3.0.5 github npm
@ai-sdk/tui 1.0.12 github npm
@ai-sdk/valibot 3.0.4 github npm
@ai-sdk/vercel 3.0.4 github npm
@ai-sdk/voyage 2.0.4 github npm
@ai-sdk/vue 4.0.12 github npm
@ai-sdk/workflow 1.0.12 github npm
@ai-sdk/workflow-harness 1.0.15 github npm
@ai-sdk/xai 4.0.5 github npm

gr2m pushed a commit that referenced this pull request Jul 6, 2026
…16760)

## Background

Google Gemini batch embedding requests are capped at 100 items, but
@ai-sdk/google advertised 2048, causing embedMany to send oversized
batches and receive 400 errors for inputs over 100 values.

## Summary

Changed GoogleEmbeddingModel.maxEmbeddingsPerCall from 2048 to 100 so
embedMany chunks Google embedding requests within the API limit.

## Testing

Updated Google embedding model regression coverage to assert the
100-item batch limit and the TooManyEmbeddingValuesForCallError behavior
at 101 values.

## Related Issues

Fixes #16101

Backport of #16575
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

embedMany over-batches @ai-sdk/google embedding models

2 participants