Skip to content
프로젝트

소개

직접 운영할 수 있는 오픈 소스 AI 게이트웨이입니다. 하나의 엔드포인트에서 40개 이상의 프로바이더를 연결하고, 가상 키·예산·사용량을 추적할 수 있습니다.

AI 및 머신러닝

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
+8
in 7 days
+51
in 15 days
+69
in 1 month
+191

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

Otari logo

An AI gateway you own and run.

Route one endpoint to 40+ providers, issue virtual keys, enforce budgets, and track usage.

Tests Lint Typecheck Docker Python 3.13+

Docs · otari.ai · Launch blog · Discord

English · 简体中文

Otari dashboard tour: spend overview, usage by model, a request rescued by a routing fallback, two models compared in the Playground, the model catalog, routing policies, API keys, members, budgets, and providers

Otari sits between your applications and model providers. It authenticates requests, resolves provider credentials, enforces budgets before dispatch, and records usage afterwards. Provider calls go through any-llm.

Run Otari with your own database and provider keys.

Why Otari

  • One OpenAI and Anthropic-compatible endpoint for many providers
  • Provider credentials stay behind the gateway
  • Revocable API keys with user, workspace, and model scope
  • Budget checks before spend and usage records after settlement
  • Local routing policies for failover, conditional selection, traffic splitting, and spill-over past a rate limit
  • Optional code execution, web search, MCP, inference guardrails, and file understanding

Quickstart

Run Otari with Docker. It needs no configuration:

docker run -v otari:/data -p 127.0.0.1:8000:8000 mzdotai/otari:latest

On its first start, Otari prints a setup link once, and little else:

Otari 1.0.0 is running at http://localhost:8000

Open this link to choose your password and finish setup:

http://localhost:8000/setup#key=otari-mk-...

It is shown only once and carries your master key, so treat it like one.

Open it and choose the email and password you will sign in with. The key in the link is the gateway's master key, so keep the link private. The dashboard then walks you to a first request:

  1. Welcome to Otari asks for a name for the workspace your API keys and requests live in.
  2. Choose where models come from: Connect otari.ai for its hosted open-weight models, or No, I'll bring my own keys to add a provider and its API key. I'll do this later on the provider key screen leaves the gateway with no provider; Activity shows how to add one, and accepting Enable default pricing there lets its models serve.
  3. What will you use Otari for? offers a coding agent or your own product, then hands you an API key and a command to paste. The page says It worked once the request lands.

From then on, create API keys on the API keys page and send requests with them, naming a model the Models page lists:

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

OpenAI clients work by setting base_url to http://localhost:8000/api/v1.

The otari volume holds the SQLite database and, beside it, the generated key that encrypts stored provider credentials, so a new container started with the same -v otari:/data keeps its data. Without -v, Docker gives each container a fresh anonymous volume. Use the Compose setup below to run on PostgreSQL.

The command a developer runs next to a coding agent (otari hook, otari import claude-code) installs on its own, without the server:

brew install mozilla-ai/tap/otari

See Agent Guardrails and Claude Code.

Run the full stack

git clone https://github.com/mozilla-ai/otari
cd otari
cp config.example.yml config.yml
# Set a master key, provider credentials, and pricing in config.yml.
# Provider copies of attached files are off until they have a pepper of their own. Compose reads .env.
grep -qs OTARI_PROVIDER_ACCOUNT_PEPPER .env || echo "OTARI_PROVIDER_ACCOUNT_PEPPER=$(openssl rand -base64 32)" >> .env
docker compose pull
docker compose up -d

Compose runs Otari with PostgreSQL. Optional profiles add the code sandbox and web search services:

docker compose --profile code-exec --profile web-search up -d

The dashboard is served at http://localhost:8000/. To store provider keys through the dashboard on PostgreSQL, set OTARI_SECRET_KEY to a Fernet key generated by otari gen-secret-key.

API and dashboard

The core completion routes are:

  • POST /api/v1/chat/completions
  • POST /api/v1/messages
  • POST /api/v1/responses

Otari also serves the broader OpenAI-compatible and management APIs. The running server publishes Swagger UI at /api/v1/docs and OpenAPI at /api/v1/openapi.json. See API reference.

The dashboard manages providers, models, routing, tools, keys, members, budgets, settings, activity, and usage. Its navigation adapts to the signed-in person's authority. See Run the dashboard.

Development

git clone https://github.com/mozilla-ai/otari
cd otari
uv sync --dev
cp config.example.yml config.yml
uv run otari serve --config config.yml

For local development without PostgreSQL, change database_url to sqlite+aiosqlite:///./otari.db.

Common checks:

make test
make lint
make typecheck

See CONTRIBUTING.md before opening a pull request.

Documentation

License

Apache 2.0. See LICENSE.

관련 프로젝트 살펴보기

불러오는 중…