This project turns an old laptop into a fully functional AI server that can serve LLMs locally and access them globally using Cloudflare Tunnel on API . A simple Streamlit app provides a friendly frontend to interact with the model via API .
🔗 Blog post: Run a Local AI Server for Free with Ollama & Cloudflare Tunnel
- Personal chatbot
- Code generation tool
- Lightweight AI backend for your apps
- Home AI server on a budget
- A Old laptop with Linux (preferably with 4GB+ RAM)
- Python 3.9+
- Ollama
- Cloudflared
$ curl -fsSL https://ollama.com/install.sh | sh
$ ollama pull tinyllama # or any other model like deepseek-llm$ OLLAMA_HOST=0.0.0.0 ollama serve
# Or run on a custom port
$ OLLAMA_HOST=0.0.0.0 OLLAMA_PORT=11435 ollama serve$ wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -O cloudflared
$ chmod +x cloudflared
$ cloudflared --version
$ cloudflared tunnel --url http://localhost:11435This will give you a public URL like:
https://your-unique-subdomain.trycloudflare.com
Install dependencies:
pip install -r requirements.txtRun app:
streamlit run app.pyMake sure to update your
app.pywith the correct Cloudflare URL.
curl https://your-unique-subdomain.trycloudflare.com/api/generate -d '{
"model": "deepseek-llm:1.5b",
"prompt": "Write a Python function to reverse a string"
}'- Use
htoporglancesto monitor usage - Check disk with
lsblkanddf -h - Stick to lightweight models for faster inference
local-ai-server/
├── app.py # Streamlit frontend
├── requirements.txt # Python deps
├── README.md # You are here
Built with ❤️ by Raghul M
Inspired by a simple idea: "What if I could run AI server without the cloud?"



