Developer Tools
Connecting visual input to an agent with vision-bridge
A Python-based bridge for image understanding, OCR, and video analysis when an agent lacks a visual input channel.
A file path is not visual input
Giving an agent an image path does not mean the model has received the image. Visual access depends on the model, client, and input channel. Some environments provide native vision; others pass only text or require a file-reading tool.
vision-bridge fills that missing connection. It reads an image or video, calls a configured visual service, and returns analysis to the host agent so the workflow can continue.
A Skill and Python scripts
The Skill describes when to use the bridge. look.py provides a convenient entry point, vision.py handles requests, and optional image tools provide resizing, cropping, and compression.
This approach fits agents that can execute Python but do not receive images directly. Parameters and results can be inspected without maintaining another long-running service.
MCP is useful when a compatible client discovers and invokes standardized tools. Its availability depends on client integration, rather than simply the model name. Each approach has its own setup requirements.
Route according to the environment
If the host already receives visual input, it can use that capability. Otherwise, it can call the bridge. An explicit /look request selects the bridge directly.
The host_vision_capable setting supports true, false, and auto. Explicit values declare the host’s capability; automatic mode leaves the decision to the Skill’s instructions.
Model self-assessment is a routing hint, not a measured accuracy guarantee. Stable environments benefit from explicit configuration. A different model or client needs another check, including data handling, availability, and cost.
Images, OCR, and video
After following the README to configure the environment and provider, these commands are available from the repository directory:
python scripts/vision.py health
python scripts/look.py sample.png --dry-run
python scripts/look.py invoice.jpg --ocr
python scripts/look.py chart.png -p "What does this chart show?"
python scripts/look.py demo.mp4 --video -p "Summarize this video"
The health command checks configuration; a dry run previews a request without sending it. Actual analysis requires a working provider. Video support also depends on the chosen model and endpoint.
Detection coordinates, OCR, and summaries are model outputs and can be wrong. Verify important details against the original media. The image-to-search function creates query information; retrieval still requires the host’s search tool.
Configuration and limits
The model name, endpoint, and credential environment-variable name are configurable. The repository defaults to GLM-4.6V-Flash, but prices, quotas, and available capabilities should be checked with the provider.
Core network calls use Python’s standard library. Optional image processing uses Pillow. Preprocessing, rate-limit handling, and request previews address common integration issues.
Passing a configuration check does not prove every model, file, or provider works. Validate the output using your actual media, and keep service credentials private.
Project entry point
The bridge connects visual analysis to an existing workflow while retaining choices about when to call it, which model to use, and how to interpret the result. Code and integration details are in the repository.