Skip to main content

Microcosm emitter interface

microcosm-emitter-interface is the small, dependency-free package a Microcosm build imports to hand work to the separately installed microcosm-emitter. Microcosm decides what to hand over; the emitter decides where it goes.

Install the emitter on its own, outside the build's environment:

uv tool install microcosm-emitter

The build then depends on this package with a version range and starts the emitter through it:

from microcosm_emitter_interface import EmitterClient, TelemetryRun, TelemetrySettings

client = EmitterClient.start(
    telemetry=TelemetrySettings(run=TelemetryRun("run-id", "UK", "uk-build")),
)
client.telemetry.transition_stage("calibrating")
client.telemetry.complete()
client.close()

EmitterClient.start runs the microcosm-emitter command as the build's own child process. The command comes from the command argument, then the MICROCOSM_EMITTER_COMMAND environment variable, then PATH. The child inherits the build's environment variables and user, so it finds the same Hugging Face credential: HF_TOKEN, then HUGGINGFACE_TOKEN, then the token saved by hf auth login.

No call raises into the build: not because the emitter is missing, slow or refusing a request, and not because an argument cannot be converted to JSON (for example a multi-element NumPy array or a self-referencing mapping). Each call converts its arguments inside its error handling and reports whether the emitter accepted it; after a refusal, client.last_failure says why (emitter_unavailable, invalid_arguments or not_accepted). Startup settings that cannot be converted start an unavailable client (invalid_configuration). The build continues in every case. Constructing a request object (for example StageRunFiles(...)) that breaks the shared path and identifier rules raises ValueError in the build's own code, before any call.

Calls

Hand-over Call Emitter module
Telemetry event client.telemetry.stage(...), transition_stage, progress, calibration_progress, fail, refuse, complete, emit (each one emit_telemetry) telemetry
Staging run files under runs/<run_id>/ stage_run_files(StageRunFiles(...)), run_files_receipt, read_back_run_files huggingface
Staged dataset bundle, each file with its role stage_dataset_bundle(StageDatasetBundle(...)), dataset_bundle_receipt, check_write_access huggingface
Orrery inputs orrery_inventory, hand_over_orrery_inputs, orrery_receipt, retry_orrery_inputs orrery

Compatibility

Both packages are released together with one version number, and microcosm-emitter==X requires microcosm-emitter-interface==X. A build, though, may run with a different emitter from the interface it depends on: it keeps the emitter it started with, and the next build uses whichever emitter is installed then. So the socket protocol carries its own version:

  • PROTOCOL_VERSION names the shape of every message this package sends. The emitter lists the versions it accepts in its hello answer, and the client refuses an emitter that does not list its version (unsupported_protocol_version); the build continues without it.
  • Every emitter release must accept every protocol version that interface releases still in use send. Adding a module or a message kind keeps the version; changing the shape of an existing message needs a new version, which emitters then accept alongside the old one.
  • fixtures/protocol-v<N>/ holds one JSON file per message of protocol version N, including how the command is started (host-launch.json: its arguments and the configuration object on standard input) and each socket request's whole envelope (host-ping.json, host-message-envelope.json, host-query-envelope.json, host-close.json, and host-hello.json). This package's tests check that each typed call, the launcher and the socket transport send exactly their fixture, and the emitter's contract tests check that it accepts every fixture of every version it supports, so a change to the command's arguments or the envelope cannot pass by changing both sides at once. An emitter's hello answer must contain the recorded keys and may add more. A released fixture is never edited or removed: the emitter's tests pin each one's SHA-256.
  • An emitter that lacks a module this package asks for starts without it (--skip-unavailable-modules); calls for that module report that they were not accepted.

Metadata

Release files for microcosm-emitter-interface 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for microcosm-emitter-interface 0.6.0
File Size Uploaded Provenance
microcosm_emitter_interface-0.6.0.tar.gz 26.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for microcosm-emitter-interface 0.6.0
File Interpreter ABI Platform
microcosm_emitter_interface-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 71.8 kB

Release files / microcosm_emitter_interface-0.6.0.tar.gz

Download URL microcosm_emitter_interface-0.6.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b9b147f363736cfa881388567a37fe4893a9f366318eaea8b8aba2afa9e5017b
BLAKE2b-256 checksum
How to use checksums
1fdb75b6118693cfef005836d4d1243e9513aaa12dc45c0ca330d81004f82a07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / microcosm_emitter_interface-0.6.0-py3-none-any.whl

Download URL microcosm_emitter_interface-0.6.0-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
059d2f47bd9704041b9a2da6b8e412bdd3985f0481a339930952b41c48dc3956
BLAKE2b-256 checksum
How to use checksums
44eebd18120f741343a132c62eec4cb6a9bf512a1435a0d9f0e702f1451fc71f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for microcosm-emitter-interface 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for microcosm_emitter_interface-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page