Skip to main content
By default, Ollama listens on 127.0.0.1:11434 — only your own machine can reach it. Setting OLLAMA_HOST=0.0.0.0 makes it listen on every network interface, but Ollama has no built-in authentication: anything that can reach port 11434 can call the API with no credential. Keep Ollama on localhost and run the Tokios connector next to it instead: the connector dials out to https://api.tokios.com, and your tools, teammates, or agents call 1 authenticated endpoint from anywhere.
Beginner-friendly. Ollama is the quickest way to run a local model — ollama run <model> and you’re serving. It’s a great first backend for Tokios.

What people try first — and the catch

Each of these is a reasonable general-purpose tool. None were built for “expose a local inference API to the internet,” so each has a documented limit that shows up specifically in that workload.
This makes Ollama listen on every network interface, not just loopback. Ollama does not ship built-in authentication, so anything that can reach the port can call the API — list models, run inference, pull models — with no credential. Security researchers (SentinelLABS/Censys, 2026) reported roughly 175,000 Ollama hosts exposed this way and reachable from the open internet.
Forwarding 11434 to your machine has two separate problems. If your ISP uses CGNAT, you don’t have a stable public IP to forward to in the first place. If you do get a port open, internet-wide scanners like Shodan and Censys index exposed services within hours to days — and, same as above, there’s no authentication behind the port unless you build it yourself.
Tailscale solves personal access well — your own devices join a private mesh network (a “tailnet”) and can reach each other securely. The catch is for anything beyond personal use: teammates or SaaS clients that need to call your model have to join your tailnet first, which doesn’t fit a public API key model. Tailscale Funnel can publish a service publicly, but it’s restricted to a fixed set of ports and its bandwidth is not configurable.
Cloudflare Tunnel routes traffic through Cloudflare’s edge with no inbound port required, which is the right shape. But by default Cloudflare buffers responses rather than streaming them unless the response carries a text/event-stream content-type header, and proxied requests are subject to Cloudflare’s proxy timeouts (around 100 seconds on the free tier, shorter on some plans) — long generations can get cut off mid-stream.
ngrok is quick to set up and works well for demos. The free tier caps usage at 1 GB of data and 20,000 requests per month, and free tunnels show an interstitial warning page to visitors before they reach your service — both are fine for a demo link, less fine for a teammate or agent calling the API programmatically all day.
None of this is a knock on these tools — they’re solving a different problem (device mesh networking, edge proxying, quick demo links). Tokios is purpose-built for one thing: turning a local model endpoint into an authenticated API you can call from anywhere.

The outbound-only way

1

Run Ollama locally, as usual

Keep Ollama on 127.0.0.1 — don’t set OLLAMA_HOST. Pull and run your model:
Leave it listening on the default http://127.0.0.1:11434.
2

Pair the Tokios connector

Sign in at tokios.com/console, open the Setup tab, and click Start pairing. Tokios shows a one-time claim code like TKS-XXXX-XXXX, valid for about 15 minutes.On the machine running Ollama, run the install one-liner for your OS:
Windows
macOS
Linux
Already have tokios-connector installed? Pass the code directly instead:
Back in the console, approve the device on the Setup or Connectors tab. The connector’s token is delivered over the tunnel once approved — you never see it on screen or paste it into a file.
3

Point the connector at Ollama's /v1 API

Ollama exposes an OpenAI-compatible surface at /v1, and that’s what Tokios talks to — not Ollama’s native /api endpoints. For the basic single-model path, the console’s Setup wizard uses http://127.0.0.1:11434/v1 as the upstream automatically. If you’re serving multiple models through a tokios-connector.json config, set the upstream BaseUrl explicitly:
See Connector config for the full multi-model file format.
4

Register a deployment

In the Models tab, register the Ollama model and choose a public name — for example, llama3-tunnel. That public name, not Ollama’s local model id, is what clients send in the model field.
5

Create an API key

In the Keys tab, click Create key. Optionally scope it to specific deployments with model-name patterns (comma-separated globs, * for all). Copy the sk-tok-… key now — it’s shown only once.

Use it from anywhere

