Run templates on Ollama

Ollama runs a model on your own computer. Point AgentRun at it and you pay nothing for the model, and nothing you send leaves your machine for a model provider. Paid tools a template calls still cost what they cost.

  1. Install Ollama. On macOS or Windows, download it from ollama.com/download. On Linux:
    curl -fsSL https://ollama.com/install.sh | sh
  2. Pull a model that can call tools. Templates search, fetch pages and write files, so the model has to call tools. qwen3:8b can. Check any other model with ollama show <tag>: tools must be listed under Capabilities.
    ollama pull qwen3:8b
    ollama show qwen3:8b
  3. Give it room for a template's prompt. Ollama loads a model with 4,096 tokens of context. A template's first request is about 12,000, and Ollama drops the start, the question included, so the agent answers that it was never asked anything. Make a copy of the model with 32,768 tokens. It needs about 10 GB of memory. On Windows, put the two lines of the Modelfile in a file with any editor, then run ollama create.
    printf 'FROM qwen3:8b\nPARAMETER num_ctx 32768\n' > Modelfile
    ollama create qwen3-8b-32k -f Modelfile
  4. Point AgentRun at it. If AgentRun runs as a service, install the service again with the model. It restarts and keeps the setting:
    ~/.agentrun/bin/agentrun service install --env AGENT_MODEL_BASE_URL=http://localhost:11434/v1 --env AGENT_MODEL_GATEWAY_IDS=bare --env AGENT_MODEL=qwen3-8b-32k --env AGENT_MODEL_PRICE=0,0,0 --env AGENT_MODEL_API_KEY=none
  5. Or, if AgentRun runs in the background, stop it and start it with the same five settings. A background start keeps only what that line sets.
    ~/.agentrun/bin/agentrun stop
    curl -fsSL https://agentrun.ai/install | AGENT_MODEL_BASE_URL=http://localhost:11434/v1 AGENT_MODEL_GATEWAY_IDS=bare AGENT_MODEL=qwen3-8b-32k AGENT_MODEL_PRICE=0,0,0 AGENT_MODEL_API_KEY=none sh
  6. Install a template. Pick one on this site and press Install. Every run then goes to your model, whatever model the template names, and the model costs nothing. A template that calls a paid service (monid, Parallel) still pays that service, as its page says.

Templates that already prefer a free hosted model are on the Free tab.

AGENT.RUN() / GET STARTED

Set up AgentRun
with your agent.

Follow the AgentRun quickstart with your coding agent. Open the prompt in an app, or copy it into your terminal agent.

Download Markdown