AnyModal – A Framework for Multimodal LLMs

GitHub: https://github.com/ritabratamaiti/AnyModal
Reddit: https://www.reddit.com/r/AnyModal/

Hi everyone,

I’d like to share a project I’ve been working on: AnyModal, a modular and extensible framework for integrating diverse input modalities (like images, audio, and structured data) into large language models (LLMs). It simplifies the process of combining different input types with LLMs, enabling tasks like image captioning, LaTeX OCR, and even chest X-ray interpretation.

Why I Built This

Existing tools for multimodal systems often focus on specific tasks or are tightly coupled to particular models. I wanted a framework that could handle a wide variety of modalities with minimal setup, allowing researchers and developers to quickly prototype and experiment with new multimodal systems. That’s where AnyModal comes in.

What AnyModal Does

AnyModal abstracts away much of the boilerplate in building multimodal LLMs:

  • Seamless integration of different modalities through tokenization and embedding.
  • Flexibility to plug in pre-trained models (e.g., ViT for images) as feature encoders.
  • Simple projection layers to align modality-specific embeddings with the LLM token space.

Example Use Case

Here’s a typical workflow:
You can take an image, process it with a vision transformer (like ViT), project the embeddings to match the LLM’s token space, and pass it to the LLM for tasks like caption generation or question answering. Similarly, you could handle audio inputs by encoding them into embeddings and integrating them into the LLM pipeline.

Current Demos

  • LaTeX OCR
  • Chest X-Ray Captioning (in progress)
  • Image Captioning
  • Visual Question Answering (planned)
  • Audio Captioning (planned)

What’s Next

AnyModal is still a work in progress, and I’m planning to expand its capabilities with more demos and better support for different modalities. I’d love feedback or contributions from anyone interested in this space.

Let me know what you think or if you have any questions!

1 Like