circuitforge-core/docs/modules/vision.md
pyr0ball 383897f990
Some checks are pending
CI / test (push) Waiting to run
Mirror / mirror (push) Waiting to run
Release — PyPI / release (push) Waiting to run
feat: platforms module + docs + scripts
- platforms/: eBay platform adapter (snipe integration layer)
- docs/: developer guide, module reference, getting-started docs
- scripts/: utility scripts for development and deployment
2026-04-24 15:23:16 -07:00

1.7 KiB

vision

Vision router base class. Stub — partially implemented.

from circuitforge_core.vision import VisionRouter  # base class

Planned design

The vision module mirrors the LLM router pattern for multimodal inputs. Products subclass VisionRouter and configure a fallback chain over vision-capable backends.

Planned backends:

  • moondream2 — local, 1.8GB, fast; via the vision service FastAPI sidecar on :8002
  • claude_code — local wrapper with vision capability
  • anthropic — cloud, Claude's vision models
  • openai — cloud, GPT-4o vision

Current usage

The vision service (scripts/vision_service/main.py in Peregrine, and the cf-docuvision path in Kiwi) currently implements vision routing directly without going through this module. This module is being designed to absorb those implementations once the interface stabilizes.

VisionRouter base class

class VisionRouter:
    def analyze(
        self,
        images: list[str],        # base64-encoded
        prompt: str,
        max_tokens: int = 1024,
    ) -> str:
        """Run vision inference. Returns text response."""
        raise NotImplementedError

moondream2 specifics

moondream2 is the preferred local vision model — it's small enough for CPU use (1.8GB download) and fast enough for interactive use on GPU. Products using it:

  • Peregrine: survey screenshot analysis (culture-fit survey assistant)
  • Kiwi: receipt OCR fast-path, barcode label reading

!!! note "VRAM requirement" moondream2 uses ~1.5GB VRAM in 4-bit quantization. Stop the main LLM service before starting the vision service if you're on a card with < 6GB VRAM.