feat: add model checking and conditional pulling for Ollama models
This commit is contained in:
parent
54d368d462
commit
f0bef8e4c1
@ -7,3 +7,4 @@ ollama_host: "0.0.0.0"
|
|||||||
ollama_port: 11434
|
ollama_port: 11434
|
||||||
ollama_models:
|
ollama_models:
|
||||||
- qwen3:4b
|
- qwen3:4b
|
||||||
|
- llama3
|
||||||
@ -34,8 +34,15 @@
|
|||||||
retries: 10
|
retries: 10
|
||||||
delay: 3
|
delay: 3
|
||||||
|
|
||||||
|
- name: Check installed ollama models
|
||||||
|
uri:
|
||||||
|
url: "http://localhost:{{ ollama_port }}/api/tags"
|
||||||
|
return_content: true
|
||||||
|
register: ollama_tags
|
||||||
|
|
||||||
- name: Pull ollama models
|
- name: Pull ollama models
|
||||||
command: /opt/homebrew/bin/ollama pull {{ item }}
|
command: /opt/homebrew/bin/ollama pull {{ item }}
|
||||||
loop: "{{ ollama_models }}"
|
loop: "{{ ollama_models }}"
|
||||||
|
when: item not in (ollama_tags.json.models | map(attribute='name') | list)
|
||||||
environment:
|
environment:
|
||||||
OLLAMA_HOST: "http://localhost:{{ ollama_port }}"
|
OLLAMA_HOST: "http://localhost:{{ ollama_port }}"
|
||||||
Loading…
x
Reference in New Issue
Block a user