Metadata-Version: 2.3
Name: londonaicentre-mesa-runtime
Version: 0.1.0
Author: Martin Chapman
Author-email: Martin Chapman <contact@martinchapman.co.uk>
Requires-Dist: boto3>=1.35
Requires-Dist: httpx>=0.28
Requires-Dist: pydantic>=2.0
Requires-Python: >=3.12
Description-Content-Type: text/markdown

# mesa-runtime/lib

A thin, programmatic wrapper around CI in this repo comprising a simple [backend](../frontend/deploy/) and a library that communicates with it.

## Usage

```python
from mesa_runtime import MesaRuntime

client = MesaRuntime("https://example.cloudfront.net", "username", "password")

run_id = client.dispatch("batch-2026-01", "foo", "onco")
print(client.get_run(run_id))
```

Batch inference uploads the batch file with the caller's AWS credentials:

```python
run_id = client.run_batch_inference("foo/bar", "baz", "qux.jsonl", "quux")
print(client.get_inference_run(run_id))
```

## API

| Method | Description |
|--------|-------------|
| `list_training_data()` | List available training data objects from S3 |
| `dispatch(training_batch_name, model_name, schema, ...)` | Trigger a workflow run, returns its ID |
| `get_run(run_id)` | Fetch a single run by ID |
| `list_runs()` | List the ten most recent runs |
| `list_queued_runs()` | List all pending runs |
| `cancel(run_id)` | Cancel a run |
| `get_logs(run_id, ...)` | Fetch step logs for a run |
| `get_step_inputs(run_id)` | Extract dispatch inputs from step env vars |
| `get_runner_status()` | Get runner online/busy status |
| `run_batch_inference(job_id, model_id, batch_file, bucket, ...)` | Upload a Bedrock batch file and trigger an inference run, returns its ID |
| `get_inference_run(run_id)` | Fetch a single inference run by ID |
| `list_inference_runs()` | List the ten most recent inference runs |
| `cancel_inference(run_id)` | Cancel an inference run |
| `get_inference_logs(run_id, ...)` | Fetch step logs for an inference run |