Once you have a deployment name and an API key, any OpenAI- or Anthropic-compatible client can reach your Ollama model — from another machine, a teammate’s laptop, or a hosted agent.
The model field is always your registered deployment name (llama3-tunnel above), never Ollama’s local model id. See Use Claude Code for persisting the environment variables across sessions.

Tokios vs Ollama Cloud

Ollama also offers Ollama Cloud — hosted models you reach with ollama run <model>:cloud or an Ollama API key, where the weights run on Ollama’s infrastructure and are proxied through your local ollama daemon while you’re signed in. It’s a fine managed option, but it’s the opposite of self-hosting: your prompts leave for Ollama’s servers, and a :cloud tag has no local weights for you to control. (Some frontier models — Kimi, MiniMax, the largest Nemotron tier — are :cloud-only on Ollama for exactly this reason.) Tokios is for the other case: the model runs on your hardware, and Tokios only puts an authenticated endpoint in front of it. You keep the weights, the data path, and the keys. Both can coexist: run small models locally behind Tokios and reach a :cloud model when you need one — but only the local path keeps your data on hardware you own.

FAQ

Ollama listens on port 11434 by default, bound to 127.0.0.1 (localhost only). You can change the port and bind address with the OLLAMA_HOST environment variable — for example OLLAMA_HOST=0.0.0.0:11435 listens on all interfaces at port 11435. You can verify Ollama is running with curl http://localhost:11434.
Set the environment variable OLLAMA_HOST=0.0.0.0 (or OLLAMA_HOST=0.0.0.0:11434) and restart Ollama. On Linux with systemd, add Environment="OLLAMA_HOST=0.0.0.0:11434" under [Service] in ollama.service and run systemctl daemon-reload && systemctl restart ollama. On macOS, use launchctl setenv OLLAMA_HOST "0.0.0.0:11434". On Windows, set OLLAMA_HOST in your user environment variables and restart Ollama.
No. Ollama itself has no built-in authentication — it was built for local serving, not multi-tenant access control. The Ollama maintainers recommend putting a reverse proxy (nginx, Caddy) in front of it if you need auth. Tokios adds scoped sk-tok-… API keys without a reverse proxy: you pair a connector, register a deployment, and create a key — then callers authenticate against https://api.tokios.com instead of your raw Ollama port.
Ollama exposes both native and OpenAI-compatible endpoints. For the native API: curl http://localhost:11434/api/generate -d '{"model": "llama3", "prompt": "Hello"}'. For the OpenAI-compatible surface: curl http://localhost:11434/v1/chat/completions -d '{"model": "llama3", "messages": [{"role": "user", "content": "Hello"}]}'. From a remote machine, replace localhost with the server’s IP (requires OLLAMA_HOST=0.0.0.0).
Yes. Ollama allows cross-origin requests from 127.0.0.1 and 0.0.0.0 by default. Set OLLAMA_ORIGINS to add more origins — for browser extensions, use OLLAMA_ORIGINS=chrome-extension://*,moz-extension://*. This only affects browser-based clients; API clients using curl or SDKs are not subject to CORS.
Yes. Set "stream": true and Tokios returns standard server-sent events (SSE) in OpenAI or Anthropic format, depending on which API surface you called.
Yes. Create a separate sk-tok-… key per teammate in the Keys tab, and scope each key to only the deployments they need. Revoking a key stops it from authenticating immediately, so you can cut off access without touching Ollama or the connector.
Yes. Register additional deployments in the Models tab, or use a tokios-connector.json config file to define multiple upstreams and routes for a single connector. See Connector config.
No. Tokios speaks the OpenAI Chat Completions surface, so it talks to Ollama’s /v1 OpenAI-compatible API, not the native /api/generate or /api/chat endpoints.

Your model never leaves your machine — your endpoint works everywhere

Ollama keeps doing exactly what it does today, on localhost, with no inbound ports and no exposed API. The connector only dials out. Everything past that — auth, routing, streaming — is one endpoint you can call from any machine, teammate, or agent you choose to give a key to.

Quickstart

Pair a connector and register your first model end to end.

API keys

Create, scope, and rotate sk-tok-… keys for teammates and agents.

Drive it with a coding agent

Point Claude Code, Codex, Cline, or Cursor at your Ollama model through Tokios.