Skip to main content
Module-level functions (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.
Two independent instances coexist in one process, useful for self-hosted + cloud comparisons or for driving traces into two workspaces from the same script:
For the full constructor signature and per-method docs, see Cirron.

Resolution order

Every config value resolves in this order, first match wins:
  1. Explicit constructor argument (or explicit function argument)
  2. CIRRON_* environment variables (CIRRON_API_KEY, CIRRON_API_ENDPOINT, CIRRON_WORKSPACE_ID, …)
  3. ~/.cirron/config.toml: written by cirron login (planned) or by hand
  4. 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 platform. It lives at the project root. cirron.yml and cirron.json are also accepted. The CLI, SDK, and platform resolve them in that order, picking the first one they find. The schema is identical across formats. The full schema covers build, deploy, and serving metadata used by the CLI and platform. See the CLI docs for the full surface. The SDK itself reads a narrower subset:
SectionUsed by the SDK for
name, versionIdentity: stamped onto traces, shown in the dashboard
frameworkOne of pytorch, tensorflow, sklearn, onnx; narrows hook autodetect
typeOne of classification, regression, time-series, embedding, computer-vision
profilingDefaults for ci.profile(): snapshot mode, sample rate, flush interval
servingConfigRuntime, input/output JSON schemas, class labels, feature order
envEnvironment variables merged into the container at build time
secretsSecret names the project declares (platform validates they’re configured)
dataDataset registrations: aliases ci.load() resolves when source="platform"
Extra fields (e.g. the CLI’s build, deploy, environments sections) are tolerated. The SDK’s Pydantic model uses extra="allow" so the same cirron.yaml feeds all three tools. name, version, framework, and type are required; description, profiling, servingConfig, env, secrets, and data are optional and fall back to SDK defaults when omitted. The SDK accepts both servingConfig (camelCase, matches the CLI/platform convention) and serving_config (snake_case, matches Pydantic). They’re interchangeable.

Example

Platform context env vars

When running inside a Cirron pipeline or deployment, the runner injects these automatically. ci.profile() reads them to set span attribution and pick the transport:
VariablePurpose
CIRRON_RUN_IDRun this process belongs to
CIRRON_PIPELINE_IDPipeline this run executed as (if any)
CIRRON_DEPLOYMENT_IDDeployment this process is part of (if any)
CIRRON_WORKSPACE_IDOwning workspace
For reading your own variables, see ci.env. For platform-mounted secrets, see ci.secret.

Error types

The top-level cirron package exposes the SDK-wide error types:
Data-loader errors live in cirron.core.errors (not re-exported yet): CirronDatasetNotFound, CirronPlatformRequired, CirronDataSizeError. See Errors for the full hierarchy and example handlers.

Next

Cirron class reference

Full constructor and method signatures.

Schemas

The spool JSON layout and snapshot layout.