← all posts
[ guide ]June 24, 20269 min read

What Is an LLM Gateway? (and Why Route Local + Cloud)

An LLM gateway is a single OpenAI-compatible endpoint that routes requests across model backends — your own GPUs and the cloud. Here's what a gateway (a.k.a. LLM router) actually does, and why unifying local + cloud behind one URL is the setup serious local-LLM users land on.

If you've wired more than one model into an application, you've felt the problem an LLM gateway solves. One feature wants a fast local 8B model, another needs a frontier cloud model, a third must never leave your network. Without a gateway, every one of those choices leaks into your code: different base URLs, different SDKs, different keys, different retry logic, scattered across the codebase and impossible to change without a deploy.

Watch: what an LLM gateway is, in about two minutes.

A gateway collapses all of that into one endpoint. Your app talks to a single OpenAI-compatible URL with a single key; the gateway decides — per request — which backend actually answers. That decision is the "router" half of the job, which is why you'll see the same component called an LLM router. This post is the plain-English version: what a gateway does, why "route local + cloud" is the configuration serious self-hosters converge on, and where Wide Area Intelligence fits.

What an LLM gateway actually does

Strip away the marketing and a gateway is four jobs bolted together, all in front of the models rather than inside them:

01

A single, stable endpoint

One base URL (https://wideareaai.com/api/v1) that speaks the OpenAI API. Every OpenAI SDK, LangChain, and coding agent already knows how to talk to it, so adopting a gateway is a one-line base-URL change, not a rewrite.
02

Routing across backends

On each request the gateway picks a backend by model, availability, cost, or policy — a specific GPU node, a different node serving the same model, or a cloud provider. This is the "router" that load-balances your hardware and fails over when something is down.
03

Auth, keys, and access control

Revocable wai_sk_…keys instead of an unauthenticated port. Hand a key to a teammate or a CI job, see what it's using, and revoke it without touching any node.
04

Observability

One place that sees every request: tokens, latency, which backend answered, what failed over. You can't get that when calls are sprayed directly at five different runtimes.

A runtime (llama.cpp, Ollama, vLLM) answers the question "generate tokens for this prompt." A gateway answers a different question: "which runtime should answer, can the caller use it, and what just happened?" They are different layers — and a real setup has both.

Why route local + cloud instead of choosing one

The instinct is to pick a side: go all-cloud for reliability, or all-local for cost and privacy. Both are right some of the time, which is exactly why committing to either one hurts. Their strengths and failure modes are mirror images:

Your own GPUCloud API
Cost per tokenFree (electricity)Metered, adds up fast
PrivacyData never leaves your boxSent to a third party
AvailabilityOffline when the box isAlways on
CeilingLimited by your VRAMFrontier-scale models
LatencyLAN-fast, no per-call feeNetwork + provider queue

Route local-first with cloud failover and you get the left column for the requests your hardware can handle — which, for coding agents, chat, summarization, and batch work, is most of them — and the right column only when a node is offline or a request genuinely needs a frontier model. Your application is written against one endpoint and never sees the seam. The cloud stops being your default bill and becomes your insurance policy.

This is the whole thesis behind Wide Area Intelligence: your hardware is the datacenter; the cloud is the failover. The gateway makes that split a routing rule instead of a code branch.

What the gateway adds on top of your GPU

Running a model on a GPU is the easy part — Ollama or llama.cpp does it in a command. The hard parts are everything aroundthe model, and that's precisely the layer a gateway owns:

01

Remote access without port forwarding

Each node opens an outbound Cloudflare Tunnel, so the GPU in your office is reachable from a laptop on hotel Wi-Fi with no static IP, firewall changes, or reverse proxy. The model never has to be exposed to the open internet to be usable.
02

Multi-machine load balancing

Register a gaming PC, a Mac, and a homelab box. Requests for a model spread across whichever nodes are online and serving it — no single machine is the bottleneck or the single point of failure.
03

Team auth on a unauthenticated thing

A raw llama.cpp server bound to 0.0.0.0 has no auth — anyone who can reach the port owns your GPU. The gateway puts revocable keys in front of it.
04

Cloud failover that doesn't hard-fail

When every node serving a model is offline, the request fails over to a cloud model on prepaid credits. An app built against the endpoint keeps working through a reboot instead of throwing 500s.
one endpoint, many backends
# Your app only ever knows about ONE endpoint and ONE key.
# The gateway decides what's behind it.
curl https://wideareaai.com/api/v1/chat/completions \
  -H "Authorization: Bearer wai_sk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen3-Coder-30B-A3B-Instruct",
    "messages": [{"role": "user", "content": "Refactor this function"}]
  }'

