belvedir: the same concepts as the Node SDK, with context managers instead of callbacks. It auto-instruments the installed anthropic / openai / LangChain / LlamaIndex packages (full list). Coming from belvedir-loop? See Migrating from Fractal.
1. Install the SDK
2. Initialize at process startup
Callinitialize() once, before your agent makes LLM calls. There is no instrumentModules equivalent: auto-instrumentation sees the installed packages directly, so the only ordering rule is initialize() first. A second initialize() call logs a warning and is ignored:
requests / httpx calls to OpenAI-compatible endpoints (POST .../chat/completions) are captured too, streamed responses included; pass instrument_http=False to initialize() to opt out.
3. Wrap agent work in sessions
session links every span under one session id (required for tasks and task groups), and task() optionally marks task boundaries. Both are context managers, they work inside async def bodies, and session also accepts a metadata dict. with_session is an alias of session:
4. Flush before short-lived processes exit
Callloop.flush() before a script or serverless handler returns, or pass disable_batch=True for local testing; see Flush on serverless.
5. Report outcomes
When your app knows whether a session actually worked, callloop.report_outcome(chat_id, "success" if order_shipped else "fail") after flush(); a "fail" keeps that session out of training data. Semantics and return values are on Outcomes.
flush() and report_outcome() never raise; failures log warnings under the belvedir.loop logger.