| name | hapo:ai-multimodal |
| description | Analyze images/audio/video/documentation with Gemini API. Use for vision analysis, transcription, OCR, design extraction, and deep multimodal understanding. |
| license | MIT |
| user-invocable | true |
| when_to_use | Invoke to analyze or generate images, audio, or mixed-media content. |
| category | utilities |
| keywords | ["multimodal","image","audio","vision"] |
| argument-hint | [file-path] [prompt] |
| metadata | {"author":"haposoft","version":"1.0.0"} |
AI Multimodal
Process audio, images, videos, documents using Gemini. Purely focused on robust analysis, transcription, and contextual extraction.
Setup
export GEMINI_API_KEY="your-key"
pip install google-genai python-dotenv pillow requests
API Key Rotation (Optional)
For high-volume Gemini usage, configure multiple keys:
export GEMINI_API_KEY="key1"
export GEMINI_API_KEY_2="key2"
Quick Start
Verify setup: python scripts/check_setup.py
Analyze media: python scripts/gemini_batch_process.py --files <file> --task <analyze|transcribe|extract>
- TIP: When you're asked to analyze an image, check if
gemini command is available, then use echo "<prompt to analyze image>" | gemini -y -m <gemini.model> command (read model from .claude/runtime.json: gemini.model). If gemini command is not available, use python scripts/gemini_batch_process.py --files <file> --task analyze command.
Stdin support: Pipe files via stdin for Gemini analysis (auto-detects PNG/JPG/PDF/WAV/MP3).
Models
Google Gemini
- Analysis:
gemma-4-31b-it (recommended), gemma-4-31b-it (advanced)
Scripts
gemini_batch_process.py: Gemini CLI for transcribe|analyze|extract. Auto-resolves API keys logic.
media_optimizer.py: ffmpeg/Pillow preflight: compress/resize/convert media to stay within API limits.
document_converter.py: Gemini-powered PDF/image/Office → markdown converter.
check_setup.py: Setup checker for API keys and dependencies.
Use --help for options.
References
Load for detailed guidance:
| Topic | File | Description |
|---|
| Audio | references/audio-processing.md | Audio formats and limits, transcription (timestamps, speakers, segments), non-speech analysis, File API vs inline input. |
| Images | references/vision-understanding.md | Vision capabilities overview, supported formats and models, captioning/classification/VQA, detection and segmentation, OCR. |
| Video | references/video-analysis.md | Video analysis capabilities and supported formats, model/context choices, local/inline/YouTube inputs, clipping and FPS control. |
Limits
Formats: Audio (WAV/MP3/AAC, 9.5h), Images (PNG/JPEG/WEBP, 3.6k), Video (MP4/MOV, 6h), PDF (1k pages)
Size: 20MB inline, 2GB File API
Important:
Outputs
IMPORTANT: Save extracted outputs next to the active task/spec report or under an obvious project artifact folder. Include exact output paths in the final report.
Resources