Skip to content

Praveeni/vlm benchmark support#7

Merged
praveen-iyer merged 10 commits intomainfrom
praveeni/vlm-benchmark-support
Feb 18, 2026
Merged

Praveeni/vlm benchmark support#7
praveen-iyer merged 10 commits intomainfrom
praveeni/vlm-benchmark-support

Conversation

@praveen-iyer
Copy link
Copy Markdown
Collaborator

@praveen-iyer praveen-iyer commented Feb 17, 2026

Summary

Add support for benchmarking Vision-Language Models (VLMs) served via Lemonade Server, alongside the existing text-only LLM benchmarking.

Changes

  • --image flag: Provide an image file path or URL to the bench tool. Each benchmark iteration sends a multimodal prompt (image + text) using the OpenAI chat completions format.
  • --image-size flag: Resize the image client-side before sending to control visual token count. Accepts WIDTHxHEIGHT (e.g. 1024x800) for exact dimensions or a single integer (e.g. 384) to cap the longest side while preserving aspect ratio.
  • VLM prompt prefix: When --image is used, the synthetic prompt prefix is replaced with one that encourages detailed image description for longer output.
  • README: Added VLM benchmarking section with usage examples.

Example Output

image

praveeni added 4 commits February 16, 2026 16:45
Add --image flag to the bench tool to enable benchmarking VLM models
served via Lemonade Server. When an image file path or URL is provided,
the benchmark sends multimodal prompts (image + text) using the OpenAI
chat completions format. The -p flag controls the text portion of the
prompt while image tokens are handled by the server.

- Add _prepare_image_url() to ServerAdapter for base64/URL image handling
- Add image parameter to ServerAdapter.generate() with multimodal payload
- Add --image CLI argument to ServerBench parser
- Add VLM-specific prompt prefix for image description benchmarks
- Override parse() in ServerBench to extract image before prompt processing
- Existing text-only LLM benchmarking is completely unaffected
Replace the --image-detail flag (low/high/auto) with --image-size which
accepts either WIDTHxHEIGHT (e.g. 1024x800) for exact dimensions or a
single integer (e.g. 384) to cap the longest side while preserving
aspect ratio. The image is resized client-side using Pillow before
base64 encoding, which reduces visual token count to fit within the
model's context window.
Document the --image and --image-size flags for Vision-Language Model
benchmarking, with examples showing exact dimensions and aspect-ratio-
preserving resize modes.
@praveen-iyer praveen-iyer marked this pull request as ready for review February 17, 2026 20:12
Copy link
Copy Markdown

@ramkrishna2910 ramkrishna2910 left a comment

Choose a reason for hiding this comment

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

Feature works, added a few comments.

Comment thread src/lemonade/tools/server_load.py
Comment thread src/lemonade/tools/server_bench.py
Comment thread src/lemonade/tools/server_load.py Outdated
Comment thread src/lemonade/tools/server_load.py
@amd-pworfolk
Copy link
Copy Markdown
Contributor

@praveen-iyer Great addition! Can you also extend the llm-prompt tool to allow an image to be passed in? This allows the user to run llm-prompt prior to running the bench tool in order to verify that everything is working as expected (e.g., model producing good output, etc.).

Copy link
Copy Markdown

@ramkrishna2910 ramkrishna2910 left a comment

Choose a reason for hiding this comment

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

Image LGTM! Thanks for the contribution!

@praveen-iyer
Copy link
Copy Markdown
Collaborator Author

@praveen-iyer Great addition! Can you also extend the llm-prompt tool to allow an image to be passed in? This allows the user to run llm-prompt prior to running the bench tool in order to verify that everything is working as expected (e.g., model producing good output, etc.).

Thanks for the idea. I'm hoping to address this as part of a new PR as we need this PR to be merged soon for an engagement!

@praveen-iyer praveen-iyer merged commit 2968532 into main Feb 18, 2026
2 checks passed
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.

3 participants