A lightweight Colab-based wrapper for Ollama using cloudflared tunnels, allowing free users to create temporary public links.
-
Click the "Open in Colab" badge below to open the notebook.
-
Change the runtime to T4 GPU. (
β οΈ Warning: Google Colab provides T4 GPU access for up to 12 hours a day). -
Run the notebook cells to install dependencies and launch the tunnel.
-
A temporary public URL will be generated via
cloudflared. This link will remain active as long as the Colab notebook is running and a new URL will be generated each time you restart the notebook.
Example: Cloudflare Tunnel successfully created
- You can use this public link with any application that integrates with Ollama, such as Open Web-UI or your terminal, as a replacement for the default local server address (
http://127.0.0.1:11434). - To use the public link in your terminal for the current session, follow these steps (Note: You must have Ollama installed on your local machine: https://ollama.com/download):
-
Windows:
- PowerShell:
$env:OLLAMA_HOST="<you_provided_cloudflared_public>"
- CMD:
set OLLAMA_HOST=<you_provided_cloudflared_public>
- PowerShell:
-
Linux/MacOS (Bash/Zsh):
export OLLAMA_HOST="<you_provided_cloudflared_public>"
-
Example - Windows(Powershell)π
Ollama-Goole-Colab.mp4
This project uses a Google Colab notebook to:
- Install Ollama: The notebook first installs Ollama on the Colab instance.
- Run the Ollama Server: It then starts the Ollama server.
- Create a Public Tunnel: It uses
cloudflaredto create a public URL that tunnels to the Ollama server running on the Colab instance.
This allows you to access the Ollama API from your local machine without needing to install the models locally.
- Free to Use: Access Google Colab's T4 GPUs for free, subject to usage limits, or use CPU resources without time restrictions (though with slower performance).
- No Local Storage Needed: Run large language models without using storage on your local machine.
- Publicly Accessible: Get a temporary public URL to share or use in your applications.
- Easy to Use: Just open the notebook and run the cells.
Enjoy using Ollama on Colab! If you have any questions or feedback, please open an issue.