Created
March 14, 2025 18:55
-
-
Save hvmonteiro/e496cbeb9c33fbaf82da1f689c083897 to your computer and use it in GitHub Desktop.
List AI/LLM models installed by 'ollama' in an Linux environment using bash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for MODEL in /usr/share/ollama/.ollama/models/manifests/registry.ollama.ai/library/*; do MODEL_ASH="$(jq -r '.layers[] | select(.mediaType == "application/vnd.ollama.image.model") | .digest | gsub(":"; "-")' $MODEL/*)"; MODEL_NAME="${MODEL##*/}"; echo "$MODEL_NAME:"; echo " path: $( ls -1 /usr/share/ollama/.ollama/models/blobs/$MODEL_ASH)"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just a simple example that can be used in bash shell scripts.