Tutorial · Updated June 2026

How to use your local AI on iPhone (OpenCat + Cloudflare Tunnel)

Run an LLM at home for privacy, then chat with it from your iPhone anywhere — without port forwarding and without exposing your home IP. The trick is a secure Cloudflare Tunnel plus the OpenCat iOS app.

What you'll need

Step 1 — Run a local model

Install Ollama and start a model. Ollama serves a local OpenAI-compatible API on port 11434:

ollama run qwen2.5
# API now live at http://localhost:11434/v1

New to local models? See our best local AI models to download.

Step 2 — Expose it securely with Cloudflare Tunnel

Cloudflare Tunnel (the cloudflared daemon) gives your local service a public HTTPS URL while keeping it behind Cloudflare — no open ports, no router config, and your home IP is never exposed.

# install cloudflared (macOS example)
brew install cloudflared

# publish your local Ollama endpoint
cloudflared tunnel --url http://localhost:11434

It prints a URL like https://random-words.trycloudflare.com. That's your private gateway to the model.

Lock it down: for a permanent setup, create a named tunnel on your own domain and put Cloudflare Access in front of it so only you can reach it. Quick tunnels are fine for testing.

Step 3 — Connect OpenCat on your iPhone

  1. Open OpenCat → Settings → API / Custom Model.
  2. Set the API Host to your tunnel URL (e.g. https://random-words.trycloudflare.com/v1).
  3. Add any API key value (Ollama ignores it) and set the model name to the one you pulled, e.g. qwen2.5.
  4. Start chatting — you're now talking to your home machine, privately, from anywhere.

Don't want to self-host? Skip the tunnel.

OpenCat works with any OpenAI-compatible API — so the exact same Step 3 connects it to CodeBurst's free hosted endpoint instead (https://codeburst.ai/v1), no computer-at-home or tunnel required. Many people do both: CodeBurst on the go, local AI for sensitive work. How the free hosted router works →

Get a free API key Best local models →

FAQ

Is this secure?
Yes — Cloudflare Tunnel never exposes your IP or opens a port. Add Cloudflare Access for login-only access.

Does OpenCat support local models?
Yes, via any OpenAI-compatible host — which is exactly what Ollama (through the tunnel) and CodeBurst both provide.