Skip to content

feat: enable VLMs - #126

Merged
jakelorocco merged 11 commits into
mainfrom
hen/vlm
Sep 10, 2025
Merged

jakelorocco merged 11 commits into
mainfrom
hen/vlm

Conversation

@HendrikStrobelt

@HendrikStrobelt HendrikStrobelt commented Sep 9, 2025 •

Copy link
Copy Markdown
Contributor

Enable image handling for VLMs on Ollama, OpenAI, LiteLLM backends.
HF and Wx currently only supported through LiteLLM

- new ImageCBlock
- images argument for `m.instruct` and `Instruction`
- `get_images_from_component(c)` method to extract images from components
- formatter handles images now
- new formatting from Mellea Message to OpenAI message
- [patch] tool calling patch to work with multiple OpenAI-compatible inference engines
@mergify

mergify Bot commented Sep 9, 2025 •

Copy link
Copy Markdown

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?:

@HendrikStrobelt HendrikStrobelt changed the title enable VLMs feat: enable VLMs Sep 9, 2025
Comment thread mellea/stdlib/base.py Resolved
Comment thread mellea/backends/formatter.py Resolved
Comment thread mellea/backends/openai.py Resolved
Comment thread mellea/stdlib/instruction.py Resolved
- valid png base64 testing
- better `get_images_from_component`
- adding images to TemplateRepr
- using images from TR for Message construction
@HendrikStrobelt
HendrikStrobelt marked this pull request as ready for review September 9, 2025 21:33

@jakelorocco jakelorocco 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.

looks like a test is failing due to the new message field as well

Comment thread mellea/backends/formatter.py Resolved
fix test failure
@nrfulton

Copy link
Copy Markdown
Member

Needs tests, but we will merge now. Opened #128 to track.

@jakelorocco
jakelorocco merged commit 629cd9b into main Sep 10, 2025
@jakelorocco
jakelorocco deleted the hen/vlm branch September 10, 2025 14:33
akihikokuroda pushed a commit to akihikokuroda/mellea that referenced this pull request May 27, 2026
* started VLM for Ollama:
- new ImageCBlock
- images argument for `m.instruct` and `Instruction`
- `get_images_from_component(c)` method to extract images from components
- formatter handles images now

* VLM for OpenAI backend:
- new formatting from Mellea Message to OpenAI message
- [patch] tool calling patch to work with multiple OpenAI-compatible inference engines

* - ImageCBlock --> ImageBlock
- valid png base64 testing
- better `get_images_from_component`
- adding images to TemplateRepr
- using images from TR for Message construction

* - m.instruct takes list of PIL as well now.

* - m.chat takes images now

* - fixing openai tool args

* LiteLLM uses OPENAI formatting for VLMs.

* better pretty print for Message images

* examples for using vision models with different backends.

* change formatter cases
fix test failure
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