Edge Compute
Templates / Ollama
CUDA 12.8SSHJupyterAPIText generation

Ollama

Run quantised open models with one command. Pulls the models you choose at start-up and serves the Ollama API.

What's inside

  • ✓
    Ollama server on port 11434
  • ✓
    Models in OLLAMA_PULL are pulled at start-up (space-separated)
  • ✓
    Protected by the gateway: user edge / your app token
  • ✓
    Logs: /var/log/onstart.log

How you connect

AccessWhereAuth
SSH (root)ssh -p <port> root@clearlayer.caYour SSH key
JupyterLabhttps://r<id>-<random>.gpu.clearlayer.caToken in the link
Ollama API (port 11434)https://r<id>-<random>-app.gpu.clearlayer.ca Login edge / app token

Environment variables

VariableDefault
OLLAMA_PULLllama3.1:8b
APP_TOKENrandom per rental
HF_TOKENoptional, for gated Hugging Face models

Models from the model library set these for you.

Quick start

curl
curl -u edge:<app-token> https://r12-abcd1234-app.gpu.clearlayer.ca/api/generate \
  -d '{"model": "llama3.1:8b", "prompt": "Hello!", "stream": false}'
Python
import requests

r = requests.post("https://r12-abcd1234-app.gpu.clearlayer.ca/api/chat", auth=("edge", "<app-token>"), json={
    "model": "llama3.1:8b", "stream": False,
    "messages": [{"role": "user", "content": "Hello!"}],
})
print(r.json()["message"]["content"])