139_ollama_command - amresh087/Question GitHub Wiki

  1. This step converts Colab from a normal notebook to Linux terminal mode, where you can run system-level commands.

!pip install colab-xterm %load_ext colabxterm %xterm

  1. Here we install basic tools that help with background processes and file handling.

apt install screen

apt install zstd

To open a second terminal - Screen

To redirect to the main terminal - Ctrl + A + D. MAc ---> Ctrl+A

  1. In this step, you install Ollama and start its server to run the AI ​​models.

curl -fsSL https://ollama.com/install.sh | sh

ollama serve

  1. Here, you download the model, run it directly, and interact with it.

ollama pull qwen3.5:9b

ollama run qwen3.5:9b --verbose

open tunnel

wget https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 chmod +x cloudflared-linux-amd64 mv cloudflared-linux-amd64 /usr/local/bin/cloudflared

cloudflared --version

cloudflared tunnel --url http://localhost:11434

nohup bash -c 'OLLAMA_HOST=0.0.0.0:11434 ollama serve' > ollama.log 2>&1 &

pkill ollama