Image vision analysis

From theheavenlyd3mon/hermes-profiles · View interactive version

Image vision analysis is an AI agent skill from the GitHub repository theheavenlyd3mon/hermes-profiles. Vision fallback: describe images via OpenRouter gpt-4o-mini.

How to use this skill

Skill file

Image Vision Analysis (with fallback)

When you need to SEE an image — a user-supplied reference, a generated artifact, a screenshot — and the active model can't accept image content.

Primary path

vision_analyze(image_url, question) — works when the active model or its auxiliary vision fallback supports image_url content. Always try this first.

Failure signature: text-only model

vision_analyze errors with:

Error code: 400 - Failed to deserialize the JSON body into the target type:
messages[0]: unknown variant `image_url`, expected `text`

This means the endpoint only accepts text messages — a model capability gap, NOT an image size/format problem. Downscaling does NOT fix it. Don't loop on sips/quality variants; switch to the fallback path immediately.

Fallback path (validated 2026-08)

Route the image to openai/gpt-4o-mini through OpenRouter:

python3 scripts/analyze-image.py --image /path/to/img.jpg --question "Describe..."
# optional: --model openai/gpt-4o-mini

The script:

  1. Finds OPENROUTER_API_KEY (env, then ~/.hermes/profiles/creative/.env, then ~/.hermes/.env)
  2. Base64-embeds the image as a data URL (no file upload needed)
  3. Calls https://openrouter.ai/api/v1/chat/completions
  4. Prints the model's description

Discovering API keys safely

Pitfalls

Support files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.