Skip to content

cayu.evals.external_container

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.evals import external_container_environment_revision

Return the exact public identity of the hardened execution environment.

external_container_environment_revision(*, image: str, runtime: str, memory: str='1g', cpus: str='1.0', pids_limit: int=256) -> str

Release source · Runtime guarantees · Capability guides

from cayu.evals import EXTERNAL_CONTAINER_MAX_INPUT_BYTES
EXTERNAL_CONTAINER_MAX_INPUT_BYTES = 48 << 20

Release source · Runtime guarantees · Capability guides

from cayu.evals import EXTERNAL_CONTAINER_MAX_OUTPUT_BYTES
EXTERNAL_CONTAINER_MAX_OUTPUT_BYTES = 1 << 20

Release source · Runtime guarantees · Capability guides

EXTERNAL_CONTAINER_RESET_CONTRACT_REVISION

Section titled “EXTERNAL_CONTAINER_RESET_CONTRACT_REVISION”
from cayu.evals import EXTERNAL_CONTAINER_RESET_CONTRACT_REVISION
EXTERNAL_CONTAINER_RESET_CONTRACT_REVISION = 'sha256:' + sha256(b'fresh-container:no-network:no-mounts:read-only-root:tmpfs-workspace:v1').hexdigest()

Release source · Runtime guarantees · Capability guides

from cayu.evals import EXTERNAL_CONTAINER_RUNNER_REVISION
EXTERNAL_CONTAINER_RUNNER_REVISION = 'sha256:' + sha256(b'cayu.external-container.runner.v2').hexdigest()

Release source · Runtime guarantees · Capability guides

from cayu.evals import EXTERNAL_CONTAINER_STREAM_PROTOCOL
EXTERNAL_CONTAINER_STREAM_PROTOCOL = 'cayu.external-container.v2'

Release source · Runtime guarantees · Capability guides

from cayu.evals import ExternalContainerLaunchRequestV1

Authority-free input copied into a fresh container before it starts.

Bases: _ExternalContainerModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] 1
protocol Literal['cayu.external-process.v1'] EXTERNAL_PROCESS_PROTOCOL_VERSION
envelope ExternalTrialEnvelopeV1 required
request dict[str, object] required

Release source · Runtime guarantees · Capability guides

from cayu.evals import ExternalContainerOperationAdapter

Execute immutable candidates in fresh, recoverable hardened containers.

Every operation has a deterministic container name derived from the exact external trial identity. Provider start keys are durable aliases to that scientific effect, so a redispatch cannot create a second container for the same trial. The body and input are copied into a stopped container before launch; runtime execution then has no mounts, network, Linux capabilities, writable root, or host credentials. Daemon state and bounded logs are the external-effect reconciliation surface after restart.

Bases: ProviderOperationAdapter.

async ExternalContainerOperationAdapter.start(request: ProviderOperationStartRequest) -> ProviderOperationConnection
async ExternalContainerOperationAdapter.retrieve(state: ProviderOperationState) -> ProviderOperationSnapshot
async ExternalContainerOperationAdapter.reconnect(state: ProviderOperationState) -> ProviderOperationConnection
ExternalContainerOperationAdapter.start_idempotency_support() -> ProviderOperationStartIdempotencySupport
async ExternalContainerOperationAdapter.recover_start(request: ProviderOperationStartRecoveryRequest) -> ProviderOperationConnection
ExternalContainerOperationAdapter.cancellation_support() -> ProviderOperationCancellationSupport
async ExternalContainerOperationAdapter.cancel(state: ProviderOperationState) -> ProviderOperationSnapshot
ExternalContainerOperationAdapter.__init__(*, identity: ExternalProcessTargetIdentityV1, body_root: str | Path, state_root: str | Path, image: str, runtime: str, docker_path: str | None=None, memory: str='1g', cpus: str='1.0', pids_limit: int=256, poll_seconds: float=0.1, _client: _DockerClient | None=None) -> None

Release source · Runtime guarantees · Capability guides

from cayu.evals import ExternalContainerOutputV1

Bounded candidate output returned through daemon-retained container logs.

Bases: _ExternalContainerModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
schema_version Literal[1] 1
output StrictStr Field(max_length=EXTERNAL_CONTAINER_MAX_OUTPUT_BYTES)
usage ExternalContainerUsageV1 required

Release source · Runtime guarantees · Capability guides

from cayu.evals import ExternalContainerUsageV1

Untrusted diagnostic usage reported by the candidate-private runtime.

Bases: _ExternalContainerModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
input_tokens StrictInt Field(ge=0)
output_tokens StrictInt Field(ge=0)
total_tokens StrictInt Field(ge=0)
ExternalContainerUsageV1.validate_total_tokens(value: int, info) -> int

Release source · Runtime guarantees · Capability guides