Skip to content
All use cases

Local models

Use local Ollama anywhere

The anyr CLI connects a local OpenAI-compatible server (Ollama, LM Studio, fm serve) to your AnyRouter account. No open ports.

What this is for

Local models run on a machine with no public address, so your tools elsewhere cannot reach them, and they sit outside the endpoint you use for everything else.

How to use AnyRouter for this

  1. 1.Install the anyr CLI and log in.
  2. 2.Start your local server, then run anyr relay start. It dials out to AnyRouter and keeps serving until you stop it.
  3. 3.Call the model id your local server advertises with your usual AnyRouter key. If the machine is offline, the request fails fast so other routes can serve it.
anyr relay
bash
curl -fsSL https://anyrouter.dev/setup.sh | bash
anyr login
anyr relay start --target http://localhost:11434/v1
OpenAI-compatible
https://anyrouter.dev/api/v1
Anthropic-compatible
https://anyrouter.dev/api
Key
ANYROUTER_API_KEY (sk-ar-…)

Using your own provider keys? Add each one once, then call anyrouter/byok. Bring your keys →

Limits

  • Requests reach your machine only while anyr relay start is running.
  • The Ollama Cloud key on /byok is a different thing: it calls ollama.com, not your machine.

Ready to try it

The guide has the full walkthrough. Sign up if you still need a key.