Skip to content

Support batch size in embedder#884

Merged
malatewang merged 1 commit into
mainfrom
embedder_batch
May 1, 2026
Merged

Support batch size in embedder#884
malatewang merged 1 commit into
mainfrom
embedder_batch

Conversation

@malatewang

@malatewang malatewang commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

Purpose of the change

Add a configurable parameter, batch_size, to embedder.

Description

Some platforms have limit on the batch size for each embedding request. This PR adds support for a new configuration paramter, batch_size, for the embedder. If the request batch size exceeds the configured batch size, multiple embedding request will be issued for the embedding.

Fixes/Closes

Fixes #864

Type of change

[Please delete options that are not relevant.]

  • Bug fix (non-breaking change which fixes an issue)
  • [] New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Refactor (does not change functionality, e.g., code style improvements, linting)
  • Documentation update
  • Project Maintenance (updates to build scripts, CI, etc., that do not affect the main project)
  • Security (improves security without changing functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

[Please delete options that are not relevant.]

  • [] Unit Test
  • Integration Test
  • End-to-end Test
  • Test Script (please provide)
  • Manual verification (list step-by-step instructions)

Test Results: [Attach logs, screenshots, or relevant output]

Checklist

[Please delete options that are not relevant.]

  • [] I have signed the commit(s) within this pull request
  • My code follows the style guidelines of this project (See STYLE_GUIDE.md)
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added unit tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

  • [] Confirmed all checks passed
  • Contributor has signed the commit(s)
  • Reviewed the code
  • Run, Tested, and Verified the change(s) work as expected

Screenshots/Gifs

[If applicable, add screenshots or GIFs that show the changes in action. This is especially helpful for API responses. Otherwise, delete this section or type "N/A".]

Further comments

[Add any other relevant information here, such as potential side effects, future considerations, or any specific questions for the reviewer. Otherwise, type "None".]

@edwinyyyu

Copy link
Copy Markdown
Contributor

Changes may conflict with #744.

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. If you are still working on this, please push a commit or leave a comment. Reviewers: please respond, or add the keep-open label if this PR should be held open for a longer review cycle.

@edwinyyyu edwinyyyu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make sense to have each XXXEmbedderParams type inherit from a common BaseModel-derived type if the batch size is meant to be common. Can be a separate PR to unify a bunch of shared embedding behavior.

@github-actions github-actions Bot removed the Stale label May 1, 2026
@malatewang malatewang merged commit eb71fd5 into main May 1, 2026
52 checks passed
@malatewang malatewang deleted the embedder_batch branch May 1, 2026 17:01
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.

[Bug]: 'Value error, batch size is invalid' when using aliyun dashscope

3 participants