Last active
July 26, 2026 15:58
-
-
Save patharanordev/ef9a699ed0daf2355928f831ace1219d to your computer and use it in GitHub Desktop.
reuse model in gguf format from ollama to llama.cpp
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
| MODEL="qwen2.5" | |
| PARAMS="7b" | |
| # Get the manifest path and extract the digest for the 'model' layer | |
| # Then print the final blob path | |
| MODEL_PATH=$(find ~/.ollama/models/manifests -name "${MODEL//:/_}" | head -n 1) | |
| DIGEST=$(jq -r '.layers[] | select(.mediaType == "application/vnd.ollama.image.model") | .digest' "$MODEL_PATH/$PARAMS") | |
| BLOB_PATH="$HOME/.ollama/models/blobs/${DIGEST/:/-}" | |
| echo "Model path: $MODEL_PATH" | |
| echo "Blob Path: $BLOB_PATH" | |
| NEW_MODEL_PATH="$HOME/.cache/huggingface/hub/models--custom--$MODEL-$PARAMS/snapshots" | |
| mkdir -p "$NEW_MODEL_PATH" | |
| ln -s $BLOB_PATH "$NEW_MODEL_PATH/$MODEL-$PARAMS.gguf" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment