llm, begin refactoring the script into an ai folder, also increase parallel.
This commit is contained in:
1 parent
373b03d46c
commit
9949014558
5 files changed
+70
-41
No files matched your search
@@ -131,7 +131,7 @@
|
||||
|
||||
- ansible.builtin.include_tasks: tasks/workstation/linux/software/docker.yml
|
||||
|
||||
- ansible.builtin.include_tasks: tasks/workstation/linux/software/llm.yml
|
||||
- ansible.builtin.include_tasks: tasks/workstation/linux/software/ai/llm.yml
|
||||
|
||||
when: ansible_system == "Linux"
|
||||
and internet
|
||||
|
||||
File renamed without changes.
+10
-2
@@ -66,7 +66,15 @@
|
||||
# Also setting this to a minimum of 3 for using Codium with extensions.
|
||||
# 20261014: Going down to 1 since only using CPUs, no GPUs. Otherwise
|
||||
# the models seem to take excessively long to answer even small things.
|
||||
llm_parallel: 1 #"{{ [(ansible_processor_vcpus / 2) | round(0, method='ceil'), 3] | max | int }}"
|
||||
#llm_parallel: 1 #"{{ [(ansible_processor_vcpus / 2) | round(0, method='ceil'), 3] | max | int }}"
|
||||
# 20261027 Increased to 3 as a maximum.
|
||||
# After more research, this is a more memory-based parameter. Basically
|
||||
# the model allocates this number of KV caches, that way when it is
|
||||
# running in multiple chats it does not need to drop context and reload.
|
||||
# Still only uses X threads for all chats, but does not waste much time.
|
||||
# So if set to 3, and doing 64K context, it really allocates 192k in RAM
|
||||
# and supposedly if only doing 1 chat the model can use it all.
|
||||
llm_parallel: "{{ [(ansible_memtotal_mb / 8000) | round(0, method='floor'), 3] | min | int }}"
|
||||
# Most LLMs take a coefficient of about 1.2 to 1.5 of their file size in
|
||||
# RAM, which is usually less than guessing a usage of weight*1000.
|
||||
# Example:
|
||||
@@ -272,7 +280,7 @@
|
||||
### Resource Usage ###
|
||||
export OLLAMA_KEEP_ALIVE=-1 # default is 5m. Good frontends keep the model alive as long as it needs to be, this is not a source of timeout.
|
||||
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_NUM_PARALLEL={{ llm_parallel }} # default is 1 and applies per-model
|
||||
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)
|
||||
export OLLAMA_NUM_THREADS={{ (ansible_processor_vcpus / 2) | int }} # not real, but maybe some day.
|
||||
@@ -5,52 +5,73 @@
|
||||
- name: Workstation | Linux | Software | Hugo
|
||||
block:
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | pacman
|
||||
block:
|
||||
- name: Workstation | Linux | Software | Hugo | pacman
|
||||
block:
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Facts
|
||||
ansible.builtin.set_fact:
|
||||
sass_old: ruby-sass
|
||||
sass_current: dart-sass
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Facts
|
||||
ansible.builtin.set_fact:
|
||||
sass_old: ruby-sass
|
||||
sass_current: dart-sass
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Remove Old
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- "{{ sass_old }}"
|
||||
state: absent
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Remove Old
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- "{{ sass_old }}"
|
||||
state: absent
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Install New
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- "{{ sass_current }}"
|
||||
state: present
|
||||
- name: Workstation | Linux | Software | Hugo | pacman | Install New
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- hugo
|
||||
- "{{ sass_current }}"
|
||||
state: present
|
||||
|
||||
when: ansible_pkg_mgr == "pacman"
|
||||
when: ansible_pkg_mgr == "pacman"
|
||||
|
||||
# This must exist after nodejs.yml so that NPM is installed.
|
||||
- name: Workstation | Linux | Software | Hugo | npm
|
||||
block:
|
||||
# This must exist after nodejs.yml so that NPM is installed.
|
||||
- name: Workstation | Linux | Software | Hugo | apt
|
||||
block:
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | npm | Facts
|
||||
ansible.builtin.set_fact:
|
||||
sass_old: node-sass
|
||||
sass_current: sass
|
||||
- name: Workstation | Linux | Software | Hugo | apt | sass | Facts
|
||||
ansible.builtin.set_fact:
|
||||
sass_old: node-sass
|
||||
sass_current: sass
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | npm | Gather
|
||||
ansible.builtin.shell: npm prefix -g
|
||||
register: npm_bin_dir # Provides /usr/local/ on Devuan, /usr/ on Artix.
|
||||
changed_when: false
|
||||
- name: Workstation | Linux | Software | Hugo | apt | sass | Gather
|
||||
ansible.builtin.shell: npm prefix -g
|
||||
register: npm_bin_dir # Provides /usr/local/ on Devuan, /usr/ on Artix.
|
||||
changed_when: false
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | npm | Remove Old
|
||||
ansible.builtin.shell: "npm remove -g {{ sass_old }}"
|
||||
args:
|
||||
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||
- name: Workstation | Linux | Software | Hugo | apt | sass | Remove Old
|
||||
ansible.builtin.shell: "npm remove -g {{ sass_old }}"
|
||||
args:
|
||||
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | npm | Install New
|
||||
ansible.builtin.shell: "npm install -g {{ sass_current }}"
|
||||
args:
|
||||
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||
- name: Workstation | Linux | Software | Hugo | apt | sass | Install New
|
||||
ansible.builtin.shell: "npm install -g {{ sass_current }}"
|
||||
args:
|
||||
creates: "{{ npm_bin_dir.stdout }}/bin/sass"
|
||||
|
||||
when: ansible_pkg_mgr == "apt"
|
||||
- name: Workstation | Linux | Software | Hugo | apt | hugo | Remove Old
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- hugo
|
||||
state: absent
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | apt | hugo | Install Dependencies
|
||||
ansible.builtin.package:
|
||||
name:
|
||||
- golang
|
||||
- gcc
|
||||
state: present
|
||||
|
||||
- name: Workstation | Linux | Software | Hugo | apt | hugo | Build
|
||||
ansible.builtin.shell: |
|
||||
CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest
|
||||
ln -s $HOME/go/bin/hugo /usr/local/bin/hugo
|
||||
register: shell_check
|
||||
changed_when: shell_check.rc == 0
|
||||
|
||||
when: ansible_pkg_mgr == "apt"
|
||||
|
||||
when: coding is true
|
||||
@@ -28,7 +28,7 @@
|
||||
ansible.builtin.include_tasks: tasks/workstation/linux/software/docker.yml
|
||||
|
||||
- name: LLM
|
||||
ansible.builtin.include_tasks: tasks/workstation/linux/software/llm.yml
|
||||
ansible.builtin.include_tasks: tasks/workstation/linux/software/ai/llm.yml
|
||||
|
||||
#######################
|
||||
#######################
|
||||
|
||||
Reference in new issue
Block a user