/ Модель

Характеристики

Контекст
262 144 токена
Размер весов
10,5 ГБ
Лицензия
Apache 2.0
Архитектура
llava_onevision2_5 · dense
Библиотека
transformers
Опубликована
17 ноя 2026

LLaVA-OneVision-2.5-4B-Instruct

Генерация текстаТекст → текст3 профессии

Мультимодальная модель на 4 млрд параметров для диалога по изображениям и видео, включая потоковый анализ кадров.

637скачиваний за 30 дней19лайковвеса обновлены25 ноя 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

LLaVA-OneVision-2.5-4B-Instruct — плотная мультимодальная модель семейства LLaVA-OneVision-2.5 с 4 млрд параметров, разработанная LMMS-Lab. Она принимает текст и визуальные данные: отдельные изображения, несколько изображений и видео. Модель предназначена для диалога о визуальном содержимом, понимания видео и потоковой обработки, при которой она анализирует поступающие кадры и решает, когда ответить, промолчать или создать подпись.

Модель использует визуальную башню с патчами 16×16 и объединение 3×3, что сокращает число визуальных токенов в девять раз. Контекст составляет 262 тыс. токенов. Поддерживаются офлайн-обработка и потоковый режим на одних и тех же весах и шаблоне чата; для видео также предусмотрен режим кодека, выделяющий информативные области. Репозиторий использует Transformers и формат safetensors; для загрузки весов требуется включить trust_remote_code. Лицензия — Apache-2.0.

Сценарии применения

  • ответы на вопросы об одном или нескольких изображениях
  • описание и анализ видеозаписей
  • понимание видеосцен в офлайн-режиме
  • потоковый анализ кадров с выбором момента для ответа
  • создание непрерывных подписей к видеопотоку

Ограничения

Для загрузки весов требуется trust_remote_code; потоковый инференс требует отдельной библиотеки onevision-streaming и поддерживаемого бэкенда. README не сообщает о поддерживаемых естественных языках.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

LLaVA-OneVision-2.5-4B-Instruct

English | 中文

LLaVA-OneVision-2.5-4B-Instruct is a 4B vision-language model for single-image, multi-image and video input. Beyond the usual offline tasks, it is trained for streaming video: frames arrive one at a time, and at every step the model decides whether to stay silent or speak. The same weights and the same chat template serve both modes.

Highlights

  • Offline and streaming in one model. apply_chat_template(..., streaming=True) switches mode; eight protocol tokens carry the per-frame decision to stay silent, respond or caption. Nothing else about the input changes.
  • Codec-aligned video. Besides uniform frame sampling, codec mode uses the encoder's bit-cost to pack the informative regions of a video into a handful of canvases.
  • 9× spatial compression. A patch-16 vision tower with 3×3 merging gives one visual token per 48×48 pixels, so long videos fit comfortably in the 262k context.

Performance

Video

Streaming video

Image

Compared with Qwen3.5-4B, thinking disabled. Bold is the best score in each row; -- means not available. The superscript on each video score is the setting that produced it: frames × pixels per frame, or for codec, canvases (TC) × pixels per canvas. VideoMME is the mean over the short, medium and long splits. Each side reports its best score over the settings tried, from single runs. The image table shows selected benchmarks; full results, settings and protocol will be given in the technical report.

Model Overview

Quickstart

The modeling code ships with the weights, so trust_remote_code=True is required.

pip install "transformers>=5.7.0" accelerate torch torchvision
pip install flash-attn --no-build-isolation   # optional, recommended
pip install decord                            # frame-sampling video path only

Image

import torch
from PIL import Image
from transformers import AutoProcessor, AutoModelForImageTextToText

MODEL = "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct"

processor = AutoProcessor.from_pretrained(MODEL, trust_remote_code=True)
model = AutoModelForImageTextToText.from_pretrained(
    MODEL, trust_remote_code=True, dtype=torch.bfloat16,
    attn_implementation="flash_attention_2",   # "sdpa" without flash-attn
    device_map="auto",
).eval()

messages = [{"role": "user", "content": [
    {"type": "image"},
    {"type": "text", "text": "Describe this image in detail."},
]}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=text, images=[Image.open("example.jpg").convert("RGB")],
                   return_tensors="pt").to(model.device)

with torch.inference_mode():
    out = model.generate(**inputs, max_new_tokens=512, do_sample=False)
print(processor.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Video

messages = [{"role": "user", "content": [
    {"type": "video"},
    {"type": "text", "text": "What is happening in this video?"},
]}]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)

inputs = processor(
    text=text, videos=["example.mp4"],
    max_frames=64,
    min_pixels=153664, max_pixels=153664,   # set equal to fix the per-frame budget
    return_tensors="pt",
).to(model.device)

For codec mode, install codec-video-prep and pass video_backend="codec":

pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple \
            "codec-video-prep==0.3.0"
codec-video-prep-doctor
inputs = processor(text=text, videos=["example.mp4"],
                   video_backend="codec", return_tensors="pt").to(model.device)

Streaming

Real-time streaming inference is provided by onevision-streaming (ov-streaming), running on official vllm==0.25.1 (concurrent streaming) or PyTorch + transformers (single-stream, no vLLM):

pip install "vllm==0.25.1" "transformers>=5.7.0,<5.10" "qwen-vl-utils>=0.0.14"
pip install "ov-streaming @ git+https://github.com/Kagura-0001/onevision-streaming.git"
from ov_streaming import StreamingEngine

MODEL = "lmms-lab-encoder/LLaVA-OneVision-2.5-4B-Instruct"

with StreamingEngine(MODEL, backend="vllm", max_model_len=32768, max_pixels=258048) as engine:
    with engine.session(
        max_visual_frames=96,
        compact_to_visual_frames=64,
        max_response_tokens=128,
    ) as session:
        for ev in session.stream_video(
            "example.mp4",
            fps=1.0,
            questions=[(0.0, "Notify me when the door opens.")],
        ):
            if ev.type == "response.output_text.done":
                print(f"[{ev.timestamp_sec:.1f}s] {ev.text}")

Pass backend="transformers" to run without vLLM, or enable=["caption"] in engine.session(...) for continuous narration. For codec (I+P) mode, install codec-video-prep==0.3.0 as above (when using vllm==0.25.1 on numpy>=2, point OV_STREAMING_CODEC_PYTHON at a Python 3.11 environment with codec-video-prep==0.3.0, numpy<2, pillow, and httpx) and pass video_backend="codec":

from ov_streaming import CodecConfig

codec = CodecConfig(strategy="rdo", pixel_budget=258048, p_canvases=1)
with engine.session(max_visual_frames=192, compact_to_visual_frames=128) as session:
    for ev in session.stream_video(
        "example.mp4", video_backend="codec", codec_config=codec,
        questions=[(0.0, "Notify me when the door opens.")],
    ):
        if ev.type == "response.output_text.done":
            print(f"[{ev.timestamp_sec:.1f}s] {ev.text}")

In codec mode, max_visual_frames counts canvases (1 + p_canvases per second; set None on clips under ~3 minutes). See onevision-streaming for live camera/RTSP/H.264 streams and HTTP/SSE serving.

License

Apache-2.0.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
LlavaOnevision2_5ForConditionalGeneration
Ревизия весов
7509daa

0 моделей