llm, simplify Continue config, add a function for pulling the LLMs outside of Ansible, adjust ollama settings.
This commit is contained in:
@@ -33,7 +33,7 @@
|
|||||||
zerocode: zerocode
|
zerocode: zerocode
|
||||||
qwen_code: qwen-code
|
qwen_code: qwen-code
|
||||||
# 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.
|
||||||
llm_parallel: "{{ ansible_processor_vcpus / 8 | round(0, method='ceil') | int }}"
|
llm_parallel: "{{ ansible_processor_vcpus / 8 | round(0, method='ceil') | int }}"
|
||||||
# Most LLMs take a coefficient of about 1.2 to 1.5 of their file size in
|
# Most LLMs take a coefficient of about 1.2 to 1.5 of their file size in
|
||||||
@@ -186,10 +186,10 @@
|
|||||||
exec 2>&1
|
exec 2>&1
|
||||||
export HOME={{ user_user.home }}
|
export HOME={{ user_user.home }}
|
||||||
# Timeouts #
|
# Timeouts #
|
||||||
export OLLAMA_LOAD_TIMEOUT=30m # default is 5m
|
export OLLAMA_LOAD_TIMEOUT=20m # default is 5m
|
||||||
export OLLAMA_REQUEST_TIMEOUT=3600 # default 300 (unconfirmed, not in the list of --help vars)
|
export OLLAMA_REQUEST_TIMEOUT=3600 # default 300 (unconfirmed, not in the list of --help vars)
|
||||||
# Resource Usage #
|
# Resource Usage #
|
||||||
export OLLAMA_KEEP_ALIVE=20m # default 5m
|
export OLLAMA_KEEP_ALIVE=20m # default is 5m
|
||||||
export OLLAMA_MAX_LOADED_MODELS={{ llm_concurrency }} # default is 3 if using CPUs, or 3 * NumGPUs
|
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 (unconfirmed)
|
||||||
export OLLAMA_CONTEXT_LENGTH={{ llm_context }} # default is 4096, https://docs.ollama.com/faq#how-can-i-specify-the-context-window-size
|
export OLLAMA_CONTEXT_LENGTH={{ llm_context }} # default is 4096, https://docs.ollama.com/faq#how-can-i-specify-the-context-window-size
|
||||||
@@ -323,6 +323,42 @@
|
|||||||
# create: false
|
# create: false
|
||||||
# backup: true
|
# backup: true
|
||||||
|
|
||||||
|
|
||||||
|
- name: Workstation | Linux | Software | LLMs | Models | ollama | Manual Script
|
||||||
|
ansible.builtin.blockinfile:
|
||||||
|
path: "{{ user_user.home }}/{{ item }}"
|
||||||
|
marker: "# {mark} ANSIBLE MANAGED BLOCK | ollama | Manual Script"
|
||||||
|
content: |
|
||||||
|
function pull_llms() {
|
||||||
|
echo "Manually Pulling Models"
|
||||||
|
{% for llm in llm_installs %}
|
||||||
|
|
||||||
|
echo -e "\n\n Starting {{ llm.model }} \n\n"
|
||||||
|
ollama pull {{ llm.model }} || {
|
||||||
|
status=$?
|
||||||
|
echo "ERROR: Pull failed with status $status, exiting."
|
||||||
|
exit $status
|
||||||
|
}
|
||||||
|
{% endfor %}
|
||||||
|
echo "Done!!"
|
||||||
|
}
|
||||||
|
alias pull-llms="pull_llms "
|
||||||
|
alias pull-models="pull_llms "
|
||||||
|
alias pull-ai="pull_llms "
|
||||||
|
state: present
|
||||||
|
create: false
|
||||||
|
backup: true
|
||||||
|
loop:
|
||||||
|
- .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 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 | Install
|
- name: Workstation | Linux | Software | LLMs | Models | ollama | Install
|
||||||
ansible.builtin.shell: |
|
ansible.builtin.shell: |
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
@@ -391,24 +427,14 @@
|
|||||||
version: 1.0.0
|
version: 1.0.0
|
||||||
schema: v1
|
schema: v1
|
||||||
models:
|
models:
|
||||||
mode: "0644"
|
{% for llm in llm_installs %}
|
||||||
|
- name: {{ llm.provider }}
|
||||||
- name: Workstation | Linux | Software | LLMs | Models | Continue | Models
|
|
||||||
ansible.builtin.blockinfile:
|
|
||||||
path: "{{ user_user.home }}/.continue/config.yml"
|
|
||||||
marker: "# {mark} ANSIBLE MANAGED BLOCK | llm.yml | Continue"
|
|
||||||
insertafter: EOF
|
|
||||||
block: |
|
|
||||||
{% for llm in llm_installs %}
|
|
||||||
- name: llm.provider
|
|
||||||
provider: ollama
|
provider: ollama
|
||||||
model: llm.model
|
model: {{ llm.model }}
|
||||||
defaultCompletionOptions:
|
defaultCompletionOptions:
|
||||||
contextLength: {{ llm_context }}
|
contextLength: {{ llm_context }}
|
||||||
maxTokens: {{ llm_context }}
|
maxTokens: {{ llm_context }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
state: present
|
mode: "0644"
|
||||||
create: false
|
|
||||||
backup: true
|
|
||||||
|
|
||||||
when: ansible_pkg_mgr == "pacman"
|
when: ansible_pkg_mgr == "pacman"
|
||||||
|
|||||||
Reference in New Issue
Block a user