Compare commits

..
2 Commits
@@ -23,10 +23,10 @@
# - https://docs.ollama.com # - https://docs.ollama.com
# Currently only testing this on Arch based distros (pacman). # Currently only testing this on Arch based distros (pacman).
- name: Workstation | Linux | Software | ZeroClaw - name: Workstation | Linux | Software | LLMs
block: block:
- name: Workstation | Linux | Software | ZeroClaw | Facts 01 - name: Workstation | Linux | Software | LLMs | Facts 01
ansible.builtin.set_fact: ansible.builtin.set_fact:
ollama: ollama ollama: ollama
zeroclaw: zeroclaw zeroclaw: zeroclaw
@@ -43,15 +43,17 @@
# 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 | LLMs | Facts 02
ansible.builtin.set_fact: ansible.builtin.set_fact:
ollama_runit_dir: "{{ runit_script_dir }}/{{ ollama }}" ollama_runit_dir: "{{ runit_script_dir }}/{{ ollama }}"
ollama_runit_log_dest: "{{ global_log }}/{{ ollama }}" ollama_runit_log_dest: "{{ global_log }}/{{ ollama }}"
zeroclaw_runit_dir: "{{ runit_script_dir }}/{{ zeroclaw }}" zeroclaw_runit_dir: "{{ runit_script_dir }}/{{ zeroclaw }}"
zeroclaw_runit_log_dest: "{{ global_log }}/{{ zeroclaw }}" zeroclaw_runit_log_dest: "{{ global_log }}/{{ zeroclaw }}"
- name: Workstation | Linux | Software | ZeroClaw | Facts 03 - name: Workstation | Linux | Software | LLMs | Facts 03
ansible.builtin.set_fact: ansible.builtin.set_fact:
ollama_runit_script: "{{ ollama_runit_dir }}/{{ runit_service_script }}" ollama_runit_script: "{{ ollama_runit_dir }}/{{ runit_service_script }}"
ollama_runit_log_dir: "{{ ollama_runit_dir }}/{{ runit_log_dir }}" ollama_runit_log_dir: "{{ ollama_runit_dir }}/{{ runit_log_dir }}"
@@ -60,12 +62,12 @@
zeroclaw_runit_log_dir: "{{ zeroclaw_runit_dir }}/{{ runit_log_dir }}" zeroclaw_runit_log_dir: "{{ zeroclaw_runit_dir }}/{{ runit_log_dir }}"
zeroclaw_runit_log_config: "{{ zeroclaw_runit_log_dest }}/{{ global_log_config }}" zeroclaw_runit_log_config: "{{ zeroclaw_runit_log_dest }}/{{ global_log_config }}"
- name: Workstation | Linux | Software | ZeroClaw | Facts 04 - name: Workstation | Linux | Software | LLMs | Facts 04
ansible.builtin.set_fact: ansible.builtin.set_fact:
ollama_runit_log_script: "{{ ollama_runit_log_dir }}/{{ runit_log_script }}" ollama_runit_log_script: "{{ ollama_runit_log_dir }}/{{ runit_log_script }}"
zeroclaw_runit_log_script: "{{ zeroclaw_runit_log_dir }}/{{ runit_log_script }}" zeroclaw_runit_log_script: "{{ zeroclaw_runit_log_dir }}/{{ runit_log_script }}"
- name: Workstation | Linux | Software | ZeroClaw | Facts | LLMs - name: Workstation | Linux | Software | LLMs | Facts | LLMs
ansible.builtin.set_fact: ansible.builtin.set_fact:
llm_installs: [] llm_installs: []
llm_removals: llm_removals:
@@ -116,14 +118,14 @@
#- deepseek-r1:1.5b #- deepseek-r1:1.5b
#- deepseek-r1:7b #- deepseek-r1:7b
- name: Workstation | Linux | Software | ZeroClaw | Facts | Choices | Sort - name: Workstation | Linux | Software | LLMs | Facts | Choices | Sort
ansible.builtin.set_fact: ansible.builtin.set_fact:
llm_installs: >- llm_installs: >-
{{ llm_choices | selectattr('size_mb', 'le', ansible_memtotal_mb) | list }} {{ llm_choices | selectattr('size_mb', 'le', ansible_memtotal_mb) | list }}
llm_removals: >- llm_removals: >-
{{ llm_choices | selectattr('size_mb', 'gt', ansible_memtotal_mb) | list }} {{ llm_choices | selectattr('size_mb', 'gt', ansible_memtotal_mb) | list }}
- name: Workstation | Linux | Software | ZeroClaw | Facts | Merge | Print - name: Workstation | Linux | Software | LLMs | Facts | Merge | Print
ansible.builtin.debug: ansible.builtin.debug:
var: "{{ item }}" var: "{{ item }}"
loop: loop:
@@ -134,7 +136,7 @@
- llm_installs - llm_installs
- llm_removals - llm_removals
- name: Workstation | Linux | Software | ZeroClaw | Install - name: Workstation | Linux | Software | LLMs | Install
ansible.builtin.package: ansible.builtin.package:
name: name:
- "{{ zeroclaw }}" - "{{ zeroclaw }}"
@@ -143,31 +145,31 @@
- "{{ qwen_code }}" - "{{ qwen_code }}"
state: present state: present
- name: Workstation | Linux | Software | ZeroClaw | runit - name: Workstation | Linux | Software | LLMs | runit
block: block:
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Run - name: Workstation | Linux | Software | LLMs | runit | ollama | Dir | Run
ansible.builtin.file: ansible.builtin.file:
name: "{{ ollama_runit_dir }}" name: "{{ ollama_runit_dir }}"
state: directory state: directory
owner: root owner: root
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Log Run - name: Workstation | Linux | Software | LLMs | runit | ollama | Dir | Log Run
ansible.builtin.file: ansible.builtin.file:
name: "{{ ollama_runit_log_dir }}" name: "{{ ollama_runit_log_dir }}"
state: directory state: directory
owner: root owner: root
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Dir | Log Config - name: Workstation | Linux | Software | LLMs | runit | ollama | Dir | Log Config
ansible.builtin.file: ansible.builtin.file:
name: "{{ ollama_runit_log_dest }}" name: "{{ ollama_runit_log_dest }}"
state: directory state: directory
owner: "{{ user }}" owner: "{{ user }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Run - name: Workstation | Linux | Software | LLMs | runit | ollama | Script | Run
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
#!/bin/sh -e #!/bin/sh -e
@@ -181,13 +183,13 @@
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 }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Log - name: Workstation | Linux | Software | LLMs | runit | ollama | Script | Log
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
#!/bin/sh -e #!/bin/sh -e
@@ -195,7 +197,7 @@
dest: "{{ ollama_runit_log_script }}" dest: "{{ ollama_runit_log_script }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | ollama | Script | Log Config - name: Workstation | Linux | Software | LLMs | runit | ollama | Script | Log Config
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
s10000000 # rotate at 10 MB s10000000 # rotate at 10 MB
@@ -204,28 +206,28 @@
owner: "{{ user }}" owner: "{{ user }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Run - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Dir | Run
ansible.builtin.file: ansible.builtin.file:
name: "{{ zeroclaw_runit_dir }}" name: "{{ zeroclaw_runit_dir }}"
state: directory state: directory
owner: root owner: root
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Log - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Dir | Log
ansible.builtin.file: ansible.builtin.file:
name: "{{ zeroclaw_runit_log_dir }}" name: "{{ zeroclaw_runit_log_dir }}"
state: directory state: directory
owner: root owner: root
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Dir | Log Config - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Dir | Log Config
ansible.builtin.file: ansible.builtin.file:
name: "{{ zeroclaw_runit_log_dest }}" name: "{{ zeroclaw_runit_log_dest }}"
state: directory state: directory
owner: "{{ user }}" owner: "{{ user }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | File - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Script | File
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
#!/bin/sh -e #!/bin/sh -e
@@ -237,7 +239,7 @@
dest: "{{ zeroclaw_runit_script }}" dest: "{{ zeroclaw_runit_script }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | Log - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Script | Log
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
#!/bin/sh -e #!/bin/sh -e
@@ -245,7 +247,7 @@
dest: "{{ zeroclaw_runit_log_script }}" dest: "{{ zeroclaw_runit_log_script }}"
mode: "0755" mode: "0755"
- name: Workstation | Linux | Software | ZeroClaw | runit | zeroclaw | Script | Log Config - name: Workstation | Linux | Software | LLMs | runit | zeroclaw | Script | Log Config
ansible.builtin.copy: ansible.builtin.copy:
content: | content: |
s1000000 # rotate at 1 MB s1000000 # rotate at 1 MB
@@ -255,7 +257,7 @@
when: ansible_service_mgr == "runit" when: ansible_service_mgr == "runit"
- name: Workstation | Linux | Software | ZeroClaw | Enable - name: Workstation | Linux | Software | LLMs | Enable
ansible.builtin.service: ansible.builtin.service:
name: "{{ item }}" name: "{{ item }}"
state: started state: started
@@ -264,7 +266,7 @@
- "{{ ollama }}" - "{{ ollama }}"
- "{{ zeroclaw }}" - "{{ zeroclaw }}"
- name: Workstation | Linux | Software | ZeroClaw | Verify - name: Workstation | Linux | Software | LLMs | Verify
ansible.builtin.uri: ansible.builtin.uri:
url: "{{ item }}" url: "{{ item }}"
status_code: 200 status_code: 200
@@ -277,7 +279,7 @@
- http://127.0.0.1:11434/ - http://127.0.0.1:11434/
- http://127.0.0.1:42617/health - http://127.0.0.1:42617/health
#- name: Workstation | Linux | Software | ZeroClaw | Config | zeroclaw | Root #- name: Workstation | Linux | Software | LLMs | Config | zeroclaw | Root
# ansible.builtin.blockinfile: # ansible.builtin.blockinfile:
# path: "{{ user_user.home }}/.zeroclaw/config.toml" # path: "{{ user_user.home }}/.zeroclaw/config.toml"
# marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Defaults" # marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Defaults"
@@ -290,7 +292,7 @@
# create: false # create: false
# backup: true # backup: true
#- name: Workstation | Linux | Software | ZeroClaw | Config | zeroclaw | Channels | header #- name: Workstation | Linux | Software | LLMs | Config | zeroclaw | Channels | header
# ansible.builtin.lineinfile: # ansible.builtin.lineinfile:
# path: "{{ user_user.home }}/.zeroclaw/config.toml" # path: "{{ user_user.home }}/.zeroclaw/config.toml"
# insertbefore: '(?m)^[channels]' # insertbefore: '(?m)^[channels]'
@@ -300,7 +302,7 @@
# create: false # create: false
# backup: true # backup: true
#- name: Workstation | Linux | Software | ZeroClaw | Config | zeroclaw | Channels #- name: Workstation | Linux | Software | LLMs | Config | zeroclaw | Channels
# ansible.builtin.blockinfile: # ansible.builtin.blockinfile:
# path: "{{ user_user.home }}/.zeroclaw/config.toml" # path: "{{ user_user.home }}/.zeroclaw/config.toml"
# marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Channels" # marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Channels"
@@ -311,7 +313,7 @@
# create: false # create: false
# backup: true # backup: true
- name: Workstation | Linux | Software | ZeroClaw | Models | ollama | Install - name: Workstation | Linux | Software | LLMs | Models | ollama | Install
ansible.builtin.shell: | ansible.builtin.shell: |
set -o pipefail set -o pipefail
item='{{ item.model }}' item='{{ item.model }}'
@@ -332,7 +334,7 @@
become_user: "{{ user }}" become_user: "{{ user }}"
when: llm_installs | length > 0 when: llm_installs | length > 0
- name: Workstation | Linux | Software | ZeroClaw | Models | ollama | Remove - name: Workstation | Linux | Software | LLMs | Models | ollama | Remove
ansible.builtin.shell: | ansible.builtin.shell: |
set -o pipefail set -o pipefail
item='{{ item.model }}' item='{{ item.model }}'
@@ -354,7 +356,7 @@
when: llm_removals | length > 0 when: llm_removals | length > 0
# Cheat Sheet: https://docs.zeroclaw.com/master/en/providers/configuration.html # Cheat Sheet: https://docs.zeroclaw.com/master/en/providers/configuration.html
- name: Workstation | Linux | Software | ZeroClaw | Models | zeroclaw | Add Providers - name: Workstation | Linux | Software | LLMs | Models | zeroclaw | Add Providers
ansible.builtin.blockinfile: ansible.builtin.blockinfile:
path: "{{ user_user.home }}/.zeroclaw/config.toml" path: "{{ user_user.home }}/.zeroclaw/config.toml"
marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Providers" marker: "# {mark} ANSIBLE MANAGED BLOCK | zeroclaw | Providers"
@@ -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