LLaVA-Mini

ictnlpApache-2.0长期未更新

统一的多模态大模型,能高效理解图像、高分辨率图像和视频,用极少的视觉 token 完成多模态推理,适合显存和算力受限的场景。

LLaVA-Mini is a unified large multimodal model (LMM) that can support the understanding of images, high-resolution images, and videos in an efficient manner.

暂无版本573star34fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
conda create -n llavamini python=3.10 -y
conda activate llavamini
pip install -e .
pip install -e ".[train]"
pip install flash-attn --no-build-isolation
硬件要求按 README 说明

需要 NVIDIA GPU(脚本用 CUDA_VISIBLE_DEVICES 指定);显存低于 20GB 时可加 --load-8bit;24GB 显存可处理超 10000 帧视频。README 未说明 CPU 运行方式。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

用单个视觉 token 压缩图像和视频输入的多模态大模型,显著降低显存与延迟

统一的多模态大模型,能高效理解图像、高分辨率图像和视频,用极少的视觉 token 完成多模态推理,适合显存和算力受限的场景。

核心能力

  • 每张图片仅用 1 个视觉 token 表示,替代 576 个
  • FLOPs 降低 77%,响应延迟从 100ms 降到 40ms
  • 单图显存占用从 360MB 降到 0.6MB,支持 3 小时视频
  • 在 24GB 显存 GPU 上可处理超过 10000 帧视频
  • 提供 Gradio 网页交互 demo 和命令行图像/视频推理脚本

容易踩的坑

需从 HuggingFace 下载 ICTNLP/llava-mini-llama-3.1-8b 模型权重;flash-attn 需加 --no-build-isolation 安装;显存不足 20GB 时要加 --load-8bit,否则可能 OOM。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

0 个版本

暂无 release 数据(可能没有发版,或尚未同步)。

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    LLaVA-Mini: Efficient Image and Video Large Multimodal Models with One Vision Token

    arXiv model Hits

    Shaolei Zhang, Qingkai Fang, Zhe Yang, Yang Feng*

    LLaVA-Mini is a unified large multimodal model that can support the understanding of images, high-resolution images, and videos in an efficient manner. Guided by the interpretability within LMM, LLaVA-Mini significantly improves efficiency while ensuring vision capabilities. Model and demo of LLaVA-Mini are available now!

    [!Note] LLaVA-Mini only requires 1 token to represent each image, which improves the efficiency of image and video understanding, including:

    • Computational effort: 77% FLOPs reduction
    • Response latency: reduce from 100 milliseconds to 40 milliseconds
    • VRAM memory usage: reduce from 360 MB/image to 0.6 MB/image, support 3-hour video processing

    💡Highlight:

    1. Good Performance: LLaVA-Mini achieves performance comparable to LLaVA-v1.5 while using only 1 vision token instead of 576 (compression rate of 0.17%).
    2. High Efficiency: LLaVA-Mini can reduce FLOPs by 77%, deliver low-latency responses within 40 milliseconds, and process over 10,000 frames of video on the GPU hardware with 24GB of memory.
    3. Insights: To develop LLaVA-Mini, which reduces vision tokens while maintaining visual understanding, we conduct a preliminary analysis to explore how large multimodal models (LMMs) process visual tokens. Please refer to our paper for a detailed analysis and our conclusions.

    🖥 Demo

    • Download LLaVA-Mini model from here.

    • Run these scripts and Interact with LLaVA-Mini in your browser:

      # Launch a controller
      python -m llavamini.serve.controller --host 0.0.0.0 --port 10000 &
      
      # Build the API of LLaVA-Mini, if the VRAM memory is less than 20GB, try using --load-8bit
      CUDA_VISIBLE_DEVICES=0  python -m llavamini.serve.model_worker --host 0.0.0.0 --controller http://localhost:10000 --port 40000 --worker http://localhost:40000 --model-path ICTNLP/llava-mini-llama-3.1-8b --model-name llava-mini &
      
      # Start the interactive interface
      python -m llavamini.serve.gradio_web_server --controller http://localhost:10000 --model-list-mode reload  --port 7860
      

    🔥 Quick Start

    Requirements

    • Install packages:

      conda create -n llavamini python=3.10 -y
      conda activate llavamini
      pip install -e .
      pip install -e ".[train]"
      pip install flash-attn --no-build-isolation
      

    Command Interaction

    • Image understanding, using --image-file.

    • If the VRAM memory is less than 20GB, try using --load-8bit.

      # Image Understanding
      CUDA_VISIBLE_DEVICES=0 python llavamini/eval/run_llava_mini.py \
          --model-path  ICTNLP/llava-mini-llama-3.1-8b \
          --image-file llavamini/serve/examples/baby_cake.png \
          --conv-mode llava_llama_3_1 --model-name "llava-mini" \
          --query "What's the text on the cake?"
      
    • Video understanding, using --video-file:

      # Video Understanding
      CUDA_VISIBLE_DEVICES=0 python llavamini/eval/run_llava_mini.py \
          --model-path  ICTNLP/llava-mini-llama-3.1-8b \
          --video-file llavamini/serve/examples/fifa.mp4 \
          --conv-mode llava_llama_3_1 --model-name "llava-mini" \
          --query "What happened in this video?"
      

    Reproduction and Evaluation

    • Refer to Evaluation.md for the evaluation of LLaVA-Mini on image/video benchmarks.

    Cases

    • LLaVA-Mini achieves high-quality image understanding and video understanding.
    • LLaVA-Mini dynamically compresses image to capture important visual information (brighter areas are more heavily weighted during compression).

    🤝 Acknowledgement

    • LLaVA: LLaVA-Mini is built upon LLaVA codebase, a large language and vision assistant.
    • Video-ChatGPT: The training of LLaVA-Mini involves the video instruction data provided by Video-ChatGPT.
    • LLaVA-OneVision: The training of LLaVA-Mini involves the image instruction data provided by LLaVA-OneVision.

    🖋Citation

    If this repository is useful for you, please cite as:

    @misc{llavamini,
          title={LLaVA-Mini: Efficient Image and Video Large Multimodal Models with One Vision Token}, 
          author={Shaolei Zhang and Qingkai Fang and Zhe Yang and Yang Feng},
          year={2025},
          eprint={2501.03895},
          archivePrefix={arXiv},
          primaryClass={cs.CV},
          url={https://arxiv.org/abs/2501.03895}, 
    }
    

    If you have any questions, please feel free to submit an issue or contact [email protected].