Before deploying, set environment variables directly in Render/Vercel or in your shell. Do not commit env files to the repository.
This repo now supports a more production-ready topology:
- API on Render via
render.yaml - managed Postgres provisioned from the same Render blueprint
- optional S3-compatible artifact storage
- Next.js web app on Vercel with same-origin proxying for browser requests
- Open Render Dashboard.
- Click New + -> Blueprint.
- Connect this repo and deploy using
/render.yaml. - After deploy, copy your API URL (for example
https://worldmodel-gym-api.onrender.com). - Create a scoped writer key:
.venv/bin/python -m worldmodel_server.cli create-api-key \
--name production-writer \
--scope runs:write- Store that secret in your submission workflow or benchmark runner.
Optional bootstrap path:
WMG_BOOTSTRAP_API_KEYcan create the first admin/writer key automatically on startup when no API keys exist yet.- Treat it as a one-time escape hatch, not the long-term auth mechanism.
- Remove it from the Render dashboard after a durable production API key is in place.
Notes:
render.yamlenables migrations, JSON logging, and seeded demo runs.WMG_DB_URLis normalized automatically for SQLAlchemy when Render injects a Postgres connection string.- For real artifact durability, switch to
WMG_STORAGE_BACKEND=s3and provide the S3-compatible bucket credentials below.
Add these Render environment variables:
WMG_STORAGE_BACKEND=s3WMG_S3_BUCKET=<bucket-name>WMG_S3_REGION=<region>WMG_S3_ENDPOINT_URL=<endpoint-url>if using Cloudflare R2, MinIO, or another S3-compatible endpointWMG_S3_ACCESS_KEY_ID=<access-key>WMG_S3_SECRET_ACCESS_KEY=<secret-key>WMG_S3_PREFIX=runs
- Open Vercel Dashboard and import this GitHub repo.
- Set Root Directory to
web. - Add environment variable:
NEXT_PUBLIC_API_BASE=https://<your-render-api-url>INTERNAL_API_BASE=https://<your-render-api-url>
- Deploy.
Optional CLI deploy:
make deploy-vercelIf you previously pulled web/.env.local from Vercel CLI, move it aside before running a local production build because it may contain deployment-only values:
mv web/.env.local web/.env.local.bak
cd web && npm run build
mv web/.env.local.bak web/.env.localRun API + web on your machine:
make deployStop local services:
make stopThis mode does not require cloud accounts or credit card setup.
It runs services locally and exposes temporary public URLs through localtunnel.
make deploy-publicStop:
make stop-public- Liveness:
/healthz - Readiness:
/readyz - Metrics:
/metrics
The readiness endpoint now returns per-component checks for database, storage, and auth, and responds with 503 if database or storage is not ready.
Create a benchmark run against a deployed API:
.venv/bin/python scripts/demo_run.py \
--api-base https://worldmodel-gym-api.onrender.com \
--api-key "$WMG_API_KEY"Verify the full public deployment:
.venv/bin/python scripts/verify_deployment.py \
--api-base https://worldmodel-gym-api.onrender.com \
--web-base https://world-model-gym.vercel.app- Render Free tier and pricing: https://render.com/pricing
- Render blueprint spec (
render.yaml): https://render.com/docs/blueprint-spec - Vercel plans and Hobby usage: https://vercel.com/pricing