Skip to content

fix: litellm embedding dimension adapts#1323

Merged
qin-ctx merged 2 commits intovolcengine:mainfrom
MaojiaSheng:main
Apr 9, 2026
Merged

fix: litellm embedding dimension adapts#1323
qin-ctx merged 2 commits intovolcengine:mainfrom
MaojiaSheng:main

Conversation

@MaojiaSheng
Copy link
Copy Markdown
Collaborator

No description provided.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ MaojiaSheng
❌ openviking


openviking seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@qin-ctx qin-ctx merged commit adc2276 into volcengine:main Apr 9, 2026
3 of 8 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Apr 9, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🏅 Score: 90
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ Recommended focus areas for review

Edge Case Handling

The current code only truncates vectors longer than the target dimension. If the embedding model returns a vector shorter than the configured dimension, downstream code expecting exactly dimension elements may break. Consider either padding with zeros or raising an explicit error in this case.

def _truncate_vector(self, vector: List[float]) -> List[float]:
    """Truncate vector to target dimension if needed.

    Args:
        vector: Input vector from API

    Returns:
        Truncated vector if dimension is set and smaller than input, otherwise original vector
    """
    if self.dimension is not None and len(vector) > self.dimension:
        return vector[: self.dimension]
    return vector

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

PR Code Suggestions ✨

No code suggestions found for the PR.

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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants