Skip to main content
This example shows the grounding loop end to end: build targets, get a Set-of-Mark annotated frame, let a model pick an id, and click it.

Build targets and annotate

Let the model choose, then act

ROI + dirty rects for tight loops

Set-of-Mark helpers (som_annotate, targets_from_grid) need the grounding extra: pip install "glasswarp[grounding]".

Reference agent loops

  • minesweeper_solver_demo.py — demo with CV + solver (no LLM)
  • gemini_agent_loop.py — SoM → Gemini → click_target → verify
  • claude_agent_loop.py — observe → Claude → act (skips idle frames by default)
  • templates/observe_think_act/ — bare skeleton
See Minesweeper and Build an agent loop.