141 lines
4.6 KiB
YAML
141 lines
4.6 KiB
YAML
---
|
|
# 2026-10-05 Hyperling
|
|
# Install a local LLM for use offline.
|
|
# - https://zeroclaw.net/blog/install-zeroclaw
|
|
# - https://zeroclaw.net/blog/set-up-zeroclaw-bot-ollama-telegram
|
|
#
|
|
# Packages Details
|
|
# - https://archlinux.org/packages/extra/x86_64/zeroclaw/
|
|
# - https://archlinux.org/packages/extra/x86_64/ollama/
|
|
#
|
|
# Individual Guides
|
|
# - https://github.com/zeroclaw-labs/zeroclaw
|
|
# - https://wiki.archlinux.org/title/Ollama
|
|
#
|
|
# Model Explanations
|
|
# - https://webscraft.org/blog/ollama-na-8-gb-ram-yaki-modeli-pratsyuyut-u-2026?lang=en
|
|
#
|
|
# Models
|
|
# - https://ollama.com/search
|
|
|
|
# Currently only testing this on Arch based distros (pacman).
|
|
- name: Workstation | Linux | Software | ZeroClaw
|
|
block:
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Facts 01
|
|
ansible.builtin.set_fact:
|
|
zeroclaw: zeroclaw
|
|
ollama: ollama
|
|
llm_installs:
|
|
- qwen3.5:4b
|
|
#- deepseek-r1:1.5b
|
|
#- deepseek-r1:7b
|
|
#- mistal:7b
|
|
#- ministral:3b
|
|
#- ministral:8b
|
|
#- mistal:7b
|
|
#- glm4-flash
|
|
#- qwen3.5:4b
|
|
#- qwen3:4b # most similar to Ask Brave
|
|
llm_removals:
|
|
- qwen2.5
|
|
zerocode: zerocode
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Facts 02
|
|
ansible.builtin.set_fact:
|
|
ollama_runit_dir: "{{ runit_service_dir }}/{{ ollama }}"
|
|
zeroclaw_runit_dir: "{{ runit_service_dir }}/{{ zeroclaw }}"
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Facts 03
|
|
ansible.builtin.set_fact:
|
|
ollama_runit_start: "{{ ollama_runit_dir }}/{{ runit_service_script }}"
|
|
zeroclaw_runit_start: "{{ zeroclaw_runit_dir }}{{ runit_service_script }}"
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Install
|
|
ansible.builtin.package:
|
|
name:
|
|
- "{{ zeroclaw }}"
|
|
- "{{ ollama }}"
|
|
- "{{ zerocode }}"
|
|
state: present
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | ollama | Script [runit]
|
|
ansible.builtin.shell: "{{ item }}"
|
|
loop:
|
|
- "mkdir -p {{ ollama_runit_dir }}"
|
|
- "echo '#!/bin/sh -e' > {{ ollama_runit_start }}"
|
|
- "echo '# Allow pulling LLMs for use with ZeroClaw.'>> {{ ollama_runit_start }}"
|
|
- "echo 'exec 2>&1' >> {{ ollama_runit_start }}"
|
|
- "echo 'export OLLAMA_MAX_LOADED_MODELS=1' >> {{ ollama_runit_start }}"
|
|
- "echo 'exec chpst -u {{ user }} ollama serve' >> {{ ollama_runit_start }}"
|
|
- "chmod +x {{ ollama_runit_start }}"
|
|
register: shell_check
|
|
changed_when: shell_check.rc == 0
|
|
when: ansible_service_mgr == "runit"
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | ollama | Enable
|
|
ansible.builtin.service:
|
|
name: "{{ ollama }}"
|
|
state: started
|
|
enabled: true
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Models | Install
|
|
ansible.builtin.shell: |
|
|
set -o pipefail
|
|
item='{{ item }}'
|
|
if ollama list | grep -q $item; then
|
|
echo "OKAY" &&
|
|
return
|
|
else
|
|
ollama pull $item &&
|
|
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 }}"
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Models | Remove
|
|
ansible.builtin.shell: |
|
|
set -o pipefail
|
|
item='{{ item }}'
|
|
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 }}"
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Config
|
|
ansible.builtin.debug:
|
|
msg: TBD
|
|
### ~/.zeroclaw/config.toml`
|
|
### `default_provider = "ollama"` pointing at `http://127.0.0.1:11434`
|
|
|
|
- name: Workstation | Linux | Software | ZeroClaw | Test
|
|
ansible.builtin.debug:
|
|
msg: TBD
|
|
### zeroclaw agent -m "Hello!" # quick test
|
|
|
|
### Nah, run on command instead of as daemon, otherwise will eat power.
|
|
###- name: Workstation | Linux | Software | ZeroClaw | Init Scripts | zeroclaw
|
|
### ansible.builtin.debug:
|
|
### msg: TBD
|
|
###### `/run/runit/zeroclaw/run`
|
|
###### `zeroclaw daemon`
|
|
|
|
when: ansible_pkg_mgr == "pacman"
|