From b3a11dec30875744e40eac21b63ac6906c373b95 Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 12 Oct 2026 09:43:15 -0700 Subject: [PATCH] llm, add qwen-code as a daemon, it seems promising, what I was hoping for from zeroclaw. --- tasks/workstation/linux/software/llm.yml | 61 +++++++++++++++++++++--- 1 file changed, 55 insertions(+), 6 deletions(-) diff --git a/tasks/workstation/linux/software/llm.yml b/tasks/workstation/linux/software/llm.yml index 48f6ae5..f828ce7 100644 --- a/tasks/workstation/linux/software/llm.yml +++ b/tasks/workstation/linux/software/llm.yml @@ -488,7 +488,55 @@ # Qwen Serve - Start # - # TBD + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Dir | /etc/sv + ansible.builtin.file: + name: "/etc/sv/{{ qwen_code }}/log" + state: directory + owner: root + mode: "0755" + + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Dir | /var/log + ansible.builtin.file: + name: "/var/log/{{ qwen_code }}" + state: directory + owner: "{{ user }}" + mode: "0755" + + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Script | Run + ansible.builtin.copy: + dest: /etc/sv/{{ qwen_code }}/run + content: | + #!/bin/sh -e + exec 2>&1 + exec chpst -u {{ user }} -C {{ user_user.home }}/Code qwen serve + mode: "0755" + + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Script | Finish + ansible.builtin.copy: + dest: /etc/sv/{{ qwen_code }}/finish + content: | + #!/bin/sh -e + exec 2>&1 + # $1 is the exit code, $2 is the exit status byte (signal number if killed) + echo "FINISH: Service returned with exit code: $1 and status: $2" + mode: "0755" + + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Script | Log + ansible.builtin.copy: + dest: /etc/sv/{{ qwen_code }}/log/run + content: | + #!/bin/sh -e + exec svlogd -tt /var/log/{{ qwen_code }} + mode: "0755" + + - name: Workstation | Linux | Software | LLMs | runit | qwen-code | Script | Log Config + ansible.builtin.copy: + dest: /var/log/{{ qwen_code }}/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" # Qwen Serve - End # @@ -502,11 +550,12 @@ state: "{{ 'started' if item.status else 'stopped' }}" enabled: "{{ item.status }}" loop: - - { 'name': "{{ ollama }}" , 'status': "{{ ollama_enabled }}" } - - { 'name': "{{ zeroclaw }}", 'status': "{{ zeroclaw_enabled }}" } - - { 'name': 'docker' , 'status': true } - - { 'name': 'open-webui' , 'status': "{{ open_webui_enabled }}" } - - { 'name': 'swap-stopper' , 'status': true } + - { 'name': "{{ ollama }}" , 'status': "{{ ollama_enabled }}" } + - { 'name': "{{ zeroclaw }}" , 'status': "{{ zeroclaw_enabled }}" } + - { 'name': 'docker' , 'status': true } + - { 'name': 'open-webui' , 'status': "{{ open_webui_enabled }}" } + - { 'name': 'swap-stopper' , 'status': true } + - { 'name': '{{ qwen_code }}', 'status': "{{ qwen_code_enabled }}" } - name: Workstation | Linux | Software | LLMs | Services | Verify ansible.builtin.uri: