Command Palette

Search for a command to run...

Назад к скиллам
скилл № 84349

multimodal-pipelines

Use when the user asks about a vision-language model (VLM), LLaVA, Qwen-VL, sending images or screenshots to an LLM, audio LLMs, Whisper + LLM or multimodal…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить multimodal-pipelines в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

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

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Multimodal AI Pipelines (Vision & Audio)

Purpose

Decide how images and audio reach a language model and build the pipeline. Native multimodal models read pixels or audio features directly and keep layout, charts, and tone that OCR or transcription would lose; text-first pipelines (OCR/ASR then LLM) are cheaper, more controllable, and easier to audit. This PoC skill explains the architectures and gives a working serving/client setup and an evaluation plan.

Agent Protocol

Trigger

"VLM", "vision-language", "LLaVA", "Qwen2.5-VL", "image + text prompt", "chart/screenshot understanding", "audio LLM", "Whisper + LLM", "multimodal RAG".

Input Context

  • Inputs (photos, scans, screenshots, charts, video frames, speech) and volume.
  • Outputs (extraction JSON, QA, captions, actions).
  • Hosted API vs self-hosted; GPU budget; privacy constraints.

Output Artifact

Pipeline design (native vs text-first), model choice, preprocessing rules, serving/client code, eval set.

Response Format

Input: {modality, resolution/duration}  Task: {extract|qa|caption}
Approach: {native VLM|OCR->LLM|ASR->LLM|hybrid}
Model: {name}  Serving: {hosted API|vLLM}
Preprocess: {resize/tiling, page split, audio resample 16 kHz}
Output: {JSON schema}  Eval: {field accuracy / WER / QA accuracy}

Completion Criteria

  • Native vs text-first decision justified with sample results.
  • Image token cost estimated (resolution drives tokens).
  • Structured output validated against a schema.
  • Eval set with ground truth per field/answer.

How Modalities Are Fused

Architecture Mechanism Examples
Projector + token concatenation Vision encoder (e.g. CLIP/SigLIP ViT) produces patch embeddings; an MLP projects them into the LLM embedding space; image tokens are inserted into the sequence and processed by ordinary self-attention LLaVA family, Qwen-VL family
Cross-attention adapters LLM layers gain cross-attention blocks that attend to image features Flamingo, Llama 3.2 Vision
Audio encoder + projector Whisper-style encoder over log-Mel spectrograms, projected into the LLM Qwen2-Audio and similar
Natively multimodal Trained jointly on interleaved modalities Frontier hosted models

Consequence: image resolution maps to token count. Dynamic-resolution models tile large images into many tokens; downscale or crop to the region of interest to control cost and latency.

Native vs Text-First

Situation Prefer
Clean printed documents, high volume OCR (or document parser) → LLM
Layout, tables, charts, handwriting, screenshots Native VLM (optionally with OCR text as extra context)
Speech where wording matters (meetings, support calls) ASR (Whisper) → LLM, keep timestamps
Tone/emotion, non-speech audio Audio-native model
Auditable extraction Text-first, store intermediate text

Serving a VLM with vLLM

vllm serve Qwen/Qwen2.5-VL-7B-Instruct --max-model-len 16384 \
  --limit-mm-per-prompt '{"image": 4}' --api-key "$VLLM_API_KEY"

(The --limit-mm-per-prompt value syntax has changed across vLLM versions; older releases use image=4.)

from __future__ import annotations

import base64
import json
import os
from pathlib import Path

from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key=os.environ["VLLM_API_KEY"], timeout=120)


def image_part(path: Path) -> dict:
    mime = "image/png" if path.suffix.lower() == ".png" else "image/jpeg"
    data = base64.b64encode(path.read_bytes()).decode()
    return {"type": "image_url", "image_url": {"url": f"data:{mime};base64,{data}"}}


def extract_invoice(path: Path) -> dict:
    resp = client.chat.completions.create(
        model="Qwen/Qwen2.5-VL-7B-Instruct",
        messages=[{"role": "user", "content": [
            image_part(path),
            {"type": "text", "text": 'Extract {"vendor": str, "date": "YYYY-MM-DD", "total": number}. '
                                     "Return only JSON. Use null for missing fields."},
        ]}],
        temperature=0,
        max_tokens=300,
    )
    raw = resp.choices[0].message.content or ""
    try:
        return json.loads(raw)
    except json.JSONDecodeError as exc:
        raise ValueError(f"model returned non-JSON for {path.name}: {raw[:200]!r}") from exc

Use structured-output/guided decoding (response_format with a JSON schema, where the server supports it) instead of hoping for valid JSON.

Audio Path

  1. Resample to 16 kHz mono (Whisper's expected input), split long audio with voice-activity detection.
  2. Transcribe with timestamps (faster-whisper or a hosted ASR); optionally diarize speakers.
  3. Feed transcript chunks with timestamps to the LLM; cite time ranges in outputs.

Preprocessing Rules

  • Fix EXIF orientation; convert to RGB; cap the long side (e.g. 1024-1568 px) unless fine text needs more.
  • Split multi-page PDFs into page images (pdftoppm -r 150)
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл multimodal-pipelines?

Use when the user asks about a vision-language model (VLM), LLaVA, Qwen-VL, sending images or screenshots to an LLM, audio LLMs, Whisper + LLM or multimodal document extraction. Produces a native-vs-OCR/ASR pipeline design, vLLM serving and client code, and an eval set. Not for image generation (use genai-vision) or training CV models (use ml-computer-vision).

Как установить скилл multimodal-pipelines?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл multimodal-pipelines запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить multimodal-pipelines с