Examples are grouped by the main API surface they demonstrate.
apps/contains end-to-end demos.agents/contains agent loops, tools, hooks, and MCP examples.media/contains image, video, speech, transcription, multimodal, embedding, and reranking examples.models/contains model streaming, structured output, and provider examples.external/contains examples that use coding-agent CLIs (Claude Code, Codex, fx, pi) where a model goes (experimental; run withrun-examples.py --external).
Provider-specific model examples live under models/<provider>/, such as
models/gateway/, models/openai/, models/anthropic/, and models/typesafe/.
Single-file examples use the root environment: uv run examples/agents/basic.py.
Live examples need the API keys named in their source. Follow each app's README
for its services and dependencies. To test an app against this checkout, add
--with-editable /absolute/path/to/ai-python to its uv run command.
models/gateway/jev_python_ast.py uses Jev to build Python code through typed
AST choices, with a live terminal preview and streamed prompt expansion and
review. Set AI_GATEWAY_API_KEY and run it with uv run python examples/models/gateway/jev_python_ast.py. Set MODEL_ID to override the
expansion/review model.