Skip to main content

Vision - API Specification

Version: v1.0.0 | Status: Active | Last Updated: March 2026

1. Overview​

The vision module provides local-first visual understanding using Vision-Language Models via Ollama (llava/bakllava). Includes image analysis, PDF text extraction, and structured annotation extraction. All implementations are Zero-Mock compliant.

2. Core Components​

2.1 Classes​

ClassDescription
VLMClientVision-Language Model client for image analysis via Ollama
PDFExtractorText extraction from PDF documents
AnnotationExtractorStructured annotation extraction from images

2.2 Data Models​

ClassDescription
VLMConfigConfiguration for VLM inference (model name, temperature, max tokens)
VLMResponseResponse from VLM analysis (text, tokens, latency)
AnnotationStructured annotation with label and bounding box
BoundingBoxBounding box coordinates (x, y, width, height)
PageContentExtracted page content from PDFs

3. Usage Example​

from codomyrmex.vision import VLMClient, VLMConfig

client = VLMClient(VLMConfig(model="llava"))
response = client.analyze_image("screenshot.png", prompt="Describe this UI")
print(response.text)
ModuleRelationship
imageReserved namespace for image metadata extraction
multimodalImage generation via ImageGenerator

5. Navigation​