Metadata-Version: 2.5
Name: designate-runner
Version: 0.1.0
Summary: FastAPI deployment app for designate experiments
Author-email: Drew Dimmery <pypi@ddimmery.com>
License-Expression: Apache-2.0
Classifier: Development Status :: 4 - Beta
Requires-Python: >=3.12
Requires-Dist: designate-core[postgres,yaml]
Requires-Dist: fastapi>=0.104
Requires-Dist: uvicorn[standard]>=0.24
Description-Content-Type: text/markdown

# designate-runner

[![PyPI](https://img.shields.io/pypi/v/designate-runner)](https://pypi.org/project/designate-runner/)

FastAPI deployment app for designate experiments.

## Install

**Recommended:** Clone the workspace for cross-package version compatibility:

```bash
git clone https://github.com/passexp/designate.git
cd designate
uv sync --all-packages
```

Or install standalone:

```bash
pip install designate-runner
```

## Run

```bash
DESIGNATE_CONFIG=experiment.yaml uvicorn runner.main:app --host 0.0.0.0 --port 8000
```

`runner/docker-compose.yml` runs the image with a DoltgreSQL database; copy
`.env.example` to `.env` first.

## Endpoints

| Method | Path | Description |
|--------|------|-------------|
| POST | `/assign` | Submit covariates and receive the treatment |
| POST | `/submit-covariates` | Start an assignment in the background (202) |
| GET | `/assign-treatment/{id}` | Wait for a background assignment and return the treatment |
| GET | `/get-treatment/{id}` | Look up a stored treatment |
| POST | `/submit-response` | Record a participant's response, once (204) |
| POST | `/submit-observations` | Record independently keyed outcomes (pair-batch models) |
| POST | `/train` | Rebuild the model from all data and switch to it |
| GET | `/health` | Readiness: 200 when the database answers and a model is loaded, else 503 |
| GET | `/schema` | Experiment config as JSON |
| GET | `/metrics` | In-process counters and timings |

Errors have the body `{"detail": ..., "code": ...}`; `code` is stable. The OpenAPI schema is
served at `/openapi.json`.

## Documentation

- [REST API reference](https://design-ate.dev/reference/rest-api/) — Request and response bodies, status codes
- [Deployment guide](https://design-ate.dev/guides/deployment/) — Docker setup and infrastructure
- [Config schema reference](https://design-ate.dev/reference/config-schema/) — Covariates, feature graph, models, updates
- [Environment variables](https://design-ate.dev/reference/environment-variables/) — Runtime configuration and defaults
