Reference

Example catalogue

A short path through the maintained offline, online, and service examples.

The repository contains small protocol fixtures, provider-backed workflows, and complete applications. Start with the smallest example that demonstrates the boundary you need; the full filesystem remains available for specialised cases.

Run an offline example without credentials:

uv run python examples/offline/revise_until_ok.py

Online examples use ap.model('openai:...') and require OPENAI_API_KEY.

ExampleWhat it demonstratesNetwork
examples/online/hello.pySmallest provider-backed request and replyYes
examples/offline/revise_until_ok.pyChoice, loop, deterministic replies, and terminationNo
examples/offline/projection_error.pyInspecting a branch-visibility failure before executionNo
examples/offline/resume.pyRecalling decisions from a JsonlJournalNo
examples/offline/toolbox.pyA service boundary represented by MachineNo
examples/online/model_composition.pyRetry, fallback, metering, and tracing orderYes

Complete applications

PathWhat it demonstrates
examples/coding_agent.pyTerminal planner, coder, reviewer, and filesystem machine
examples/content-pipeline/Gradio workflow with live research and human editing
examples/triage/FastAPI, SQLite recovery, and human approval through Desk

The coding harness guide explains the boundaries in examples/coding_agent.py. The application directories keep web framework concerns outside the protocol and own their request storage, authentication, and reconnection policy.

Find the remaining examples

The complete current list is generated as /llms-examples.txt. Offline programs run in CI. Online programs are imported and projected in CI; their live model calls stay outside CI. Generating that list from the filesystem prevents this page from becoming a second inventory that must be updated whenever an example moves.

Choose examples by outcome rather than by name:

  • For protocol design, start with revise_until_ok.py or projection_error.py.
  • For deterministic execution and recovery, use resume.py and toolbox.py.
  • For a hosted lifecycle, use content-pipeline/ or triage/.
  • For model policy, use model_composition.py.
Stable

On this page