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

Every parameter defaults to None. The values below are what the layered resolver produces when you pass nothing, not literal parameter defaults, so passing None explicitly is identical to omitting the argument.

Parameters

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

kind is not a named parameter. It is a reserved key inside **attrs, so c.mark("loss", 0.5, kind="summary") works and defaults to "point" when omitted.

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, each carrying its own configuration. Useful for self-hosted-plus-cloud comparisons, for driving two workspaces from one script, or for test harnesses.
What is per-instance is configuration: api_endpoint, api_key, output_dir, output, and the size thresholds. Those drive transport selection and spool location for whichever instance you call.
Instrumentation state is process-wide, not per-instance. The scope stack, the mark buffer, the ci.trace() ring, and the flush-thread supervisor are module-level singletons shared by every instance. A with b.scope(...) opened inside a with a.scope(...) nests on the same stack, and ci.mark() attaches to whichever scope is innermost regardless of which instance opened it. Use separate instances to point at different backends, not to isolate two concurrent trace trees.

Configuration guide

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

Core concepts

Scope tree, marks, transport, overhead.