llm, add a function which deletes models that get put into the removal array.

This commit is contained in:
me committed 2026-10-31 20:24:09 -07:00
1 parent 46890d0d16
commit d3a5946232
1 file changed
+25 -2
+25 -2
View File
@@ -986,17 +986,24 @@
path: "{{ user_user.home }}/{{ item }}"
marker: "# {mark} ANSIBLE MANAGED BLOCK | ollama | Manual Script"
content: |
function ollama_llms() {
function llm_installs() {
{% for llm in llm_installs %}
echo "{{ llm.model }}"
{% endfor %}
}
function llm_removals() {
{% for llm in llm_removals %}
echo "{{ llm.model }}"
{% endfor %}
}
function ollama_pull() {
echo "Manually Pulling Models"
for model in `ollama_llms`; do
for model in `llm_installs`; do
echo -e "\n\n Starting 'ollama pull $model' \n\n"
ollama pull $model
status=$?
@@ -1009,6 +1016,22 @@
alias pull-models="ollama_pull "
alias pull-ai="ollama_pull "
function ollama_clean() {
echo "Cleaning Models"
for model in `llm_removals`; do
echo -e "\n Removing '$model'"
ollama rm $model
done
echo "Done!"
}
alias ollama-clean="ollama_clean "
alias clean-ollama="ollama_clean "
alias clean-llms="ollama_clean "
alias clean-models="ollama_clean "
alias clean-ai="ollama_clean "
function ollama_chat() {
ollama run {{ 'qwen3.8:27b' if ansible_memtotal_mb > 32000 else 'qwen3.5:4b' }}
}