docs

How Aperture works

A tour of the product — routing, local inference, connecting your own providers, and keeping data private.

What is Aperture?

Aperture is a local-first, least-cost routing system for AI inference. Every query is sent to the cheapest capable tier — your own device first, an efficient cloud model when that's not enough, and a frontier model only for the hardest work. The result is lower cost and better privacy without a meaningful drop in quality.

You interact with one interface; Aperture decides where each request actually runs.

How least-cost routing works

Each query is scored for difficulty, then routed down to the lowest tier that can handle it:

  1. Local — runs on your device via WebGPU. $0 in API fees, fully private.
  2. Efficient cloud — cheap hosted models for medium-difficulty tasks.
  3. Frontier — top models, reserved for the hardest queries.

Among capable options, Aperture prefers providers you've actually connected; unconnected providers only ever return a clearly-labeled simulated response. Try it live on the routing page.

Running models locally

The local tier runs a real model entirely in your browser using WebGPU (via web-llm). Weights download once (~0.9 GB for the default model) and cache; after that nothing you type leaves your machine.

Requirements: a WebGPU-capable browser (recent Chrome, Edge, or Safari) and a GPU. Open run local and click load model locally to start. If WebGPU isn't available, Aperture degrades gracefully and routes to cloud tiers instead.

Connecting your API providers

Bring your own keys for OpenAI, Anthropic, Google Gemini, or any OpenAI-compatible / OpenRouter endpoint on the connections page.

  • Keys are stored only in your browser (localStorage).
  • Requests go through Aperture's own server proxy (/api/chat), which forwards them to the provider — this avoids browser CORS and keeps the key off other origins.
  • Once connected, a provider slots straight into the router and answers for real (tagged live instead of simulated).

Using your Codex CLI login

If you use the OpenAI Codex CLI, Aperture can reuse that login — no key to paste. On the connections page, click login with Codex (or detect existing); the token stays server-side and your configured model is auto-detected.

Local only: this reads ~/.codex on the machine running the server, so it works with npm run dev/start on your own computer, not on a hosted deployment.

Secure / local-only mode

Toggle secure in the top navigation to forbid all cloud transmission. With it on, queries are served only by local models; anything beyond local capability returns an honest "cannot serve locally" rather than silently going to the cloud. The setting persists across reloads.

The unified gateway

The gateway is one interface across every backend, with an aggregated spend ledger showing total cost and savings versus always using a frontier model. Press expand for a full chat window — sidebar with conversation history, markdown replies with copy-able code, and a composer.

Privacy & data handling

Aperture is private by default:

  • Local-tier queries never leave your device.
  • API keys live in your browser and are sent only on the proxied request.
  • Secure mode enforces local-only when you need a hard guarantee.

Cloud requests you route are sent to the provider you connected, on your own account.