Ovis

ATH-MaaSApache-2.0活跃维护

Ovis 是一种多模态大语言模型架构,通过结构对齐视觉与文本嵌入,让模型能同时理解图像和文字,适合做视觉问答、图文对话等任务。

A novel Multimodal Large Language Model (MLLM) architecture, designed to structurally align visual and textual embeddings.

暂无版本1,537star93fork同步于 2026-11-07 07:31 UTC

怎么上手

由 README 提炼,执行前请确认
git clone [email protected]:AIDC-AI/Ovis.git
conda create -n ovis python=3.10 -y
conda activate ovis
cd Ovis
pip install -r requirements.txt
pip install -e .
硬件要求按 README 说明

README 未说明具体显存要求;Ovis2.5 提供 2B 与 9B 两个规模,可通过 min_pixels/max_pixels 控制图像分辨率以平衡精度与 GPU 显存占用。

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

项目说明

由 README 自动翻译提炼

阿里开源的多模态大模型,把视觉与文本嵌入做结构化对齐,可直接推理和微调

Ovis 是一种多模态大语言模型架构,通过结构对齐视觉与文本嵌入,让模型能同时理解图像和文字,适合做视觉问答、图文对话等任务。

核心能力

  • 用结构化嵌入对齐连接视觉与文本表示
  • 支持原生分辨率视觉感知与多图、视频输入
  • 提供 thinking 模式做反思式推理并可控预算
  • 提供 transformers 与 vLLM 两套推理示例
  • 附 SFT 训练脚本并支持 ms-swift 微调

容易踩的坑

环境按 Python 3.10、Torch 2.4.0、Transformers 4.51.3、DeepSpeed 0.15.4 测试,版本不符易出问题;模型权重需从 HuggingFace 单独下载;vLLM 需另装 vllm==0.10.2 并加 --trust-remote-code,Web UI 示例默认端口 8001、vLLM 默认 8000。

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

最近发版

0 个版本

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

