From 74b42f3d63498b42117941f62f693ea00b891b2b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Fri, 9 Oct 2026 13:18:07 -0700 Subject: [PATCH] zeroclaw, variablize the context amount to be per-machine. --- tasks/workstation/linux/software/zeroclaw.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tasks/workstation/linux/software/zeroclaw.yml b/tasks/workstation/linux/software/zeroclaw.yml index 58cb0d1..77d7eb0 100644 --- a/tasks/workstation/linux/software/zeroclaw.yml +++ b/tasks/workstation/linux/software/zeroclaw.yml @@ -43,6 +43,8 @@ # Conversely: # - qwen3.5:4b would be 3.3GB * 1.3 = 4290, rather than 4000. llm_size_coef: 1.3 + # Take the GB of RAM and use it as the MB of context. + llm_context: "{{ ansible_memtotal_mb | int }}" - name: Workstation | Linux | Software | ZeroClaw | Facts 02 ansible.builtin.set_fact: @@ -181,7 +183,7 @@ export OLLAMA_KEEP_ALIVE=20m # default 5m export OLLAMA_MAX_LOADED_MODELS={{ llm_concurrency }} # default is 3 if using CPUs, or 3 * NumGPUs export OLLAMA_NUM_PARALLEL={{ llm_parallel }} # default is 1 and applies per-model (unconfirmed) - export OLLAMA_CONTEXT_LENGTH=32000 # default is 4096, https://docs.ollama.com/faq#how-can-i-specify-the-context-window-size + export OLLAMA_CONTEXT_LENGTH={{ llm_context }} # default is 4096, https://docs.ollama.com/faq#how-can-i-specify-the-context-window-size export OLLAMA_MAX_QUEUE=999 # default is 512 (unconfirmed) exec chpst -u {{ user }} ollama serve dest: "{{ ollama_runit_script }}" @@ -364,7 +366,7 @@ [providers.models.ollama.{{ llm.provider }}] model = "{{ llm.model }}" timeout_secs = 3600 # 1 hour, default is 120 (2 minutes), issue happens between 5 and 6 minutes though. - context_window = 999999999 + context_window = {{ llm_context }} {% endfor %} state: present create: false