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★ 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
- Resample to 16 kHz mono (Whisper's expected input), split long audio with voice-activity detection.
- Transcribe with timestamps (faster-whisper or a hosted ASR); optionally diarize speakers.
- 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)
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
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), без исполняемых скриптов.
Похожие скиллы
docx
AnthropicUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
xlsx
AnthropicUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
pptx
AnthropicUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…