Skip to content

Latest commit

 

History

History
76 lines (57 loc) · 1.94 KB

File metadata and controls

76 lines (57 loc) · 1.94 KB

Quickstart

This guide runs a persistent standalone Otari with Docker Compose. For an ephemeral, no-clone example, use the README quickstart.

Prerequisites

  • Docker with Compose
  • A provider API key

Configure

git clone https://github.com/mozilla-ai/otari
cd otari
cp config.example.yml config.yml

Edit config.yml to set a master key, provider, and pricing:

database_url: "postgresql://otari:otari@postgres:5432/otari"
master_key: "choose-a-strong-management-key"
default_pricing: true

providers:
  openai:
    api_key: "sk-..."

This local file is gitignored. For a shared deployment, inject secrets through the environment or your platform's secret manager instead.

default_pricing: true uses bundled prices for common models. Without it, add explicit pricing for the model you call. Otari rejects unpriced budgeted traffic by default.

To store provider credentials through the dashboard instead, leave providers empty and set OTARI_SECRET_KEY to a Fernet key generated by otari gen-secret-key.

Start

docker compose pull
docker compose up -d
curl http://localhost:8000/health

The first startup on an empty database creates an API key and prints it once. Find the gw- value in the Otari container logs. You can also create a key from the dashboard at http://localhost:8000/.

Send a request

curl http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer gw-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai:gpt-4o-mini",
    "messages": [{"role": "user", "content": "Say hello."}]
  }'

The request is authenticated, checked against applicable budgets, routed with the provider credential held by Otari, and recorded in Activity and Usage.

Next steps