Compare commits

..
5 Commits
4 changed files with 155 additions and 55 deletions

No files matched your search

+39 -14
View File
@@ -144,18 +144,23 @@ bindsym $mod+c exec codium-flatpak
# light requires sudo privileges unless video group and udev are configured. # light requires sudo privileges unless video group and udev are configured.
set $b_time 3000 set $b_time 3000
set $b_micro 5
set $b_small 10 set $b_small 10
set $b_large 20 set $b_large 20
# Use the bracket keys to change the brightness. # 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 $ctrl+bracketleft exec --no-startup-id "light -U $b_micro && 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+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+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)" 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!! # 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 $ctrl+XF86MonBrightnessUp exec --no-startup-id "light -A $b_micro && 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+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+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)" 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' # Macbooks tend to use 'sysfs/leds/smc::kbd_backlight'
# NovaCustom laptop is 'sysfs/leds/system76_acpi::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. # 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 $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 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+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+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 $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 $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 $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+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+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)" 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 # The volume function is from https://git.hyperling.com/me/env-ansible
set $v_time 1500 set $v_time 1500
set $v_small 5 set $v_micro 5
set $v_small 10
set $v_large 25 set $v_large 25
# Use the comma and period keys to change volume. # 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 $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 $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+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+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)' 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. # 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 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 $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 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+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+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 $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 bindsym $mod+slash exec pavucontrol
## Workspaces ## ## Workspaces ##
# Define names for default workspaces for which we configure key bindings later on. # Define names for default workspaces for which we configure key bindings later on.
@@ -326,6 +339,18 @@ bindsym $ctrl+$alt+q exec sudo shutdown -h now
bindsym $shift+$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 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) ## ## Resizing (Disabled) ##
# resize window (you can also use the mouse for that) # 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. # 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 %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
+15 -12
View File
@@ -290,18 +290,19 @@
; ollama (default=true) ; ollama (default=true)
; Install and enable the ollama LLM manager. ; Install and enable the ollama LLM manager.
; ;
; automanage_models (default=true) ; manage_models (default=true)
; Automatically choose and pull the models to use based on ; Automatically choose and pull the models to use based on system
; system resources. Otherwise leave user-pulled images alone. ; resources. Otherwise leaves images alone but still handles config.
; ;
; zero (default=false) ; zero (default=false)
; Install and enable the Zeroclaw web daemon, a minimalistic interface ; Install and enable the Zeroclaw web daemon, a minimalistic interface
; for many models and providers with negligible resource usage. Also ; for many models and providers with negligible resource usage. Also
; installs the CLI tool zerocode as an alternative to the web GUI. ; 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 ; Install and enable open-webui as a Docker container. Very polished web
; frontend for ollama and also handles other LLMs through API calls. ; 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) ; open_webui_port (default=3000)
; Port on which to run the open-webui Docker instance. ; Port on which to run the open-webui Docker instance.
@@ -309,6 +310,8 @@
; codium_config (default=true) ; codium_config (default=true)
; Manage the config files for and Codium plugins. Cline and Continue are ; Manage the config files for and Codium plugins. Cline and Continue are
; the recommended Codium extensions but need installed through the GUI. ; the recommended Codium extensions but need installed through the GUI.
; Currently handles:
; - ~/.continue/config.yml
; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
state: present state: present
@@ -359,10 +362,10 @@
mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}" mobile: "{{ lookup('ini', 'mobile file={{wrk_file}} default=false') | bool }}"
redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}" redmode: "{{ lookup('ini', 'redmode file={{wrk_file}} default=true' ) | bool }}"
# LLMs # LLMs
ollama: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}" ollama_enabled: "{{ lookup('ini', 'ollama file={{wrk_file}} default=true' ) | bool }}"
automanage_models: "{{ lookup('ini', 'automanage_models file={{wrk_file}} default=true' ) | bool }}" manage_models: "{{ lookup('ini', 'manage_models file={{wrk_file}} default=true' ) | bool }}"
zero: "{{ lookup('ini', 'zero file={{wrk_file}} default=false') | bool }}" zeroclaw_enabled: "{{ lookup('ini', 'zero file={{wrk_file}} default=false') | bool }}"
open_webui: "{{ lookup('ini', 'open_webui file={{wrk_file}} default=true' ) | 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 }}" 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 }}" codium_config: "{{ lookup('ini', 'codium_config file={{wrk_file}} default=true' ) | bool }}"
@@ -385,10 +388,10 @@
- { 'bsd_gpu': "{{ bsd_gpu }}" } - { 'bsd_gpu': "{{ bsd_gpu }}" }
- { 'mobile': "{{ mobile }}" } - { 'mobile': "{{ mobile }}" }
- { 'redmode': "{{ redmode }}" } - { 'redmode': "{{ redmode }}" }
- { 'ollama': "{{ ollama }}" } - { 'ollama_enabled': "{{ ollama_enabled }}" }
- { 'automanage_models': "{{ automanage_models }}" } - { 'manage_models': "{{ manage_models }}" }
- { 'zero': "{{ zero }}" } - { 'zeroclaw_enabled': "{{ zeroclaw_enabled }}" }
- { 'open_webui': "{{ open_webui }}" } - { 'open_webui_enabled': "{{ open_webui_enabled }}" }
- { 'open_webui_port': "{{ open_webui_port }}" } - { 'open_webui_port': "{{ open_webui_port }}" }
- { 'codium_config': "{{ codium_config }}" } - { 'codium_config': "{{ codium_config }}" }
+98 -29
View File
@@ -26,12 +26,25 @@
- name: Workstation | Linux | Software | LLMs - name: Workstation | Linux | Software | LLMs
block: 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 - name: Workstation | Linux | Software | LLMs | Facts 01
ansible.builtin.set_fact: ansible.builtin.set_fact:
ollama: ollama ollama: ollama
zeroclaw: zeroclaw zeroclaw: zeroclaw
zerocode: zerocode zerocode: zerocode
qwen_code: qwen-code qwen_code: qwen-code
dummy_service: 'cronie'
dummy_website: 'https://hyperling.com'
# Good to keep low to prevent swap usage. # Good to keep low to prevent swap usage.
llm_concurrency: "{{ (ansible_memtotal_mb / 64000) | round(0, method='ceil') | int }}" llm_concurrency: "{{ (ansible_memtotal_mb / 64000) | round(0, method='ceil') | int }}"
# Allow having multiple chats open without them just waiting each other. # Allow having multiple chats open without them just waiting each other.
@@ -147,8 +160,8 @@
- name: Workstation | Linux | Software | LLMs | Packages | Install - name: Workstation | Linux | Software | LLMs | Packages | Install
ansible.builtin.package: ansible.builtin.package:
name: name:
- "{{ zeroclaw }}"
- "{{ ollama }}" - "{{ ollama }}"
- "{{ zeroclaw }}"
- "{{ zerocode }}" - "{{ zerocode }}"
- "{{ qwen_code }}" - "{{ qwen_code }}"
state: present state: present
@@ -273,7 +286,8 @@
mode: "0755" mode: "0755"
- block: - name: Workstation | Linux | Software | LLMs | runit | open-webui
block:
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages - name: Workstation | Linux | Software | LLMs | runit | open-webui | Packages
ansible.builtin.package: ansible.builtin.package:
@@ -288,21 +302,14 @@
state: present state: present
when: ansible_pkg_mgr == "pacman" when: ansible_pkg_mgr == "pacman"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | Run - name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | /etc/sv
ansible.builtin.file:
name: "/etc/sv/open_webui"
state: directory
owner: root
mode: "0755"
- name: Workstation | Linux | Software | LLMs | runit | open-webui | Dir | Log
ansible.builtin.file: ansible.builtin.file:
name: "/etc/sv/open_webui/log" name: "/etc/sv/open_webui/log"
state: directory state: directory
owner: root owner: root
mode: "0755" 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: ansible.builtin.file:
name: "/var/log/open_webui" name: "/var/log/open_webui"
state: directory state: directory
@@ -313,21 +320,52 @@
ansible.builtin.copy: ansible.builtin.copy:
dest: /etc/sv/open_webui/run dest: /etc/sv/open_webui/run
content: | content: |
#!/bin/sh -e #!/bin/sh
exec 2>&1
# Wait for Docker to start up. # Wait for Docker to start up.
while [ ! -S /var/run/docker.sock ]; do sleep 1; done 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. # Start the open-webui program.
set -e
exec docker run --rm \ exec docker run --rm \
-p 3000:{{ open_webui_port }} \ -p {{ open_webui_port }}:8080 \
--add-host=host.docker.internal:host-gateway \ --add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \ -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 \ -e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
--name open-webui \ --name open-webui \
ghcr.io/open-webui/open-webui:main ghcr.io/open-webui/open-webui:main
mode: "0755" 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" when: ansible_service_mgr == "runit"
@@ -337,10 +375,10 @@
state: started state: started
enabled: true enabled: true
loop: loop:
- "{{ ollama }}" - "{{ ollama if ollama_enabled else dummy_service }}"
- "{{ zeroclaw }}" - "{{ zeroclaw if zeroclaw_enabled else dummy_service }}"
- "docker" - "{{ 'docker' if open_webui_enabled else dummy_service }}"
- "open_webui" - "{{ 'open_webui' if open_webui_enabled else dummy_service }}"
- name: Workstation | Linux | Software | LLMs | Services | Verify - name: Workstation | Linux | Software | LLMs | Services | Verify
ansible.builtin.uri: ansible.builtin.uri:
@@ -352,9 +390,21 @@
retries: 12 retries: 12
delay: 5 delay: 5
loop: loop:
- http://127.0.0.1:11434/ - "{{ 'http://127.0.0.1:11434/' if ollama_enabled else dummy_website }}"
- http://127.0.0.1:42617/health - "{{ 'http://127.0.0.1:42617/health' if zeroclaw_enabled else dummy_website }}"
- http://127.0.0.1:3000
- 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 #- name: Workstation | Linux | Software | LLMs | Config | zeroclaw | Root
# ansible.builtin.blockinfile: # ansible.builtin.blockinfile:
@@ -419,14 +469,18 @@
- .bashrc - .bashrc
- .zshrc - .zshrc
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manual Script | Message - name: Workstation | Linux | Software | LLMs | Models | ollama | Manage
block:
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Message
ansible.builtin.debug: ansible.builtin.debug:
msg: <- msg: <-
The next task may take hours, if not days. If you'd like a status bar, The next task may take hours, if not days. If you'd like a status
I highly recommed reloading your RC file and running `pull-models`. bar to know what's being worked on and its progress, I highly
That will give you a much better idea of what's going on. 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 | Install - name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Install
ansible.builtin.shell: | ansible.builtin.shell: |
set -o pipefail set -o pipefail
item='{{ item.model }}' item='{{ item.model }}'
@@ -445,9 +499,10 @@
failed_when: "'FAILED' in shell_check.stdout" failed_when: "'FAILED' in shell_check.stdout"
become: true become: true
become_user: "{{ user }}" become_user: "{{ user }}"
when: llm_installs | length > 0 when: manage_models
and llm_installs | length > 0
- name: Workstation | Linux | Software | LLMs | Models | ollama | Remove - name: Workstation | Linux | Software | LLMs | Models | ollama | Manage | Remove
ansible.builtin.shell: | ansible.builtin.shell: |
set -o pipefail set -o pipefail
item='{{ item.model }}' item='{{ item.model }}'
@@ -468,6 +523,14 @@
become_user: "{{ user }}" become_user: "{{ user }}"
when: llm_removals | length > 0 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 # Cheat Sheet: https://docs.zeroclaw.com/master/en/providers/configuration.html
- name: Workstation | Linux | Software | LLMs | Models | zeroclaw | Add Providers - name: Workstation | Linux | Software | LLMs | Models | zeroclaw | Add Providers
ansible.builtin.blockinfile: ansible.builtin.blockinfile:
@@ -476,14 +539,17 @@
insertafter: EOF insertafter: EOF
block: | block: |
{% for llm in llm_installs %} {% for llm in llm_installs %}
{% if llm.model in llm_models %}
[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 = {{ llm_context }} context_window = {{ llm_context }}
{% endif %}
{% endfor %} {% endfor %}
state: present state: present
create: false create: false
backup: true backup: true
when: zeroclaw_enabled
- name: Workstation | Linux | Software | LLMs | Models | Continue | Config - name: Workstation | Linux | Software | LLMs | Models | Continue | Config
ansible.builtin.copy: ansible.builtin.copy:
@@ -495,6 +561,7 @@
schema: v1 schema: v1
models: models:
{% for llm in llm_installs %} {% for llm in llm_installs %}
{% if llm.model in llm_models %}
- name: {{ llm.provider }} - name: {{ llm.provider }}
provider: ollama provider: ollama
model: {{ llm.model }} model: {{ llm.model }}
@@ -509,7 +576,9 @@
maxTokens: {{ llm_context }} maxTokens: {{ llm_context }}
roles: roles:
- autocomplete - autocomplete
{% endif %}
{% endfor %} {% endfor %}
mode: "0644" mode: "0644"
when: codium_config
when: ansible_pkg_mgr == "pacman" when: ansible_pkg_mgr == "pacman"