Lattice

An LLM gateway

One endpoint.Every model.

Lattice carries each request from your app to the model that should answer it — routing, falling back, caching and metering on the way — behind one OpenAI-compatible URL.

Five SDKs.Four rate limits.One storm at 3 a.m.

Every provider fails in its own weather. Without a gateway, your app finds out the way your users do: a spinner that never stops.

Undelivered — 03:02

  • provider A429 rate limit exceeded
  • provider B529 overloaded
  • provider C503 quota exhausted
  • your appretry(retry(retry(…)))

Automatic fallback

Close a door.The wind finds another.

Take a provider down (keys 1–4)

delivered to openai · +0 ms · 0 lost requests

Most days, nothing goes wrong.
You just don't see the weather we flew through.

Every delivery,written down.

Each request becomes a line: which model answered, by which route, in how many milliseconds, for how much. Demo data.

1204331 requests delivered today

timerequestmodelroutemsusd

How it works

Your app keeps its client.
Everything else is configuration.

Routing

Send each request to the model that should answer it — by priority, cost, latency, or a header your app sets. Change the rule without shipping your app.

# lattice.yaml
routes:
  - match: { header: x-tier, equals: free }
    models: [mistral-small, llama-3.1-8b]
  - match: { default: true }
    models: [gpt-4o, claude-sonnet, gemini-pro]
    strategy: lowest-latency

Fallbacks

On a 429, a 5xx or a timeout, the same request moves to the next model in the route — streamed responses included. Your app sees one answer.

fallback:
  on: [429, 500, 502, 503, 529, timeout]
  timeout_ms: 8000
  max_hops: 2

Cache

Exact and semantic caching at the gateway. Repeated prompts come back in single-digit milliseconds and cost nothing. Off by default for anything with a user id.

Keys & budgets

Virtual keys per team, service or customer, each with a monthly budget and a tokens-per-minute ceiling. Provider keys never leave the gateway.

Traces

Every request is a trace — route, hops, tokens, time to first token, cost — exported over OpenTelemetry.

Where it runs

Hosted in three regions, or one container in your own cloud. Same config either way.

Pricing

Free to 1M requests a month. Then $0.40 per million delivered.

Tokens
Billed by your providers, on your keys. Lattice never marks them up.
Self-hosted
Free under the source-available licence. Support contracts on request.
Limits
No seat fees, no per-model fees, no minimum.

Change one line.

Keep your SDK. Point it at Lattice.

- client = OpenAI(base_url="https://api.openai.com/v1")
+ client = OpenAI(base_url="https://gw.lattice.dev/v1")

$ python app.py
200 OK  req_7f3a91  gpt-4o  381 ms  $0.0021

Delivered