zeroclaw, variablize the context amount to be per-machine.

This commit is contained in:
me
2026-10-09 13:18:07 -07:00
parent 0c86a76968
commit 74b42f3d63
@@ -43,6 +43,8 @@
# Conversely: # Conversely:
# - qwen3.5:4b would be 3.3GB * 1.3 = 4290, rather than 4000. # - qwen3.5:4b would be 3.3GB * 1.3 = 4290, rather than 4000.
llm_size_coef: 1.3 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 - name: Workstation | Linux | Software | ZeroClaw | Facts 02
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -181,7 +183,7 @@
export OLLAMA_KEEP_ALIVE=20m # default 5m 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_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_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) export OLLAMA_MAX_QUEUE=999 # default is 512 (unconfirmed)
exec chpst -u {{ user }} ollama serve exec chpst -u {{ user }} ollama serve
dest: "{{ ollama_runit_script }}" dest: "{{ ollama_runit_script }}"
@@ -364,7 +366,7 @@
[providers.models.ollama.{{ llm.provider }}] [providers.models.ollama.{{ llm.provider }}]
model = "{{ llm.model }}" model = "{{ llm.model }}"
timeout_secs = 3600 # 1 hour, default is 120 (2 minutes), issue happens between 5 and 6 minutes though. 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 %} {% endfor %}
state: present state: present
create: false create: false