用户点评

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

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

    README 原文

    未翻译

    Ovis

    Introduction

    Ovis (Open VISion) is a novel Multimodal Large Language Model (MLLM) architecture, designed to structurally align visual and textual embeddings.

    🔥 We are hiring!

    We are looking for both interns and full-time researchers to join our team, focusing on multimodal understanding, generation, reasoning, AI agents, and unified multimodal models. If you are interested in exploring these exciting areas, please reach out to us at [email protected].

    Release

    • [25/08/15] 🔥 Launch of Ovis2.5-2B/9B, featuring native-resolution visual perception, enhanced reflective reasoning (thinking mode), and leading performance across STEM, chart analysis, grounding, and video understanding.
    • [25/03/25] 🔥 Announcing quantized versions of Ovis2 series, covering Ovis2-2/4/8/16/34B!
    • [25/01/26] 🔥 Launch of Ovis2-1/2/4/8/16/34B, the latest version of Ovis models, featuring breakthrough small-model performance, enhanced reasoning capabilities, advanced video and multi-image processing, expanded multilingual OCR support, and improved high-resolution image handling.
    • [24/11/26] 🔥 Announcing Ovis1.6-Gemma2-27B!
    • [24/11/04] 🔥 Announcing quantized versions of Ovis1.6: Ovis1.6-Gemma2-9B-GPTQ-Int4 and Ovis1.6-Llama3.2-3B-GPTQ-Int4!
    • [24/10/22] 🔥 Announcing Ovis1.6-Llama3.2-3B (Model, Demo)!
    • [24/09/19] 🔥 Announcing Ovis1.6-Gemma2-9B (Model, Demo)! This release further enhances high-resolution image processing, is trained on a larger, more diverse, and higher-quality dataset, and refines the training process with DPO training following instruction-tuning.
    • [24/07/24] 🔥 Introducing Ovis1.5, featuring improved high-resolution image processing and optimized training data for enhanced performance.
    • [24/06/14] 🔥 Launch of Ovis1.0, the inaugural version of the Ovis model.

    Contents

    Model

    Ovis can be instantiated with popular LLMs. We provide the following Ovis MLLMs:

    Ovis MLLMsViTLLMModel WeightsDemo
    Ovis2.5-2Bsiglip2-so400m-patch16-512Qwen3-1.7BHuggingfaceSpace
    Ovis2.5-9Bsiglip2-so400m-patch16-512Qwen3-8BHuggingfaceSpace

    Performance

    Ovis2.5 demonstrates strong results on general multimodal benchmarks, complex chart analysis, and reasoning tasks, achieving leading performance among open-source models under 40B parameters.

    performance-Ovis2_5

    OC-Ovis2_5

    REASON-Ovis2_5

    Install

    Ovis has been tested with Python 3.10, Torch 2.4.0, Transformers 4.51.3, and DeepSpeed 0.15.4. For a comprehensive list of package dependencies, please consult the requirements.txt file.

    git clone [email protected]:AIDC-AI/Ovis.git
    conda create -n ovis python=3.10 -y
    conda activate ovis
    cd Ovis
    pip install -r requirements.txt
    pip install -e .
    

    For vLLM:

    pip install vllm==0.10.2 --extra-index-url https://wheels.vllm.ai/0.10.2/
    

    Inference

    We provide inference examples using both transformers and vLLM.

    transformers

    In ovis/serve we provide three example files:

    • ovis/serve/infer_think_demo.py
      Demonstrates how to enable the model’s reflective reasoning via
      enable_thinking and to control the reasoning phase length with thinking_budget.

    • ovis/serve/infer_basic_demo.py
      Provides inference examples for single-image, multi-image, video, and pure-text inputs.

    • ovis/serve/web_ui.py Provides a Gradio-based Web UI demo. Example run:

      python ovis/serve/web_ui.py --model-path AIDC-AI/Ovis2.5-9B --port 8001
      

    vLLM

    Start the vLLM server:

    vllm serve AIDC-AI/Ovis2.5-9B \
         --trust-remote-code \
         --port 8000
    

    Call the model using the OpenAI Python SDK:

    from openai import OpenAI
    
    openai_api_key = "EMPTY"
    openai_api_base = "http://localhost:8000/v1"
    
    client = OpenAI(
        api_key=openai_api_key,
        base_url=openai_api_base,
    )
    
    chat_response = client.chat.completions.create(
        model="AIDC-AI/Ovis2.5-9B",
        messages=[
            {
                "role": "user",
                "content": [
                    {
                        "type": "image_url",
                        "image_url": {
                            "url": "https://cdn-uploads.huggingface.co/production/uploads/637aebed7ce76c3b834cea37/kh-1dhZRAduP-P4SkIhXr.png"
                        },
                    },
                    {"type": "text", "text": "Recognize the table content"},
                ],
            },
        ],    
        extra_body={
            "chat_template_kwargs": {
                "enable_thinking": True,
            },
            "mm_processor_kwargs": {
                "images_kwargs": {
                    "min_pixels": 1048576,   # 1024 * 1024
                    "max_pixels": 3211264    # 1792 * 1792
                }
            }
        }
    )
    
    print("Chat response:\n", chat_response.choices[0].message.content)
    
    Explanation of extra_body parameters:
    • chat_template_kwargs.enable_thinking Enables thinking mode (reflective reasoning).

    • mm_processor_kwargs.images_kwargs.min_pixels / max_pixels Controls the resolution range of input images (in total pixel count), balancing accuracy and GPU memory usage.

    Model Fine-tuning

    Ovis can be fine-tuned using either the provided training code in this repository or via ms-swift.

    1. Fine-tuning with in-repo code

    Data Format

    The training dataset is stored as a JSON list, where each element corresponds to a single sample. Example dataset JSON:

    [
        {
            "id": 1354,
            "image": "1354.png",
            "conversations": [
                {
                    "from": "human",
                    "value": "<image>\nIn the figure, the vertices of quadrilateral ABCD intersect square EFGH and divide its sides into segments with measures that have a ratio of 1:2. Find the ratio between the areas of ABCD and EFGH."
                },
                {
                    "from": "gpt",
                    "value": "5:9"
                }
            ]
        }
    ]
    
    Dataset Information

    Datasets are referenced via datainfo JSON files, e.g. ovis/train/dataset/ovis2_5_sft_datainfo.json:

    {
        "geometry3k_local": {
            "meta_file": "path/to/geometry3k_local.json",
            "storage_type": "hybrid",
            "data_format": "conversation",
            "image_dir": "path/to/images/"
        }
    }
    
    • meta_file: path to the converted dataset JSON file (a list of samples).
    • storage_type: usually set to "hybrid".
    • data_format: usually set to "conversation".
    • image_dir: directory path containing the referenced images.
    Training Script

    We provide example training scripts under scripts/. For instance, to fine-tune Ovis2.5 with SFT:

    bash scripts/run_ovis2_5_sft.sh
    

    This script configures the DeepSpeed engine, dataset paths, and model checkpoint initialization. Modify it to match your own dataset and environment.

    2. Fine-tuning with ms-swift

    Alternatively, Ovis models can be fine-tuned using ms-swift, a flexible training framework for LLMs.

    Citation

    If you find Ovis useful, please cite the paper

    @article{lu2025ovis25technicalreport,
      title={Ovis2.5 Technical Report}, 
      author={Shiyin Lu and Yang Li and Yu Xia and Yuwei Hu and Shanshan Zhao and Yanqing Ma and Zhichao Wei and Yinglun Li and Lunhao Duan and Jianshan Zhao and Yuxuan Han and Haijun Li and Wanying Chen and Junke Tang and Chengkun Hou and Zhixing Du and Tianli Zhou and Wenjie Zhang and Huping Ding and Jiahe Li and Wen Li and Gui Hu and Yiliang Gu and Siran Yang and Jiamang Wang and Hailong Sun and Yibo Wang and Hui Sun and Jinlong Huang and Yuping He and Shengze Shi and Weihong Zhang and Guodong Zheng and Junpeng Jiang and Sensen Gao and Yi-Feng Wu and Sijia Chen and Yuhui Chen and Qing-Guo Chen and Zhao Xu and Weihua Luo and Kaifu Zhang},
      year={2025},
      journal={arXiv:2508.11737}
    }
    
    @article{lu2024ovis,
      title={Ovis: Structural Embedding Alignment for Multimodal Large Language Model}, 
      author={Shiyin Lu and Yang Li and Qing-Guo Chen and Zhao Xu and Weihua Luo and Kaifu Zhang and Han-Jia Ye},
      year={2024},
      journal={arXiv:2405.20797}
    }
    

    Team

    This work is a collaborative effort by the Alibaba Ovis team. We would also like to provide links to the following MLLM papers from our team:

    License

    This project is licensed under the Apache License, Version 2.0 (SPDX-License-Identifier: Apache-2.0).

    Disclaimer

    We used compliance-checking algorithms during the training process, to ensure the compliance of the trained model to the best of our ability. Due to the complexity of the data and the diversity of language model usage scenarios, we cannot guarantee that the model is completely free of copyright issues or improper content. If you believe anything infringes on your rights or generates improper content, please contact us, and we will promptly address the matter.