Free Guide

Ollama on Kaggle, reachable through a Cloudflare tunnel.

Five notebook cells, in the order they have to run. They start an Ollama model inside a Kaggle notebook, expose its API through a temporary Cloudflare Quick Tunnel, and connect a client such as Hermes to it.

6 steps5 copy-paste cells4-page PDF

What’s Inside

  1. Install

    Install the required software

    Installs Ollama and the Cloudflare Tunnel client in a fresh Kaggle runtime, then checks both versions.

  2. Serve

    Start the Ollama API server

    Runs Ollama in the background and writes its logs to a file, so a failure is readable instead of silent.

  3. Pull

    Download the model

    Pulls the 27B GGUF model non-interactively, so the notebook can keep running the cells after it.

  4. Tunnel

    Start a fresh Cloudflare Quick Tunnel

    Opens a temporary public HTTPS URL to the local API and extracts it from the tunnel log automatically.

  5. Test

    Test both API endpoints

    Checks the local API and the public tunnel, and tells you which model ID to use in your client.

  6. Connect

    Connect Hermes or another client

    The exact base URL, model and API-key settings, plus a short troubleshooting checklist.

The code unlocks with your email All five cells, plus the PDF to keep.
Good to know before you start. The tunnel URL is temporary and changes every restart. A 27B model is large and can exceed what a Kaggle runtime can hold. And a Quick Tunnel exposes the API publicly while it runs. This is a setup for testing, not a production endpoint.