# Deployment

## Cloudflare Pages Direct Upload

1. Upload the generated ZIP without wrapping it inside another folder.
2. Keep `_worker.js` at the deployment root.
3. Deploy the site.
4. Optionally add `OPENAI_API_KEY` as an encrypted secret.
5. Optionally add `OPENAI_MODEL` as a variable.
6. Redeploy after adding variables.
7. Check `/api/health` and `/source-vault`.

The Worker uses Cloudflare Pages Advanced Mode and forwards non-API requests through `env.ASSETS.fetch(request)`.

## Local Python blueprint

```bash
cd backend-blueprint
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app:app --reload --port 8000
```

Expensive model downloads remain disabled until providers and models are configured explicitly.
