LocalAI icon indicating copy to clipboard operation
LocalAI copied to clipboard

Add emu3 support to the `transformers` backend

Open mudler opened this issue 2 years ago • 7 comments

Is your feature request related to a problem? Please describe.

https://github.com/baaivision/Emu3

Describe the solution you'd like

Describe alternatives you've considered

Additional context

mudler avatar Sep 28 '24 15:09 mudler

@mudler if you have some context to provide on the integration of this i could look into adding this

siddimore avatar Oct 01 '24 18:10 siddimore

@mudler if you have some context to provide on the integration of this i could look into adding this

that'd be great! As now emu3 seems to be working directly with transformers it would not need an entire backend from scratch, but actually adapting the existing transformers one to support how to run emu3 models (see https://github.com/baaivision/Emu3?tab=readme-ov-file#quickstart for example). The transformer backend is here https://github.com/mudler/LocalAI/tree/master/backend/python/transformers

mudler avatar Oct 02 '24 14:10 mudler

Hi @mudler 👋

I'd like to work on this feature. Before diving in, I wanted to confirm my approach:

Proposed Implementation:

  1. Start with Emu3-Chat support (vision-language understanding) as the simpler path:

    • Add new model type handler in the transformers backend
    • Load main model (BAAI/Emu3-Chat) + VisionTokenizer (BAAI/Emu3-VisionTokenizer)
    • Integrate Emu3Processor via trust_remote_code=True
    • Handle image inputs for the Predict endpoint
  2. Follow-up PR for Emu3-Gen (text-to-image generation):

    • More complex due to LogitsProcessorList, classifier-free guidance, and decoding vision tokens back to images
    • Would need integration with GenerateImage endpoint or a new method

Questions:

  • Does this phased approach make sense, or would you prefer both capabilities in a single PR?
  • Should this live in the existing transformers backend, or would a separate emu3 backend be preferred given the multimodal complexity?

Let me know your thoughts!

mkdev5 avatar Feb 04 '26 05:02 mkdev5

Hi @MkDev11 - to be fair the emu3 suite is slightly out of my radar now, there are many more powerful models already available. I think there are more interesting issues to pick from the ones labeled as roadmap ( https://github.com/mudler/LocalAI/issues?q=state%3Aopen%20label%3Aroadmap ).

However, if you feel to take a stab at it I don't mind. I would prefer that we keep in transformers, or either the vllm backend the implementation, as it seems also vllm supports emu3 nowadays.

mudler avatar Feb 04 '26 15:02 mudler

Thanks for letting me know.

On Wed, Feb 4, 2026 at 12:20 PM Ettore Di Giacinto @.***> wrote:

mudler left a comment (mudler/LocalAI#3685) https://github.com/mudler/LocalAI/issues/3685#issuecomment-3848198781

Hi @MkDev11 https://github.com/MkDev11 - to be fair the emu3 suite is slightly out of my radar now, there are many more powerful models already available. I think there are more interesting issues to pick from the ones labeled as roadmap ( https://github.com/mudler/LocalAI/issues?q=state%3Aopen%20label%3Aroadmap ).

However, if you feel to take a stab at it I don't mind. I would prefer that we keep in transformers, or either the vllm backend the implementation, as it seems also vllm supports emu3 nowadays.

— Reply to this email directly, view it on GitHub https://github.com/mudler/LocalAI/issues/3685#issuecomment-3848198781, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWOUTY6UQ2RKN6EW4KNTRQ34KIS5TAVCNFSM6AAAAACT5GHIDOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTQNBYGE4TQNZYGE . You are receiving this because you were mentioned.Message ID: @.***>

mkdev5 avatar Feb 04 '26 19:02 mkdev5

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.

github-actions[bot] avatar May 06 '26 02:05 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar May 11 '26 02:05 github-actions[bot]