Skip to content

Instantly share code, notes, and snippets.

@hvmonteiro
Created March 14, 2025 18:55
Show Gist options
  • Save hvmonteiro/e496cbeb9c33fbaf82da1f689c083897 to your computer and use it in GitHub Desktop.
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
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
@hvmonteiro
Copy link
Author

Just a simple example that can be used in bash shell scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment