Skip to main content
Module-level functions (ci.profile(), ci.load(), ci.mark(), …) are sugar over a process-wide default Cirron instance. Instantiate the class directly when you need a self-hosted endpoint, a custom spool directory, multi-workspace routing, or an isolated instance for tests.

Constructor

Parameters

NameTypeDefaultPurpose
api_keystr?None (falls back to env)Workspace API key; normally read from CIRRON_API_KEY
api_endpointstr"https://app.cirron.com"Control-plane base URL; point at a self-hosted install
workspace_idstr?None (falls back to env)Target workspace; normally read from CIRRON_WORKSPACE_ID
output_dirstr"./.cirron/"Local spool + snapshots root
snapshotsstr"stats"Snapshot mode; see ci.profile
sample_ratefloat0.01Fraction of epochs to sample in "sampled" mode
flush_intervalfloat1.0Flush-thread wake interval (seconds)
spool_max_bytesint1_000_000_000 (1 GB)Oldest batch files evicted when the spool exceeds this
load_warn_bytesint1_000_000_000 (1 GB)ci.load() logs a WARNING at or above this size
load_max_bytesint10_000_000_000 (10 GB)ci.load() raises CirronDataSizeError at or above this
outputstr or list[str]?None (= "spool")Default output= for profile() calls on this instance
trace_buffer_max_spansint?None (= 100_000)Cap on retained spans in the in-memory ci.trace() buffer
Config resolution order: explicit argument → CIRRON_* env var → ~/.cirron/config.toml → default.

Methods

Every method mirrors its module-level counterpart; the module-level function just calls get_default().method(...). Linked pages are the source of truth for each method.
ci.watch, ci.flush, ci.health, and ci.shutdown are module-level only: they operate on the active profiler singleton rather than on a Cirron instance. Use them as cirron.watch(model) / cirron.flush() etc. even when you’ve built an explicit Cirron instance.

profile

scope

mark

epochs / batches

trace

Read back the current session’s scope tree. See ci.trace for the full surface.

load

inference

wrap

env

secret

get_default()

Returns the lazy-initialized default Cirron instance. Rarely needed directly; reach for it only when you want to inspect or mutate the instance that the module-level functions are delegating to.

Multi-instance use

Independent Cirron instances coexist in one process without interfering. Useful for self-hosted-plus-cloud comparisons, for driving two workspaces from one script, or for test harnesses.
Each instance has its own scope stack, mark buffer, spool directory, and flush thread. Nothing is shared.

Configuration guide

Narrative walk-through of env vars, config.toml, and credential resolution.

Core concepts

Scope tree, marks, transport, overhead.