[GH-ISSUE #9996] plz add : ollama stop all #6551

Open
opened 2026-04-12 18:10:20 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @NGC13009 on GitHub (Mar 26, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/9996

The instruction to stop all models at once is required. such as

ollama stop all

In order to stop all running models without specifying long model names.

Originally created by @NGC13009 on GitHub (Mar 26, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/9996 The instruction to stop all models at once is required. such as ```bash ollama stop all ``` In order to stop all running models without specifying long model names.
GiteaMirror added the feature request label 2026-04-12 18:10:20 -05:00
Author
Owner

@ahmedadan commented on GitHub (Mar 28, 2025):

I can't remember where I saw this but on macOS/Linux you can wrap ollama pull and ollama stop to iterate over all the models using a bash function, something like:

ollama () {
        if [[ $1 == "pull" ]] && [[ $# -eq 1 ]]
        then
                echo "pulling all models..."
                ollama list | awk '$1 !~ /^registry.local/ {print $1}' | while read -r model
                do
                        if [[ $model != "NAME" ]]
                        then
                                echo "Pulling $model"
                                ollama pull "$model"
                        fi
                done
        elif [[ $1 == "stop" ]] && [[ $# -eq 1 ]]
        then
                echo "stopping all models..."
                ollama list | awk '$1 !~ /^registry.local/ {print $1}' | while read -r model
                do
                        if [[ $model != "NAME" ]]
                        then
                                echo "Stopping $model"
                                ollama stop "$model"
                        fi
                done
        else
                command ollama "$@"
        fi
}

This gives an ollama stop an output that looks like the following:

stopping all models...
Stopping gemma3:12b
Stopping gemma3:4b
Stopping gemma3:1b
Stopping qwq:latest
Stopping phi4-mini:latest
Stopping hf.co/QuantFactory/phi-4-GGUF:Q4_K_M
Stopping openthinker:32b
Stopping openthinker:7b
Stopping aia/Dolphin3.0-R1-Mistral-24B:Q4_K_M
Stopping aia/Dolphin3.0-Mistral-24B:Q4_K_S
Stopping aia/DeepSeek-R1-Distill-Qwen-32B-Uncensored-i1:latest
Stopping deepseek-r1:32b
Stopping deepseek-r1:latest
Stopping phi4:latest
Stopping hf.co/bartowski/Dolphin3.0-Llama3.1-8B-GGUF:Q4_K_M
Stopping mistral-small:latest
Stopping dolphin-phi:latest
Stopping nemotron-mini:latest
Stopping bakllava:latest
Stopping hf.co/bartowski/Llama-Doctor-3.2-3B-Instruct-GGUF:F16
Stopping nomic-embed-text:latest
Stopping tinyllama:latest
Stopping aia/dolphin-llama3.1:latest
Stopping llama3.2:3b
Stopping llama3.2:latest
Stopping llama3.2:1b
Stopping llama3.1:latest
Stopping hf.co/openerotica/writing-roleplay-20k-context-nemo-12b-v1.0-gguf:Q4_K_M
Stopping hf.co/DavidAU/L3.2-Rogue-Creative-Instruct-Uncensored-Abliterated-7B-GGUF:Q6_K
Stopping hf.co/bartowski/Hermes-3-Llama-3.1-8B-GGUF:Q4_K_M
Stopping exaone3.5:2.4b
Stopping qwen2.5:14b
Stopping hf.co/bartowski/SuperNova-Medius-GGUF:Q4_K_M
Stopping exaone3.5:32b
Stopping snowflake-arctic-embed2:latest
Stopping exaone3.5:7.8b
Stopping llama3.3:70b-instruct-q2_K
Stopping qwen2.5:14bmax
Stopping hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest
Stopping reflection-llama3.1:latest
Stopping hogwarts:3.1
Stopping hogwarts:nemotron-mini
<!-- gh-comment-id:2762217931 --> @ahmedadan commented on GitHub (Mar 28, 2025): I can't remember where I saw this but on macOS/Linux you can wrap ollama pull and ollama stop to iterate over all the models using a bash function, something like: ```bash ollama () { if [[ $1 == "pull" ]] && [[ $# -eq 1 ]] then echo "pulling all models..." ollama list | awk '$1 !~ /^registry.local/ {print $1}' | while read -r model do if [[ $model != "NAME" ]] then echo "Pulling $model" ollama pull "$model" fi done elif [[ $1 == "stop" ]] && [[ $# -eq 1 ]] then echo "stopping all models..." ollama list | awk '$1 !~ /^registry.local/ {print $1}' | while read -r model do if [[ $model != "NAME" ]] then echo "Stopping $model" ollama stop "$model" fi done else command ollama "$@" fi } ``` This gives an `ollama stop` an output that looks like the following: ``` stopping all models... Stopping gemma3:12b Stopping gemma3:4b Stopping gemma3:1b Stopping qwq:latest Stopping phi4-mini:latest Stopping hf.co/QuantFactory/phi-4-GGUF:Q4_K_M Stopping openthinker:32b Stopping openthinker:7b Stopping aia/Dolphin3.0-R1-Mistral-24B:Q4_K_M Stopping aia/Dolphin3.0-Mistral-24B:Q4_K_S Stopping aia/DeepSeek-R1-Distill-Qwen-32B-Uncensored-i1:latest Stopping deepseek-r1:32b Stopping deepseek-r1:latest Stopping phi4:latest Stopping hf.co/bartowski/Dolphin3.0-Llama3.1-8B-GGUF:Q4_K_M Stopping mistral-small:latest Stopping dolphin-phi:latest Stopping nemotron-mini:latest Stopping bakllava:latest Stopping hf.co/bartowski/Llama-Doctor-3.2-3B-Instruct-GGUF:F16 Stopping nomic-embed-text:latest Stopping tinyllama:latest Stopping aia/dolphin-llama3.1:latest Stopping llama3.2:3b Stopping llama3.2:latest Stopping llama3.2:1b Stopping llama3.1:latest Stopping hf.co/openerotica/writing-roleplay-20k-context-nemo-12b-v1.0-gguf:Q4_K_M Stopping hf.co/DavidAU/L3.2-Rogue-Creative-Instruct-Uncensored-Abliterated-7B-GGUF:Q6_K Stopping hf.co/bartowski/Hermes-3-Llama-3.1-8B-GGUF:Q4_K_M Stopping exaone3.5:2.4b Stopping qwen2.5:14b Stopping hf.co/bartowski/SuperNova-Medius-GGUF:Q4_K_M Stopping exaone3.5:32b Stopping snowflake-arctic-embed2:latest Stopping exaone3.5:7.8b Stopping llama3.3:70b-instruct-q2_K Stopping qwen2.5:14bmax Stopping hf.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF:latest Stopping reflection-llama3.1:latest Stopping hogwarts:3.1 Stopping hogwarts:nemotron-mini ```
Author
Owner

@jonaustin commented on GitHub (Mar 29, 2025):

Here's my crappy bash function; works quite well:

ollamastopall () {
        for n in $(ollama ps | grep -v NAME | awk '{print $1}')
        do
                ollama stop $n
        done
}
<!-- gh-comment-id:2764294939 --> @jonaustin commented on GitHub (Mar 29, 2025): Here's my crappy bash function; works quite well: ``` ollamastopall () { for n in $(ollama ps | grep -v NAME | awk '{print $1}') do ollama stop $n done } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#6551