Provider setup: Ollama / qwen2.5:3b (Netlogo Llm)

**Note** from Bead: Netlogo Llm · [canonical source](https://redfish.acequia.io/guerin/.agents/18c5d049-c4a9-488b-9db0-824cc6e73089/2026-06-29/notes/01-ollama-setup.md) · session 2026-06-29 · discussion: Talk: Netlogo Llm

Date: 2026-06-29. Animator: Claude (CV). Decision: use the **Ollama** provider (local, free, no key) instead of Claude. Stephen had Claude provider considered first, then switched ("let's go with ollama instead").

## Environment verified - **Ollama server:** running. `GET http://localhost:11434` → `Ollama is running`. (The `ollama` CLI is not on PATH; the HTTP API on :11434 is what we use/test.) - **Model installed:** `qwen2.5:3b` (1.8 GB) — confirmed via `GET http://localhost:11434/api/tags`. - **Smoke test:** `POST /api/chat` with `qwen2.5:3b` → returned `2+2=4`. Working. - **NetLogo:** `7.0.4` now installed (alongside `7.0.0-beta2` and `6.4.0`). Use **7.0.4** — the workshop requires 7.0.4+.

## config.txt written (3 copies, per README) Same block in each model folder: ``` provider=ollama ollama_base_url=http://localhost:11434 model=qwen2.5:3b temperature=0.7 max_tokens=200 timeout_seconds=60 ``` Locations: - `models/1_rumor_diffusion/config.txt` (models 1 & 2) - `models/1_rumor_diffusion/3_advanced_rumor_model/config.txt` - `models/2_rule_evolution/config.txt`

## Hygiene - A `.gitignore` (`config.txt`, `**/config.txt`) was added to the clone so these stay out of git. Ollama config carries no secret, but config.txt is machine-local and the Claude/Gemini variants WOULD carry a key — so the rule holds generally. - `webdav-sync` only auto-excludes `.git/` and `node_modules/`, so a blind `/bead-sync` would still push `config.txt`. Keep config.txt out of sync.

## LLM extension — installed AND end-to-end verified (headless) The official **LLM** extension by NetLogo/CCL is **not** in the locally-cached extension list, but it **is** in the live registry (`NetLogo/NetLogo-Libraries`, branch `7.0`: `name: "LLM"`, `codeName: "llm"`). The repo [`NetLogo/Netlogo-LLM-Extension`](https://github.com/NetLogo/Netlogo-LLM-Extension) has no GitHub releases and builds via sbt/Scala-3.7 (no toolchain here), but the registry ships a **prebuilt** `llm-1.0.0.zip` — `https://raw.githubusercontent.com/NetLogo/NetLogo-Libraries/7.0/extensions/llm-1.0.0.zip` (10 MB: `llm.jar` + dependency jars + demos/docs). Both repos are cloned into the bead's `artifacts/`. **Install path discovery:** NetLogo 7.0.4's launchers (`netlogo-gui.bat`, `NetLogo.cfg`, `netlogo-headless.bat`) all set `-Dnetlogo.extensions.dir=<install>\extensions` (Program Files, **not** writable without admin). NetLogo also **always searches the running model's own directory** for an `<extname>/` folder — that path is the bulletproof one. So the prebuilt `llm/` was placed: - `…\AppData\Roaming\NetLogo\7.0\extensions\llm\` (user dir; for the GUI), and - next to the models: `models/1_rumor_diffusion/llm/`, `…/2_rule_evolution/llm/`, `…/3_advanced_rumor_model/llm/` (git-ignored, ~10 MB each, machine-local). **End-to-end test (headless, no GUI):** injected a 1-run BehaviorSpace experiment into a copy of the intro model and ran it through the bundled JDK (`runtime\bin\java.exe`, since system Java is 8 — too old): ``` metric: llm:chat "What is 2+2? Reply with only the number, nothing else." result: run 1, step 1 -> 4 ``` So the whole chain works: **NetLogo 7.0.4 → llm extension → llm:load-config (config.txt, provider=ollama) → llm:chat → Ollama qwen2.5:3b → "4"**. (Notes: the `.bat` launchers mishandle the space in "Program Files" — invoke `runtime\bin\java.exe` directly with an arg array; and `.nlogox` must be saved **without a UTF-8 BOM** or NetLogo throws "Content is not allowed in prolog".)

## For the user in the NetLogo 7.0.4 GUI Opening any workshop model should now Just Work (extension is next to each model): 1. Open e.g. `models/1_rumor_diffusion/1_rumor-diffusion-llm-intro.nlogox`. 2. Command Center: `llm:load-config "config.txt"` then `show llm:provider-status` → expect `reachable: true`; then `show llm:chat "Hello! What is 2 + 2?"`. 3. If it ever reports "Extension llm not found", Tools → Extensions… → search **LLM** (NetLogo/CCL, *not* "LLM-Chat") → Install.