Skip to content

fix: default embed size#192

Merged
sairin1202 merged 2 commits intomainfrom
bug/default_embed_size
Jan 9, 2026
Merged

fix: default embed size#192
sairin1202 merged 2 commits intomainfrom
bug/default_embed_size

Conversation

@sairin1202
Copy link
Contributor

  • change default embed size from 25 to 1
  • openai api has the max embed size 25
Copilot AI review requested due to automatic review settings January 9, 2026 01:20
@sairin1202 sairin1202 merged commit 144fd32 into main Jan 9, 2026
3 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request changes the default embed_batch_size parameter from 25 to 1 across the codebase. According to the PR description, this is motivated by a claim that "openai api has the max embed size 25", however this appears to be incorrect based on OpenAI's actual API limits.

Key changes:

  • Reduced default embed_batch_size from 25 to 1 in the OpenAISDKClient constructor
  • Updated the corresponding default value in the LLMConfig settings class

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/memu/llm/openai_sdk.py Changed default embed_batch_size parameter from 25 to 1 in OpenAISDKClient.init
src/memu/app/settings.py Changed default embed_batch_size field from 25 to 1 in LLMConfig class

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

chat_model: str,
embed_model: str,
embed_batch_size: int = 25,
embed_batch_size: int = 1,
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The change to reduce the default embed_batch_size from 25 to 1 appears problematic. According to the OpenAI API documentation, the embeddings endpoint supports batching up to 2048 inputs per request. The PR description states "openai api has the max embed size 25" which appears to be incorrect. Reducing the batch size to 1 would significantly increase the number of API calls required for embedding multiple texts, leading to increased latency and potentially higher costs. Unless there's a specific issue with batching that needs to be addressed, consider keeping the default at 25 or even increasing it for better performance.

Suggested change
embed_batch_size: int = 1,
embed_batch_size: int = 25,
Copilot uses AI. Check for mistakes.
)
embed_batch_size: int = Field(
default=25,
default=1,
Copy link

Copilot AI Jan 9, 2026

Choose a reason for hiding this comment

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

The change to reduce the default embed_batch_size from 25 to 1 appears problematic. According to the OpenAI API documentation, the embeddings endpoint supports batching up to 2048 inputs per request. The PR description states "openai api has the max embed size 25" which appears to be incorrect. Reducing the batch size to 1 would significantly increase the number of API calls required for embedding multiple texts, leading to increased latency and potentially higher costs. Unless there's a specific issue with batching that needs to be addressed, consider keeping the default at 25 or even increasing it for better performance.

Suggested change
default=1,
default=25,
Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants