From fb692f376623aa4d3624bbce9ccb5ca60315864f Mon Sep 17 00:00:00 2001 From: Hyperling Date: Mon, 12 Oct 2026 10:25:02 -0700 Subject: [PATCH] llm, add a few more ollama env variables as well as set the keep alive to -1 (infinite). --- tasks/workstation/linux/software/llm.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tasks/workstation/linux/software/llm.yml b/tasks/workstation/linux/software/llm.yml index 2e13e14..60b876e 100644 --- a/tasks/workstation/linux/software/llm.yml +++ b/tasks/workstation/linux/software/llm.yml @@ -207,6 +207,8 @@ owner: "{{ user }}" mode: "0755" + # https://docs.ollama.com/faq#setting-environment-variables-on-linux + # https://modelpiper.com/blog/ollama-environment-variables - name: Workstation | Linux | Software | LLMs | runit | ollama | Script | Run ansible.builtin.copy: dest: "{{ ollama_runit_script }}" @@ -223,7 +225,7 @@ export OLLAMA_REQUEST_TIMEOUT=3600 # default 300 (unconfirmed, not in the list of --help vars) ### Resource Usage ### - export OLLAMA_KEEP_ALIVE=2h # default is 5m + export OLLAMA_KEEP_ALIVE=-1 # default is 5m 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_CONTEXT_LENGTH={{ llm_context }} # default is 4096, https://docs.ollama.com/faq#how-can-i-specify-the-context-window-size @@ -239,6 +241,12 @@ ### Tokens ### {{ ("export HF_TOKEN=" ~ hf_token) if hf_token else '' }} + ### Logging ### + export OLLAMA_DEBUG=1 + + ### Other ### + export OLLAMA_ORIGINS=* + exec chpst -u {{ user }} ollama serve mode: "0755"