/ Модель

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

Лицензия
Своя лицензия
Архитектура
moondream3 · dense
Библиотека
transformers
Опубликована
10 ноя 2025

moondream3-preview-hf

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

Реализация Moondream 3 Preview для Transformers анализирует изображения, отвечает на вопросы, создаёт подписи и возвращает координаты объектов или точек.

88скачиваний за 30 дней14лайковвеса обновлены3 дек 2025

Бенчмарки

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

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

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

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

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

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

NyxKrage/moondream3-preview-hf — реализация Moondream 3 Preview в соглашениях архитектуры Hugging Face Transformers, созданная NyxKrage на основе публичной версии модели от M87 Labs / Moondream AI. Это мультимодальная модель для анализа изображений с текстовым бэкбоном MoE: около 9 млрд параметров, из которых активно используется около 2 млрд. Репозиторий позволяет работать с моделью через Transformers API, включая generate(), Trainer и интеграции PEFT.

Модель принимает изображение и текстовый запрос и может отвечать на вопросы об изображении, создавать подписи, находить объекты и указывать точки на изображении. Для запросов и подписей она выдаёт текст; для обнаружения и указания точек — структурированные координаты рамок и точек. Карточка демонстрирует шаблоны запросов на английском языке. Модель хранится в формате safetensors; метаданные указывают лицензию other.

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

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

  • ответы на вопросы о содержимом изображения
  • создание коротких и подробных подписей к изображениям
  • обнаружение объектов и получение их рамок
  • указание координат точек на изображении
  • интеграция анализа изображений в приложение на Transformers

Ограничения

В одном пакете изображения должны давать одинаковое число визуальных кропов, а все запросы должны использовать один режим; иначе пакетная обработка не поддерживается. В метаданных указана лицензия other, поэтому условия использования следует сверить с лицензией в репозитории.

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

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

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

Также подходит для

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

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

Открыть на Hugging Face

Moondream 3 Preview HF

Moondream 3 Preview HF is a reimplementation of the Moondream 3 (Preview) model using the standard HuggingFace Transformers architecture conventions.

Overview

  • Multimodal vision-language model with a mixture-of-experts (MoE) text backbone
  • Architecture and weights correspond to Moondream 3 (Preview) (approximately 9B parameters, 2B active)
  • Implemented as standard Transformers components:

The purpose of this repository is to make Moondream 3 interoperable with the Hugging Face ecosystem so it can be used directly with the Transformers API, including generate(), Trainer, and PEFT integrations.

Example usage

Example for running multimodal inference with the moondream3-preview-hf implementation:

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

DEVICE="cuda:0"

model = AutoModelForCausalLM.from_pretrained("NyxKrage/moondream3-preview-hf", dtype="bfloat16", device_map=DEVICE, trust_remote_code=True)
processor = AutoProcessor.from_pretrained("NyxKrage/moondream3-preview-hf", use_fast=False, trust_remote_code=True)


image1 = Image.open("image1.jpg")
image2 = Image.open("image2.jpg")
text = [processor.apply_chat_template("", tokenize=False)] * 2
inputs = processor(text=text, images=[
    image1,
    image2,
])
inputs = {k: v.to(DEVICE) for k,v in inputs.items()}

model.eval()

with torch.no_grad():
    outputs = model.generate(
        **inputs,
        use_cache=True,
    )
    outputs = [
        out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs["input_ids"], outputs)
    ]
    for output in outputs:
        print(processor.decode(output))

The chat_template uses Hugging Face’s Jinja format and accepts either a single string or a sequence of messages (user [, assistant]).

Prompting modes

The chat template supports multiple task types via text prefixes:

ModeTemplate prefixExample input
Queryquery:query: What is happening in this image?
Reasonreason:reason: What is happening in this image?
Captioncaption: [short/normal/long]caption: long
Detectdetect:detect: dog
Pointpoint:point: red car

If no prefix is provided, the default mode is caption:normal. reason is the same as query, but makes the model think/reason before providing a final answer.

Output Format

For query: and caption: prompts, the model behaves like a standard Hugging Face causal language model and returns token IDs to be decoded normally.

For detect: prompts, the model does not return text. Instead, it produces a floating-point tensor of shape [batch_size, max_detections, 4]. Each non-zero entry represents a bounding box in normalized coordinates [x_min, y_min, x_max, y_max]. Zero rows indicate padding.

For point: prompts, the model likewise returns structured coordinates rather than text. The output is a floating-point tensor of shape [batch_size, max_points, 2], where each non-zero row is a point [x, y] in normalized image coordinates. Zero rows again represent padding.

Training

The model can be trained using trl and supports peft and bitsandbytes out of the box.
Included in the repo is also an implementation which replaces the MoE layers with a grouped_gemm implementation which has been adapted from github:woct0rdho/transformers-qwen3-moe-fused, and can be used by importing Moondream3ForConditionalGeneration from modeling_moondream3_fusedmoe.py instead.

Limitations

All images within a batch must yield the same number of vision crops. To ensure this, it is recommended to resize every image to the same resolution before preprocessing; otherwise, differences in aspect ratio or size can cause mismatched crop counts and prevent batching.

Only a single action type is supported per batch. Every prompt in the batch must use the same mode prefix (such as query:, caption:, point:, or detect:). Mixing different modes in a single batch is not allowed.

Because both the visual crops and text inputs must align across examples, batches must be homogeneous in both image structure and task type. Inputs that differ in crop count or prompt mode should be run separately or grouped into compatible batches.

License

The model weights remain under the Business Source License 1.1 with an Additional Use Grant (No Third-Party Service), identical to the original Moondream 3 Preview license.

All new implementation code in this repository is released under the Apache 2.0 License.

Credits

  • Original model and research: M87 Labs / Moondream AI
  • Hugging Face–compatible reimplementation: NyxKrage
  • Based on the public Moondream 3 Preview release

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

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

GPU в ailist

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

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

Модели нужен код из репозитория; автор пока не в списке доверенных организаций.

Класс архитектуры
Moondream3ForConditonalGeneration
Ревизия весов
4cbb231

0 моделей