Skip to main content

Ollama (Local AI) Setup

Ollama lets you run AI models entirely on your own machine — no API key, no usage costs, and complete data privacy.

Why Use Ollama?

FeatureCloud AI (OpenAI/Anthropic)Ollama (Local)
CostPay per tokenFree after setup
PrivacyData sent to providerStays on your machine
SpeedFast (cloud servers)Depends on your hardware
SetupJust an API keyRequires a Cloudflare Tunnel

What You Need

  • A computer running Windows, macOS, or Linux (not the mobile device itself)
  • At least 8 GB RAM (16 GB recommended for larger models)
  • Ollama installed on your computer
  • A Cloudflare Tunnel to expose Ollama to the internet

Step 1 — Install Ollama

Download and install Ollama from ollama.com.

Once installed, open a terminal and pull a model:

ollama pull llama3.2

Popular models to try:

ModelCommandRAM NeededNotes
Llama 3.2ollama pull llama3.24 GBFast, good general use
Mistral 7Bollama pull mistral8 GBGood reasoning
Llama 3.1 8Bollama pull llama3.18 GBExcellent for Q&A
Qwen 2.5 14Bollama pull qwen2.5:14b12 GBBest quality at home

Step 2 — Expose Ollama via Cloudflare Tunnel

YesBill's backend needs to reach your Ollama instance. Use a Cloudflare Tunnel to create a public HTTPS URL.

  1. Install Cloudflare CLI (cloudflared) from developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads
  2. Run:
    cloudflared tunnel --url http://localhost:11434
  3. Copy the generated URL — it looks like https://random-words.trycloudflare.com
tip

The free Cloudflare Tunnel URL changes each time you restart. For a permanent URL, create a named tunnel — see Cloudflare docs.

Step 3 — Configure in YesBill

Provider settings — Ollama
  1. Open Settings → AI Configuration.
  2. Select Ollama as the provider.
  3. Paste your Cloudflare Tunnel URL in the Ollama Base URL field.
  4. Tap Fetch Models — your installed models appear in the list.
  5. Select a model and tap Save.

Troubleshooting

ProblemSolution
"Fetch Models" returns nothingCheck that Ollama is running (ollama serve) and your tunnel is active
Slow responsesUse a smaller model (e.g. llama3.2 instead of qwen2.5:14b)
Tunnel URL not workingRestart cloudflared and update the URL in the app
Out of memory errorsUse a smaller model or close other applications

Security Note

Your Cloudflare Tunnel URL is essentially a public endpoint for Ollama. To keep it private:

  • Do not share the URL
  • Stop the tunnel when not using YesBill
  • Consider adding authentication to cloudflared for long-term use
API key security

Ollama requires no API key. The tunnel URL is stored securely on-device using Flutter Secure Storage.