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(), etc.) delegate to
a process-wide default Cirron instance. Instantiate the class
directly for self-hosted endpoints, multi-workspace setups, custom
spool directories, or test harnesses.
The Cirron class
profile,
scope, mark, epochs, batches, load, env, secret,
inference, wrap.
Multi-workspace / multi-endpoint
Two independent instances coexist in one process. Use this for self-hosted + cloud comparisons or for driving traces into two workspaces from the same script.Config resolution order
Every config value resolves in this order, first match wins:- Explicit constructor argument (or explicit function argument)
CIRRON_*environment variables (CIRRON_API_KEY,CIRRON_API_ENDPOINT,CIRRON_WORKSPACE_ID, …)~/.cirron/config.toml: written bycirron login(planned) or by hand- SDK defaults
~/.cirron/config.toml is a plain TOML file:
cirron.yaml project config
cirron.yaml is the project-level configuration file, shared across
the Cirron CLI, the SDK, and the Cirron platform. It lives at the
project root and is the canonical format.
If you prefer JSON, cirron.json is also accepted: the CLI, SDK, and
platform all resolve cirron.yaml → cirron.yml → cirron.json in
that order, picking the first one they find. The schema is identical
across both formats. YAML is the default in new projects, JSON is
fine if that is your preference.
The full schema covers build, deploy, and serving metadata used by
the CLI and platform. See the
CLI docs on cirron.yaml for the full
surface. The SDK itself reads a narrower subset:
| Section | Used by the SDK for |
|---|---|
name, version | Identity: stamped onto traces, shown in the dashboard |
framework | One of pytorch, tensorflow, sklearn, onnx; narrows hook autodetect |
type | One of classification, regression, time-series, embedding, computer-vision |
profiling | Defaults for ci.profile(): snapshot mode, sample rate, flush interval |
servingConfig | Runtime, input / output JSON schemas, class labels, feature order |
env | Environment variables merged into the container at build time |
secrets | Secret names the project declares (platform validates they’re configured) |
data | Dataset registrations: aliases ci.load() resolves when source="platform" |
build, deploy, environments
sections) are tolerated without error. The SDK’s Pydantic model is
configured with extra="allow" so the same cirron.yaml feeds all
three tools.
Example
Defaults when sections are omitted
profilingabsent → SDK defaults (snapshots="stats",sample_rate=0.01,flush_interval=1.0).servingConfigabsent → no platform-side serving contract; the deployment falls back to the runtime’s generic request handler.env/secrets/dataabsent → empty dict / list (the SDK treats them as “nothing declared” rather than an error).
description is optional; name, version, framework, and
type are required at the top level.
Aliasing
The SDK accepts bothservingConfig (camelCase, matches the CLI /
platform convention) and serving_config (snake_case, matches
Pydantic / Python convention). They’re interchangeable in YAML.
Environment Variables
os.environ with .env file support and JSON
auto-parsing.
.envloading: on first call,ci.env()loads a.envfile from the current working directory viapython-dotenvif installed. If not installed,.envloading is skipped silently;os.environis read directly.- JSON auto-parsing: values starting with
{or[are parsed as JSON. Scalars (numbers,"true","false") stay as strings; users cast them. This avoids surprises like"123"becoming an int you didn’t expect.
Platform context
When running inside a Cirron pipeline or deployment, the runner injects these automatically:| Variable | Purpose |
|---|---|
CIRRON_RUN_ID | Run this process belongs to |
CIRRON_PIPELINE_ID | Pipeline this run executed as (if any) |
CIRRON_DEPLOYMENT_ID | Deployment this process is part of (if any) |
CIRRON_WORKSPACE_ID | Owning workspace |
ci.env() reads them like any other env var. ci.profile() reads
them internally to set span attribution and to pick the transport.
Secrets
CIRRON_SECRET_<NAME>: env var (hyphens innamemap to underscores;name.upper()is the env var suffix)- File mount:
/etc/cirron/secrets/<name>(trailing newline stripped). Used in air-gapped environments where env vars aren’t the injection mechanism. CirronSecretNotFound: raised if neither is present, with a message pointing at the platform’s secrets UI.
Error types
The top-levelcirron package exposes the SDK-wide error types:
cirron.core.errors (they aren’t
re-exported from the top level yet):
Next
Cirron class reference
Full constructor and method signatures.
Schemas
The spool JSON layout and safetensors snapshot layout.