Deploy Otari, Mozilla AI's OpenAI-compatible LLM gateway, on Render with the official mzdotai/otari image and managed Postgres for keys, budgets, and usage.
This repo packages Mozilla AI's official Otari image as a one-click Render Blueprint. No Python/uv monorepo build on Render.
| Piece | Role |
|---|---|
| Otari | OpenAI-compatible gateway: 40+ providers, virtual keys, budgets, usage |
| mzdotai/otari | Official gateway image |
| Render Web Service | Runs the image (runtime: image) |
| Render Postgres | Durable keys, budgets, usage, pricing rows |
Bring at least one provider key. Point any OpenAI client at your *.onrender.com URL.
flowchart LR
clients["Apps / OpenAI SDKs"] --> otari["otari<br/>mzdotai/otari"]
otari --> db[("otari-db<br/>Postgres")]
otari -.->|"provider keys"| providers["OpenAI / Anthropic / …"]
- Click Deploy to Render. Render forks this template into your GitHub account and applies
render.yaml. - On Apply, enter at least one provider key (
OPENAI_API_KEY,ANTHROPIC_API_KEY,MISTRAL_API_KEY, orGEMINI_API_KEY). Leave unused keys blank. - Render pulls
mzdotai/otari:0.2.0, starts on port8000, and wiresOTARI_DATABASE_URLfrom Postgres. - On first boot,
auto_migrate+bootstrap_api_keycreate the schema and print a one-timegw-…API key in the logs. - Call
/v1/chat/completions(or other OpenAI-compatible routes) with that key.
| Resource | Type | Plan | Notes |
|---|---|---|---|
otari |
Web (runtime: image) |
starter | Health check /health; pinned 0.2.0 |
otari-db |
Postgres 16 | basic-256mb | Private (ipAllowList: []) |
Default region: oregon. Keep both resources in the same region. Previews are off. This Blueprint does not include optional tool backends (code-exec, web search, guardrails).
- A Render account
- At least one LLM provider API key
- Click Deploy to Render above and fork into your GitHub account.
- On Apply, set at least one provider key. Confirm
otari(Starter) andotari-db(Basic-256mb). - Wait until both are Live (~3–6 minutes; first image pull can take longer).
- Open the
otariservice Logs, copy the bootstrapgw-…key printed once on first startup. - Hit health, then call the gateway with your OpenAI client pointed at the service URL.
Health check:
curl -sS https://<your-otari-service>.onrender.com/healthSmoke chat (replace URL, key, and model):
curl -sS https://<your-otari-service>.onrender.com/v1/chat/completions \
-H "Authorization: Bearer gw-…" \
-H "Content-Type: application/json" \
-d '{"model":"openai:gpt-4o-mini","messages":[{"role":"user","content":"hi"}]}'| Feature | Description |
|---|---|
| Official image | Uses maintained mzdotai/otari tags; no source build |
| Managed Postgres | OTARI_DATABASE_URL wired via fromDatabase |
| One-click Blueprint | Web + Postgres via projects / environments |
| Bootstrap API key | First-boot gw-… key in logs (OTARI_BOOTSTRAP_API_KEY) |
| Auto migrate | Schema ready on startup (OTARI_AUTO_MIGRATE) |
| Pinned by default | Image set to 0.2.0; bump deliberately |
| Variable | Source | Description |
|---|---|---|
PORT / OTARI_PORT |
Wired | 8000 (Otari listen port; both set for Render's scanner) |
OTARI_HOST |
Wired | 0.0.0.0 |
OTARI_DATABASE_URL |
Wired | From otari-db connection string |
OTARI_MASTER_KEY |
Auto-generated | Management / admin secret |
OTARI_REQUIRE_PRICING |
Wired | false for env-only deploys without a pricing table |
OTARI_AUTO_MIGRATE |
Wired | true |
OTARI_BOOTSTRAP_API_KEY |
Wired | true (prints first-use gw-… key once) |
OPENAI_API_KEY |
Optional (sync: false) |
OpenAI provider |
ANTHROPIC_API_KEY |
Optional (sync: false) |
Anthropic provider |
MISTRAL_API_KEY |
Optional (sync: false) |
Mistral provider |
GEMINI_API_KEY |
Optional (sync: false) |
Gemini provider |
See .env.example and upstream configuration docs.
# render.yaml
image:
url: docker.io/mzdotai/otari:0.2.0
# floating:
# url: docker.io/mzdotai/otari:latestautoDeployTrigger: off so tag edits do not redeploy until you choose Manual Deploy.
| Resource | Approx. monthly |
|---|---|
| Web service (Starter) | ~$7 |
Postgres (basic-256mb) |
~$6 |
| Total | ~$13 |
Provider tokens are billed by your LLM vendors. Starter is usually enough for light gateway traffic; raise the web plan if you see OOM or sustained CPU pressure.
| Problem | Solution |
|---|---|
| Health check fails / no open ports | Confirm PORT and OTARI_PORT are both 8000. Check logs for migrate errors. |
No bootstrap gw-… key |
Look at first deploy logs only; key is printed once. Or create a key via management APIs with OTARI_MASTER_KEY. |
| Provider errors / empty model | Set at least one provider key in Dashboard → Environment. |
| Pricing / require_pricing failures | Blueprint sets OTARI_REQUIRE_PRICING=false. Add pricing via API or OTARI_CONFIG_YAML when ready. |
| Image pull failures | Confirm mzdotai/otari:0.2.0 on Docker Hub. Retry deploy. |
render.yaml Render Blueprint (image + Postgres)
README.md This file
LICENSE MIT (template wrapper)
.env.example Optional local / env notes
assets/ Hero / logo
Render:
Otari:
MIT for this template wrapper.
Upstream Otari is Apache-2.0. Star that repo if this helped.
