Quickstart
This guide runs a persistent Otari with Docker Compose. For an ephemeral, no-clone example, use the README quickstart.
Prerequisites
Docker with Compose
A provider API key, or a self-hosted model server such as llama.cpp
Configure
git clone https://github.com/mozilla-ai/otari
cd otariCompose reads the settings from .env. Create it once; the guard leaves an existing .env alone, because a second OTARI_SECRET_KEY would make stored provider keys undecryptable:
test -e .env || cat > .env <<EOF
OTARI_CONFIG_PATH=/dev/null
OTARI_DATABASE_URL=postgresql://otari:otari@postgres:5432/otari
OTARI_MASTER_KEY=$(openssl rand -hex 32)
OTARI_DEFAULT_PRICING=true
OTARI_SECRET_KEY=$(docker run --rm mzdotai/otari:latest otari gen-secret-key)
OTARI_PROVIDER_ACCOUNT_PEPPER=$(openssl rand -base64 32)
EOFOTARI_CONFIG_PATH=/dev/nullruns Otari on environment variables alone.OTARI_MASTER_KEYsigns you in to the dashboard.OTARI_DEFAULT_PRICINGprices common models from bundled rates.OTARI_SECRET_KEYencrypts the provider keys you add in the dashboard.OTARI_PROVIDER_ACCOUNT_PEPPERturns on provider copies of attached files. Without it, Otari starts with them off and logs a warning. See Provider copies.
.env is gitignored. For a shared deployment, inject these through your platform's secret manager instead.
Start
The first startup on an empty database creates an API key and prints it once. Find the tk- value in the Otari container logs. You can also create a key from the dashboard at http://localhost:8000/.
Add a provider
Open the dashboard at
http://localhost:8000/and sign in with the master key.Open the account menu, choose Deployment, then Hosted providers (
http://localhost:8000/admin/hosted-providers).Choose Add provider, pick the provider (for example OpenAI), paste its API key, and save. Otari lists the models the key reaches.
Check that each model you want to serve is switched on and priced.
OTARI_DEFAULT_PRICINGprices common models from bundled rates. A model nothing prices arrives switched off, and Otari rejects unpriced budgeted traffic by default, so set a price on the model's row and switch it on.
See Hosted providers and Admin dashboard for the rest of the page.
Send a request
The request is authenticated, checked against applicable budgets, routed with the provider credential held by Otari, and recorded on the dashboard's Overview.
Self-hosted llama.cpp
Start llama-server with --alias, so the model id it serves is a stable name rather than the path of the GGUF file:
On the Hosted providers page, add a provider of type llama.cpp (llamacpp). It needs no API key, so leave the key blank, rather than using the openai provider with a placeholder key. Set the API base URL to where Otari reaches the server: http://host.docker.internal:8080/v1 from the Compose container on macOS or Windows, or the host's address on Linux.
Bundled pricing does not cover a local model, so set a price on its row (0 is accepted) and switch it on. The id you price is the alias, and it is also the model you request:
Without --alias, the server reports the file path as the model id, so a price set under a shorter name never matches it and requests are refused.
Next steps
Last updated
Was this helpful?
