Skip to main content

Athena Labs Python SDK for agentic ML workflow orchestration

Project description

buildathena-sdk

PyPI version Python 3.11+ Status: Alpha

Python SDK for building blocks and workflows on the Athena Labs ML orchestration platform. Athena Labs makes ML workflows reproducible, observable, interruptible, and composable through a DAG execution engine with an AI agent that can build, run, monitor, and fix pipelines.

Alpha software — APIs may change between releases. Pin your version in production.

Installation

pip install buildathena-sdk

Requires Python 3.11+.

Quick Start

Define a block, read resolved config from ctx.config, emit metrics and progress, and register an explicit artifact when you want a durable named asset:

from athena import BlockContext, ConfigRef, block

@block(
    name="TrainModel",
    config=ConfigRef(search_path="conf", config_name="train"),
)
async def train_model(ctx: BlockContext) -> dict:
    epochs = int(ctx.config.get("epochs", 100))
    learning_rate = float(ctx.config.get("learning_rate", 1e-3))

    for epoch in range(epochs):
        loss = train_epoch(lr=learning_rate)
        await ctx.emit_metric("loss", loss, step=epoch)
        await ctx.emit_progress(epoch + 1, epochs)
        await ctx.check_pause()  # cooperative pause point

    checkpoint = await ctx.artifacts.register("model.pt", schema_type="checkpoint")
    return {"checkpoint": checkpoint.as_ref()}

Consuming Inputs

Block inputs come from the Python signature after ctx. Athena hydrates those arguments from upstream outputs before invoking the block:

@block(name="Evaluate", outputs=["report"])
async def evaluate(ctx: BlockContext, checkpoint) -> dict:
    checkpoint_ref = checkpoint
    checkpoint_path = await ctx.artifacts.resolve(checkpoint_ref)
    model = load_model(checkpoint_path)
    score = run_eval(model)
    await ctx.emit_metric("accuracy", score)
    return {"report": {"accuracy": score}}

Credentials

Declare required secrets in the @block decorator and access them at runtime via ctx.secrets. Credentials are encrypted at rest and injected only during execution:

@block(name="FetchData", secrets=["API_KEY"])
async def fetch_data(ctx: BlockContext) -> dict:
    key = ctx.secrets["API_KEY"]
    data = await download(api_key=key)
    return {"dataset": data}

Declare outputs on the decorator and return a mapping with exactly those keys.

Cooperative Pause

Call check_pause() inside long-running loops to let Athena Labs pause the block between iterations without losing progress:

for epoch in range(epochs):
    train_step()
    await ctx.check_pause()  # yields control if a pause was requested

BlockContext API

Method / Accessor Description
ctx.secrets["KEY"] Access declared secrets
await ctx.emit_metric(name, value, step=, labels=) Emit one scalar metric
await ctx.emit_metrics({"loss": loss, "accuracy": acc}, step=, labels=) Emit multiple scalar metrics
await ctx.emit_progress(current, total, message=) Emit progress (current/total)
await ctx.emit_log(message, level=, source=) Emit a structured log event
await ctx.check_pause() Cooperative pause checkpoint
await ctx.artifacts.register(source, schema_type=, format=, name=, tags=, metadata=) Create a durable artifact
artifact.as_ref() / artifact.as_data() Choose pointer or hydrated downstream delivery
await ctx.artifacts.resolve(ref) Resolve any Athena-readable artifact to a local path
await ctx.artifacts.load(ref) Load and deserialize a formatted artifact

Config System

Athena Labs supports YAML configuration with composition, inheritance, and variable substitution:

# base.yaml
training:
  epochs: 100
  optimizer: adam

# experiment.yaml
$extends: base.yaml
training:
  epochs: 200
  learning_rate: ${LR:-1e-3}

See the full config docs for $include, $extends, and ${ref} substitution.

Documentation

License

Proprietary - Copyright (c) 2026 Athena Labs Research Inc. All rights reserved.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

buildathena_sdk-0.3.20.tar.gz (77.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

buildathena_sdk-0.3.20-py3-none-any.whl (57.4 kB view details)

Uploaded Python 3

File details

Details for the file buildathena_sdk-0.3.20.tar.gz.

File metadata

  • Download URL: buildathena_sdk-0.3.20.tar.gz
  • Upload date:
  • Size: 77.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for buildathena_sdk-0.3.20.tar.gz
Algorithm Hash digest
SHA256 a4f6f8477f52ea1c76447a6ffc305182f83ef1e6c2f484064108290a39bfdfca
MD5 bb437211ef520b5f195d46400d5336bd
BLAKE2b-256 40730baecfca5c1b6cbee434e5571affb325bb80afdc30958b482b61a30a8c9a

See more details on using hashes here.

File details

Details for the file buildathena_sdk-0.3.20-py3-none-any.whl.

File metadata

File hashes

Hashes for buildathena_sdk-0.3.20-py3-none-any.whl
Algorithm Hash digest
SHA256 0801e02a99d815479d8491793ea75cdd94af63183abb38033dc82fb04860e559
MD5 633c81dba816ad3be52b978592065d9f
BLAKE2b-256 8201354c823ad9ea88495dc9550a59b479cee8c0fb15bd0ff3f0c3c6346dddbd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page