# interpret — EKG interpretation service (Layer 3)

Python 3.12 + FastAPI + Anthropic SDK. Accepts an EKG image and returns a
schema-validated `Interpretation` JSON. The only layer that sees raw images.

## Local dev

```bash
cd apps/ekg-tutor/interpret
uv venv
uv pip install -e ".[dev]"
uv run uvicorn src.main:app --host 127.0.0.1 --port 3112 --reload
```

## Production

Runs under systemd as `ekg-tutor-interpret.service`. See
`../infra/systemd/ekg-tutor-interpret.service` and `../docs/DEPLOY.md`.

## Pydantic regeneration

```bash
uv run datamodel-codegen \
  --input ../contracts/dist/schema.json \
  --input-file-type jsonschema \
  --output src/schemas/generated.py \
  --output-model-type pydantic_v2.BaseModel
```
