-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: send base64 images without data URL prefix to LM Studio #8828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
LM Studio expects raw base64 encoded image data without the data: URL prefix. This fix adds an optional lmStudioFormat parameter to convertToOpenAiMessages that strips the prefix when sending images to LM Studio. Fixes #8827
Review CompleteNo issues found. The implementation correctly handles LM Studio's requirement for raw base64 image data by:
The fix is well-isolated and properly tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No issues found.
|
Now there is a different error in LM Studio: [Server Error] Invalid url 2025-10-25 19:10:07 [DEBUG] |
|
I have tracked down the issue - LMStudio wants images in PNG format, not webP. I'll submit a PR with a fix for this. |
Description
This PR fixes an issue where LM Studio was receiving images with data URL prefixes (
data:image/png;base64,) when it expects raw base64 encoded data only.Problem
When using the Web Browser Tool with vision-capable models in LM Studio, users were encountering the error:
[Server Error] 'url' field must be a base64 encoded imageSolution
lmStudioFormatparameter toconvertToOpenAiMessagesfunctionTesting
Related Issue
Fixes #8827
Type of Change
Checklist
Important
Adds
lmStudioFormatparameter to handle base64 images without data URL prefix for LM Studio inconvertToOpenAiMessages.lmStudioFormatparameter toconvertToOpenAiMessagesinopenai-format.tsto strip data URL prefix from base64 images.LmStudioHandlerinlm-studio.tsto uselmStudioFormatparameter.openai-format.spec.tsfor both default and LM Studio formats.This description was created by
for 629830d. You can customize this summary. It will automatically update as commits are pushed.