# Behind the scenes the gateway:
#   1. authenticates the wai_sk_ key
#   2. finds a node online and serving that model
#   3. routes the request to your GPU over a tunnel
#   4. fails over to a cloud model if no node can serve it
#   5. logs tokens, latency, and which backend answered

Gateway vs. runtime vs. cloud proxy

"Gateway" gets used loosely, so it's worth being precise. Three things are often lumped together:

Inference runtimeCloud-only proxyLocal + cloud gateway
ExampleOllama, llama.cpp, vLLMCloud key-router SaaSWide Area Intelligence
Generates tokens?YesNo (proxies)No (routes to runtimes)
Routes to your GPUsn/a (single host)NoYes
Cloud failoverNoYes (cloud↔cloud)Yes (local→cloud)
Remote access built inNo (DIY tunnel)n/aYes (tunnel per node)
Auth / API keysNoneYesYes (revocable wai_sk_)

Most "LLM gateway" products are the middle column — they route between cloud providers and never touch hardware you own. The thing that makes a gateway interesting for people who already bought a GPU is the right column: a router whose primary backends are your own machines, with the cloud as the safety net rather than the default.

When you need one — and when you don't

Be honest about the threshold. A gateway is moving parts — a hosted router, a tunnel, an agent per node — and if you only ever talk to a model from the same computer it runs on, that machinery buys you nothing. Stay on localhost Ollama and don't look back.

You've crossed the line the moment any of these is true: you want the GPU usable from another machine; you have more than one GPU to pool; you need a revocable API key for a teammate or a CI job; you want usage logging; or you need a request to not hard-failwhen a box reboots. That's the gateway's whole reason to exist.

Wide Area Intelligence is that gateway, aimed squarely at people who already own the hardware: a one-line installer turns any GPU machine into a node, you get an OpenAI-compatible endpoint with real keys and cloud failover, and it's free for up to two nodes. If you've outgrown localhost, the path is short — deploy a model to a node, create a key, point your tool at https://wideareaai.com/api/v1. Put your GPU on the network →

Not sure your card can serve the model you want behind the gateway? Start with what GPU do I need to run this model or, if you already have the card, can I run it? — then read the best local LLMs in 2026 to choose what to actually serve.

Frequently asked questions

What is an LLM gateway?
An LLM gateway is a service that sits in front of one or more model backends and exposes them through a single, stable API — almost always OpenAI-compatible. Your application talks to one base URL with one API key; the gateway decides which backend actually serves each request (a local GPU node, a different model, or a cloud provider). It's the request-routing, auth, and observability layer that individual inference runtimes like Ollama or llama.cpp deliberately leave out.
What's the difference between an LLM gateway and an LLM router?
They describe the same component from two angles. 'Gateway' emphasizes the single entry point — one endpoint, one key, one place to enforce auth and logging. 'Router' emphasizes the decision it makes on each call — which backend or model handles this request based on availability, cost, capability, or policy. In practice a good LLM gateway is also a router: a stable front door that load-balances and fails over behind the scenes.
Why route between local GPUs and the cloud instead of picking one?
Because they have opposite failure modes. Your own GPU is free per token and private but can be offline, busy, or too small for a given request. Cloud APIs are always-on and have frontier-scale models but bill every token and send your data off-box. Routing local-first with cloud failover gives you the cost and privacy of your own hardware for the 90% of requests it can handle, and the reliability of the cloud for the rest — without your app ever seeing a hard failure.
Does WideAreaAI run the model, or just route to it?
WideAreaAI is a gateway/router, not an inference runtime. It doesn't replace llama.cpp, Ollama, or vLLM — it routes to GPU nodes you own (each running llama.cpp under a lightweight agent) and fails over to cloud providers when needed. You bring the hardware and the models; the gateway makes them reachable from anywhere behind one OpenAI-compatible endpoint with real auth keys.
Do I need an LLM gateway if everything runs on one machine?
Probably not. If you only ever call a model from the same computer it runs on, localhost Ollama or LM Studio is simpler and a gateway buys you nothing. A gateway earns its keep the moment you need that model from another machine, across multiple GPUs, behind a revocable API key, with usage logging, or with a fallback so an app doesn't break when a box reboots.

/// get started

That GPU is already paid for.
Put it on the network.

Create your gateway — free →