Module-level functions (Documentation Index
Fetch the complete documentation index at: https://docs.cirron.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Name | Type | Default | Purpose |
|---|---|---|---|
api_key | str? | None (falls back to env) | Workspace API key; normally read from CIRRON_API_KEY |
api_endpoint | str | "https://app.cirron.com" | Control-plane base URL; point at a self-hosted install |
workspace_id | str? | None (falls back to env) | Target workspace; normally read from CIRRON_WORKSPACE_ID |
output_dir | str | "./.cirron/" | Local spool + snapshots root |
snapshots | str | "stats" | Snapshot mode; see ci.profile |
sample_rate | float | 0.01 | Fraction of epochs to sample in "sampled" mode |
flush_interval | float | 1.0 | Flush-thread wake interval (seconds) |
spool_max_bytes | int | 1_000_000_000 (1 GB) | Oldest batch files evicted when the spool exceeds this |
load_warn_bytes | int | 1_000_000_000 (1 GB) | ci.load() logs a WARNING at or above this size |
load_max_bytes | int | 10_000_000_000 (10 GB) | ci.load() raises CirronDataSizeError at or above this |
output | str or list[str]? | None (= "spool") | Default output= for profile() calls on this instance |
trace_buffer_max_spans | int? | None (= 100_000) | Cap on retained spans in the in-memory ci.trace() buffer |
CIRRON_* env var → ~/.cirron/config.toml → default.
Methods
Every method mirrors its module-level counterpart; the module-level function just callsget_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
ci.trace for the full surface.
load
inference
wrap
env
secret
get_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
IndependentCirron 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.
Related
Configuration guide
Narrative walk-through of env vars,
config.toml, and credential resolution.Core concepts
Scope tree, marks, transport, overhead.