Compare commits

...
5 Commits
4 changed files with 198 additions and 98 deletions

No files matched your search

+41 -16
View File
@@ -144,18 +144,23 @@ bindsym $mod+c exec codium-flatpak
# light requires sudo privileges unless video group and udev are configured.
set $b_time 3000
set $b_micro 5
set $b_small 10
set $b_large 20
# Use the bracket keys to change the brightness.
bindsym $mod+bracketleft exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym $mod+bracketright exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym $ctrl+bracketleft exec --no-startup-id "light -U $b_micro && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym $ctrl+bracketright exec --no-startup-id "light -A $b_micro && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym $mod+bracketleft exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness -- ' $(light -G)"
bindsym $mod+bracketright exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness ++ ' $(light -G)"
bindsym $shift+$mod+bracketleft exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
bindsym $shift+$mod+bracketright exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
# Also get the actual brightness keys to work!!
bindsym XF86MonBrightnessUp exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym XF86MonBrightnessDown exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym $ctrl+XF86MonBrightnessUp exec --no-startup-id "light -A $b_micro && notify-send -t $b_time 'Brightness + ' $(light -G)"
bindsym $ctrl+XF86MonBrightnessDown exec --no-startup-id "light -U $b_micro && notify-send -t $b_time 'Brightness - ' $(light -G)"
bindsym XF86MonBrightnessUp exec --no-startup-id "light -A $b_small && notify-send -t $b_time 'Brightness ++ ' $(light -G)"
bindsym XF86MonBrightnessDown exec --no-startup-id "light -U $b_small && notify-send -t $b_time 'Brightness -- ' $(light -G)"
bindsym $shift+XF86MonBrightnessUp exec --no-startup-id "light -A $b_large && notify-send -t $b_time 'Brightness +++' $(light -G)"
bindsym $shift+XF86MonBrightnessDown exec --no-startup-id "light -U $b_large && notify-send -t $b_time 'Brightness ---' $(light -G)"
@@ -167,13 +172,17 @@ bindsym $shift+XF86MonBrightnessDown exec --no-startup-id "light -U $b_large &&
# Macbooks tend to use 'sysfs/leds/smc::kbd_backlight'
# NovaCustom laptop is 'sysfs/leds/system76_acpi::kbd_backlight'
# Some other laptops may be 'sysfs/class/leds/...', use ìght -L`to find out.
bindsym XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $ctrl+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_micro && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $ctrl+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_micro && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness ++ ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness -- ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+XF86KbdBrightnessUp exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+XF86KbdBrightnessDown exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $ctrl+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_micro && notify-send -t $b_time 'Keyboard Brightness + ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $ctrl+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_micro && notify-send -t $b_time 'Keyboard Brightness - ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_small && notify-send -t $b_time 'Keyboard Brightness ++ ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_small && notify-send -t $b_time 'Keyboard Brightness -- ' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+$mod+apostrophe exec "light -s sysfs/leds/smc::kbd_backlight -A $b_large && notify-send -t $b_time 'Keyboard Brightness +++' $(light -s sysfs/leds/smc::kbd_backlight -G)"
bindsym $shift+$mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $b_large && notify-send -t $b_time 'Keyboard Brightness ---' $(light -s sysfs/leds/smc::kbd_backlight -G)"
@@ -182,26 +191,30 @@ bindsym $shift+$mod+semicolon exec "light -s sysfs/leds/smc::kbd_backlight -U $
# The volume function is from https://git.hyperling.com/me/env-ansible
set $v_time 1500
set $v_small 5
set $v_micro 5
set $v_small 10
set $v_large 25
# Use the comma and period keys to change volume.
bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume - " $(volume)'
bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume + " $(volume)'
bindsym $ctrl+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_micro && notify-send -t $v_time "Volume - " $(volume)'
bindsym $ctrl+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_micro && notify-send -t $v_time "Volume + " $(volume)'
bindsym $mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume -- " $(volume)'
bindsym $mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume ++ " $(volume)'
bindsym $shift+$mod+comma exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume ---" $(volume)'
bindsym $shift+$mod+period exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++" $(volume)'
# Actual volume keys.
bindsym XF86AudioMute exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume mute && notify-send -t $v_time "Volume Muted" $(volume)'
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume + " $(volume)'
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume - " $(volume)'
bindsym $ctrl+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_micro && notify-send -t $v_time "Volume + " $(volume)'
bindsym $ctrl+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_micro && notify-send -t $v_time "Volume - " $(volume)'
bindsym XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_small && notify-send -t $v_time "Volume ++ " $(volume)'
bindsym XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_small && notify-send -t $v_time "Volume -- " $(volume)'
bindsym $shift+XF86AudioRaiseVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume +$v_large && notify-send -t $v_time "Volume +++ " $(volume)'
bindsym $shift+XF86AudioLowerVolume exec --no-startup-id bash -c 'source /usr/local/bin/volume.function && volume -$v_large && notify-send -t $v_time "Volume --- " $(volume)'
bindsym $mod+slash exec pavucontrol
## Workspaces ##
# Define names for default workspaces for which we configure key bindings later on.
@@ -322,10 +335,22 @@ bindsym $shift+$mod+l exec "i3lock -c 000000 -e -f && sleep 1 && xset dpms force
# shutdown entire system.
#bindsym $ctrl+$shift+q exec dbus-send --system --print-reply --dest="org.freedesktop.ConsoleKit" /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stop
bindsym $ctrl+$alt+q exec sudo shutdown -h now
bindsym $shift+$alt+q exec sudo shutdown -h now
bindsym $ctrl+$alt+q exec sudo shutdown -h now
bindsym $shift+$alt+q exec sudo shutdown -h now
bindsym $shift+$ctrl+q exec sudo shutdown -h now
# restart entire system.
bindsym $ctrl+$alt+r exec sudo shutdown -r now
bindsym $shift+$alt+r exec sudo shutdown -r now
bindsym $shift+$ctrl+r exec sudo shutdown -r now
# restart LLM programs
set $RESTART_LLMS "sudo sv restart ollama; sudo sv restart zeroclaw; sudo sv restart open-webui"
bindsym $ctrl+$alt+r exec $RESTART_LLMS
bindsym $shift+$alt+r exec $RESTART_LLMS
bindsym $shift+$ctrl+r exec $RESTART_LLMS
## Resizing (Disabled) ##
# resize window (you can also use the mouse for that)
+3
View File
@@ -3,3 +3,6 @@
# Allow anyone in the sudo group to shutdown or reboot without a password.
%sudo ALL=(ALL) NOPASSWD: /sbin/shutdown, /usr/sbin/shutdown, /sbin/reboot, /usr/sbin/reboot
# Allow the sudo group to manage runit services.
%sudo ALL=(ALL) NOPASSWD: /sbin/sv, /usr/sbin/sv, /sbin/sv, /usr/sbin/sv
+17 -14
View File
@@ -290,18 +290,19 @@
; ollama (default=true)
; Install and enable the ollama LLM manager.
;
; automanage_models (default=true)
; Automatically choose and pull the models to use based on
; system resources. Otherwise leave user-pulled images alone.
; manage_models (default=true)
; Automatically choose and pull the models to use based on system
; resources. Otherwise leaves images alone but still handles config.
;
; zero (default=false)
; Install and enable the Zeroclaw web daemon, a minimalistic interface
; for many models and providers with negligible resource usage. Also
; installs the CLI tool zerocode as an alternative to the web GUI.
;
; open_webui (default=true)
; open_webui (default=false)
; Install and enable open-webui as a Docker container. Very polished web
; frontend for ollama and also handles other LLMs through API calls.
; Container is over 1GB in size and consumes resources.
;
; open_webui_port (default=3000)
; Port on which to run the open-webui Docker instance.
@@ -309,6 +310,8 @@
; codium_config (default=true)
; Manage the config files for and Codium plugins. Cline and Continue are
; the recommended Codium extensions but need installed through the GUI.
; Currently handles:
; - ~/.continue/config.yml
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present
@@ -359,12 +362,12 @@
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
# LLMs
ollama: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}"
automanage_models: "{{ lookup('ini', 'automanage_models file={{wrk_file}} default=true' ) | bool }}"
zero: "{{ lookup('ini', 'zero file={{wrk_file}} default=false') | bool }}"
open_webui: "{{ lookup('ini', 'open_webui file={{wrk_file}} default=true' ) | bool }}"
open_webui_port: "{{ lookup('ini', 'open_webui_port file={{wrk_file}} default=3000' ) | int }}"
codium_config: "{{ lookup('ini', 'codium_config file={{wrk_file}} default=true' ) | bool }}"
ollama_enabled: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}"
manage_models: "{{ lookup('ini', 'manage_models file={{wrk_file}} default=true' ) | bool }}"
zeroclaw_enabled: "{{ lookup('ini', 'zero file={{wrk_file}} default=false') | bool }}"
open_webui_enabled: "{{ lookup('ini', 'open_webui file={{wrk_file}} default=false') | bool }}"
open_webui_port: "{{ lookup('ini', 'open_webui_port file={{wrk_file}} default=3000' ) | int }}"
codium_config: "{{ lookup('ini', 'codium_config file={{wrk_file}} default=true' ) | bool }}"
- name: General | Account Management | Provisioning Configuration | Workstation | Boolean Check | Editing
ansible.builtin.set_fact:
@@ -385,10 +388,10 @@
- { 'bsd_gpu': "{{ bsd_gpu }}" }
- { 'mobile': "{{ mobile }}" }
- { 'redmode': "{{ redmode }}" }
- { 'ollama': "{{ ollama }}" }
- { 'automanage_models': "{{ automanage_models }}" }
- { 'zero': "{{ zero }}" }
- { 'open_webui': "{{ open_webui }}" }
- { 'ollama_enabled': "{{ ollama_enabled }}" }
- { 'manage_models': "{{ manage_models }}" }
- { 'zeroclaw_enabled': "{{ zeroclaw_enabled }}" }
- { 'open_webui_enabled': "{{ open_webui_enabled }}" }
- { 'open_webui_port': "{{ open_webui_port }}" }
- { 'codium_config': "{{ codium_config }}" }
+137 -68
View File
@@ -26,12 +26,25 @@
- name: Workstation | Linux | Software | LLMs
block:
- name: Workstation | Linux | Software | LLMs | Facts | Provisioned
debug:
var: "{{ item }}"
loop:
- ollama_enabled
- manage_models
- zeroclaw_enabled
- open_webui_enabled
- open_webui_port
- codium_config
- name: Workstation | Linux | Software | LLMs | Facts 01
ansible.builtin.set_fact:
ollama: ollama
zeroclaw: zeroclaw
zerocode: zerocode
qwen_code: qwen-code
dummy_service: 'cronie'
dummy_website: 'https://hyperling.com'
# Good to keep low to prevent swap usage.
llm_concurrency: "{{ (ansible_memtotal_mb / 64000) | round(0, method='ceil') | int }}"
# Allow having multiple chats open without them just waiting each other.
@@ -147,8 +160,8 @@
- name: Workstation | Linux | Software | LLMs | Packages | Install
ansible.builtin.package:
name:
- "{{ zeroclaw }}"
- "{{ ollama }}"
- "{{ zeroclaw }}"
- "{{ zerocode }}"
- "{{ qwen_code }}"
state: present
@@ -273,7 +286,8 @@
mode: "0755"
- block:
- name: Workstation | Linux | Software | LLMs | runit | open-webui
block:
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages
ansible.builtin.package:
@@ -288,21 +302,14 @@
state: present
when: ansible_pkg_mgr == "pacman"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | Run
ansible.builtin.file:
name: "/etc/sv/open_webui"
state: directory
owner: root
mode: "0755"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | Log
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /etc/sv
ansible.builtin.file:
name: "/etc/sv/open_webui/log"
state: directory
owner: root
mode: "0755"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | Log Config
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /var/log
ansible.builtin.file:
name: "/var/log/open_webui"
state: directory
@@ -313,21 +320,52 @@
ansible.builtin.copy:
dest: /etc/sv/open_webui/run
content: |
#!/bin/sh -e
#!/bin/sh
exec 2>&1
# Wait for Docker to start up.
while [ ! -S /var/run/docker.sock ]; do sleep 1; done
# Ensure the old container is gone.
echo "Stopping..."
docker stop open-webui &&
echo "Container stopped" ||
echo "Container already stopped."
echo "Deleting..."
docker rm -f open-webui &&
echo "Container deleted" ||
echo "Container already deleted."
# Start the open-webui program.
set -e
exec docker run --rm \
-p 3000:{{ open_webui_port }} \
-p {{ open_webui_port }}:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
-e WEBUI_SECRET_KEY=your-secret-key \
-e WEBUI_SECRET_KEY=7578094558f49cf38be40fc463cc0451 \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
--name open-webui \
ghcr.io/open-webui/open-webui:main
mode: "0755"
when: open_webui
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log
ansible.builtin.copy:
dest: /etc/sv/open_webui/log/run
content: |
#!/bin/sh -e
exec svlogd -tt /var/log/open_webui
mode: "0755"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Script | Log Config
ansible.builtin.copy:
dest: /var/log/open_webui/config
content: |
s1000000 # rotate at 1 MB
n5 # keep 5 old files
dateformat %Y-%m-%d_%H-%M-%S # each run gets its own file.
mode: "0755"
when: open_webui_enabled
when: ansible_service_mgr == "runit"
@@ -337,10 +375,10 @@
state: started
enabled: true
loop:
- "{{ ollama }}"
- "{{ zeroclaw }}"
- "docker"
- "open_webui"
- "{{ ollama if ollama_enabled else dummy_service }}"
- "{{ zeroclaw if zeroclaw_enabled else dummy_service }}"
- "{{ 'docker' if open_webui_enabled else dummy_service }}"
- "{{ 'open_webui' if open_webui_enabled else dummy_service }}"
- name: Workstation | Linux | Software | LLMs | Services | Verify
ansible.builtin.uri:
@@ -352,9 +390,21 @@
retries: 12
delay: 5
loop:
- http://127.0.0.1:11434/
- http://127.0.0.1:42617/health
- http://127.0.0.1:3000
- "{{ 'http://127.0.0.1:11434/' if ollama_enabled else dummy_website }}"
- "{{ 'http://127.0.0.1:42617/health' if zeroclaw_enabled else dummy_website }}"
- name: Workstation | Linux | Software | LLMs | Services | Verify | Okay to Fail
ansible.builtin.uri:
url: "{{ item }}"
status_code: 200
timeout: 5
register: health
until: health.status == 200
retries: 12
delay: 5
loop:
- "{{ 'http://127.0.0.1:3000/health' if open_webui_enabled else dummy_website }}"
ignore_errors: true
#- name: Workstation | Linux | Software | LLMs | Config | zeroclaw | Root
# ansible.builtin.blockinfile:
@@ -419,54 +469,67 @@
- .bashrc
- .zshrc
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manual Script | Message
ansible.builtin.debug:
msg: <-
The next task may take hours, if not days. If you'd like a status bar,
I highly recommed reloading your RC file and running `pull-models`.
That will give you a much better idea of what's going on.
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manage
block:
- name: Workstation | Linux | Software | LLMs | Models | ollama | Install
ansible.builtin.shell: |
set -o pipefail
item='{{ item.model }}'
if ollama list | grep -q $item; then
echo "OKAY" &&
return
else
ollama pull $item 1>/dev/null &&
echo "INSTALLED" &&
return
fi
echo "FAILED"
loop: "{{ llm_installs }}"
register: shell_check
changed_when: "'INSTALLED' in shell_check.stdout"
failed_when: "'FAILED' in shell_check.stdout"
become: true
become_user: "{{ user }}"
when: llm_installs | length > 0
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Message
ansible.builtin.debug:
msg: <-
The next task may take hours, if not days. If you'd like a status
bar to know what's being worked on and its progress, I highly
recommed reloading your RC file and running `pull-models`. That
will give you a much better idea of what's going on.
- name: Workstation | Linux | Software | LLMs | Models | ollama | Remove
ansible.builtin.shell: |
set -o pipefail
item='{{ item.model }}'
if ollama list | grep -q $item; then
ollama rm $item &&
echo "INSTALLED" &&
return
else
echo "OKAY" &&
return
fi
echo "FAILED"
loop: "{{ llm_removals }}"
register: shell_check
changed_when: "'INSTALLED' in shell_check.stdout"
failed_when: "'FAILED' in shell_check.stdout"
become: true
become_user: "{{ user }}"
when: llm_removals | length > 0
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Install
ansible.builtin.shell: |
set -o pipefail
item='{{ item.model }}'
if ollama list | grep -q $item; then
echo "OKAY" &&
return
else
ollama pull $item 1>/dev/null &&
echo "INSTALLED" &&
return
fi
echo "FAILED"
loop: "{{ llm_installs }}"
register: shell_check
changed_when: "'INSTALLED' in shell_check.stdout"
failed_when: "'FAILED' in shell_check.stdout"
become: true
become_user: "{{ user }}"
when: manage_models
and llm_installs | length > 0
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Remove
ansible.builtin.shell: |
set -o pipefail
item='{{ item.model }}'
if ollama list | grep -q $item; then
ollama rm $item &&
echo "INSTALLED" &&
return
else
echo "OKAY" &&
return
fi
echo "FAILED"
loop: "{{ llm_removals }}"
register: shell_check
changed_when: "'INSTALLED' in shell_check.stdout"
failed_when: "'FAILED' in shell_check.stdout"
become: true
become_user: "{{ user }}"
when: llm_removals | length > 0
when: manage_models
- name: Workstation | Linux | Software | LLMs | Models | ollama | Get Models
ansible.builtin.shell:
cmd: ollama ls | tail -n +2 | awk '{print $1}'
register: llm_models
changed_when: llm_models.rc == 0
# Cheat Sheet: https://docs.zeroclaw.com/master/en/providers/configuration.html
- name: Workstation | Linux | Software | LLMs | Models | zeroclaw | Add Providers
@@ -476,14 +539,17 @@
insertafter: EOF
block: |
{% for llm in llm_installs %}
{% if llm.model in llm_models %}
[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 = {{ llm_context }}
{% endif %}
{% endfor %}
state: present
create: false
backup: true
when: zeroclaw_enabled
- name: Workstation | Linux | Software | LLMs | Models | Continue | Config
ansible.builtin.copy:
@@ -495,6 +561,7 @@
schema: v1
models:
{% for llm in llm_installs %}
{% if llm.model in llm_models %}
- name: {{ llm.provider }}
provider: ollama
model: {{ llm.model }}
@@ -509,7 +576,9 @@
maxTokens: {{ llm_context }}
roles:
- autocomplete
{% endif %}
{% endfor %}
mode: "0644"
when: codium_config
when: ansible_pkg_mgr == "pacman"