Skip to content

render-examples/otari-render-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Otari on Render

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.

Deploy to Render

Render Otari Docker image Docs

Otari

What This Template Shows

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.

Architecture

flowchart LR
  clients["Apps / OpenAI SDKs"] --> otari["otari<br/>mzdotai/otari"]
  otari --> db[("otari-db<br/>Postgres")]
  otari -.->|"provider keys"| providers["OpenAI / Anthropic / …"]
Loading

How It Works

  1. Click Deploy to Render. Render forks this template into your GitHub account and applies render.yaml.
  2. On Apply, enter at least one provider key (OPENAI_API_KEY, ANTHROPIC_API_KEY, MISTRAL_API_KEY, or GEMINI_API_KEY). Leave unused keys blank.
  3. Render pulls mzdotai/otari:0.2.0, starts on port 8000, and wires OTARI_DATABASE_URL from Postgres.
  4. On first boot, auto_migrate + bootstrap_api_key create the schema and print a one-time gw-… API key in the logs.
  5. 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).

Quick Start

Prerequisites

Deploy

  1. Click Deploy to Render above and fork into your GitHub account.
  2. On Apply, set at least one provider key. Confirm otari (Starter) and otari-db (Basic-256mb).
  3. Wait until both are Live (~3–6 minutes; first image pull can take longer).
  4. Open the otari service Logs, copy the bootstrap gw-… key printed once on first startup.
  5. 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/health

Smoke 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"}]}'

Features

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

Configuration

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.

Pin or float the image

# render.yaml
image:
  url: docker.io/mzdotai/otari:0.2.0
  # floating:
  # url: docker.io/mzdotai/otari:latest

autoDeployTrigger: off so tag edits do not redeploy until you choose Manual Deploy.

Cost

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.

Troubleshooting

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.

Project Structure

render.yaml       Render Blueprint (image + Postgres)
README.md         This file
LICENSE           MIT (template wrapper)
.env.example      Optional local / env notes
assets/           Hero / logo

Learn More

Render:

Otari:

License

MIT for this template wrapper.

Upstream Otari is Apache-2.0. Star that repo if this helped.

About

Self-hosted Otari LLM gateway on Render: official image + managed Postgres

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors