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