Built on Mozilla's Otari
Otari is Mozilla.ai's open-source AI gateway: one endpoint for many models, with keys, budgets, guardrails and built-in tools. Every request Leak makes to a model goes through hosted otari.ai.
Eight Otari features, all in use
Open-weight models
Every model Leak calls is open-weight: Qwen 3.5 35B, DeepSeek V4 Flash and Ministral 8B, all through one Otari key.
src/lib/otari.ts ↗Models in distinct roles
Qwen reads the statement, DeepSeek researches the web, Ministral writes the cancellation. Each is the cheapest model that does its job well.
src/lib/pipeline.ts ↗Web search and fetch
DeepSeek calls otari_web_search and otari_web_fetch to find today's price and the cancel page for each subscription.
src/lib/pipeline.ts ↗Code execution
The totals, overlaps and price rises are a Python program the app sends to Otari's sandbox, so the headline number is exact.
src/lib/otari.ts ↗Guardrails
A PII guardrail mandated on the workspace blocks any statement that still carries personal data. The verdict arrives in the Otari-Guardrails header and is shown on each request.
src/lib/otari.ts ↗Per-user budgets
Alex, Sam and Jordan are end users of one service key, each with a daily budget of their own. The app reads their spend back from Otari and shows it as an allowance meter.
src/app/api/members/route.ts ↗Budgets and spend limits
The app's key has a spend ceiling, so a public demo can never run away with the credit. A per-visitor run limit sits in front of it.
src/app/api/analyze/route.ts ↗Routing and fallback
The extract step names the leak-extract failover policy instead of a model: Qwen first, GPT-OSS 20B if Qwen's provider fails. The glass box shows when the backup answered.
src/lib/otari.ts ↗Why a gateway makes Leak trustworthy
A money app should be able to say exactly which model saw your data and what it did. Otari reports that on every response, and Leak shows it to you in the glass box instead of hiding it.
What Otari tells the app on each request
- Otari-Model
- which model actually answered
- Otari-Provider
- which provider served it
- Otari-Fallback
- whether a backup took over
- Otari-Guardrails
- the guardrail's verdict
- Otari-End-User-Budget
- whose budget paid
- usage.cost_usd
- what the request cost
Giving back to Otari
A model sometimes called code execution with no code, and Otari reported the empty run as completed. Now the call is refused, the model is told to try again, it is never billed, and it shows as failed. Found while building Leak.
What building on hosted Otari taught us
- · A request that sends nothing back for 30 seconds is cut off, so every Leak call streams.
- · Past a web search max_uses cap, a model can keep calling and the loop ends in a 422, so Leak batches instead of capping.
- · Streamed DeepSeek code calls reached the sandbox with empty code, which led to the PR above.