Instructions to use FoolDev/Thanatos-27B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use FoolDev/Thanatos-27B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="FoolDev/Thanatos-27B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("FoolDev/Thanatos-27B", dtype="auto") - llama-cpp-python
How to use FoolDev/Thanatos-27B with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="FoolDev/Thanatos-27B", filename="Thanatos-27B.Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use FoolDev/Thanatos-27B with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf FoolDev/Thanatos-27B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf FoolDev/Thanatos-27B:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf FoolDev/Thanatos-27B:Q4_K_M # Run inference directly in the terminal: llama-cli -hf FoolDev/Thanatos-27B:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf FoolDev/Thanatos-27B:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf FoolDev/Thanatos-27B:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf FoolDev/Thanatos-27B:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf FoolDev/Thanatos-27B:Q4_K_M
Use Docker
docker model run hf.co/FoolDev/Thanatos-27B:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use FoolDev/Thanatos-27B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "FoolDev/Thanatos-27B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FoolDev/Thanatos-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/FoolDev/Thanatos-27B:Q4_K_M
- SGLang
How to use FoolDev/Thanatos-27B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "FoolDev/Thanatos-27B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FoolDev/Thanatos-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "FoolDev/Thanatos-27B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "FoolDev/Thanatos-27B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Ollama
How to use FoolDev/Thanatos-27B with Ollama:
ollama run hf.co/FoolDev/Thanatos-27B:Q4_K_M
- Unsloth Studio new
How to use FoolDev/Thanatos-27B with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FoolDev/Thanatos-27B to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for FoolDev/Thanatos-27B to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for FoolDev/Thanatos-27B to start chatting
- Pi new
How to use FoolDev/Thanatos-27B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf FoolDev/Thanatos-27B:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "FoolDev/Thanatos-27B:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use FoolDev/Thanatos-27B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf FoolDev/Thanatos-27B:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default FoolDev/Thanatos-27B:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use FoolDev/Thanatos-27B with Docker Model Runner:
docker model run hf.co/FoolDev/Thanatos-27B:Q4_K_M
- Lemonade
How to use FoolDev/Thanatos-27B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull FoolDev/Thanatos-27B:Q4_K_M
Run and chat with the model
lemonade run user.Thanatos-27B-Q4_K_M
List all available models
lemonade list
heal-hf: validate the rewritten manifest via 'ollama show' + roll back on failure
Browse filesBefore this, `make heal-hf` trusted its own rewrite: after the
`jq` digest-substitution succeeded and the atomic `mv` into place
landed, the script proceeded to remove the old qwen36 blob and
declare success. A rewrite that produced jq-parseable but
ollama-rejected JSON — e.g. layer order off, missing mediaType,
digest no longer matching the on-disk blob bytes — would only
surface at the user's next `ollama run`, by which point the old
blob was gone and the tag was stuck in a half-broken state.
Two changes to make the script crash-safe:
1. **Backup before rewrite, restore on validation failure.** Step 5
now `cp`s the original manifest to `${MANIFEST}.heal-backup`
before invoking jq, runs the rewrite + atomic `mv` as before,
then runs `ollama show ${TAG} >/dev/null` as a self-test.
`ollama show` parses the manifest, walks layer digests, and
reads enough of the model blob to extract metadata (arch,
params, etc.) — it's exactly the surface that needs to hold
for `ollama run` to subsequently load. On failure the script
`mv`s the backup back over the manifest, prints a diagnostic,
and exits non-zero. On success the backup is removed.
2. **Reordered old-blob cleanup to come AFTER validation.** What
was step 6 (remove old qwen36 blob if no other manifest refs
it) is now step 7, gated behind step 6 (validate). This means
a rollback always lands on a consistent state: original
manifest still pointing at the original blob, both still
present. The new qwen35 blob is left in the store as an
orphan; ollama auto-prunes unreferenced blobs on next service
restart, so disk usage tidies up on its own.
Doesn't change runtime materially — `ollama show` finishes in
milliseconds because it only reads GGUF metadata (KV header), not
tensor data.
Verified end-to-end this session against the actual broken pull:
manifest rewrite + `ollama show` validation pass, smoke + tool-call
round-trip continue to succeed on the healed `hf.co/...` tag. The
rollback path is defensive and exercised by reading the code, not
by an integration test (the heal logic itself works; the rollback
exists for a hypothetical future regression).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- CHANGELOG.md +18 -0
- scripts/heal_hf_pull.sh +30 -1
|
@@ -7,6 +7,24 @@ and documentation**, not the underlying base model.
|
|
| 7 |
|
| 8 |
## [Unreleased]
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
## [0.6.0] - 2026-05-19 — `c336f44`
|
| 11 |
|
| 12 |
Headline changes since 0.5.0 (over a two-week burst on 2026-05-19):
|
|
|
|
| 7 |
|
| 8 |
## [Unreleased]
|
| 9 |
|
| 10 |
+
### Added
|
| 11 |
+
- `scripts/heal_hf_pull.sh` now validates the rewritten manifest by
|
| 12 |
+
running `ollama show <tag>` immediately after the atomic mv into
|
| 13 |
+
place, with rollback-on-failure semantics. Before this, a buggy
|
| 14 |
+
rewrite that produced jq-parseable but ollama-rejected JSON (e.g.
|
| 15 |
+
layer order off, missing required mediaType, digest that no
|
| 16 |
+
longer matches the on-disk blob bytes) would only be discovered
|
| 17 |
+
at the user's `ollama run` step — and by then the old qwen36
|
| 18 |
+
blob had already been removed, leaving the tag in a half-broken
|
| 19 |
+
state with no easy recovery. Now: the script `cp`s the original
|
| 20 |
+
manifest to a `.heal-backup` sidecar before the rewrite, runs
|
| 21 |
+
`ollama show` against the rewritten manifest, and on failure
|
| 22 |
+
`mv`s the backup back into place and exits non-zero. The old
|
| 23 |
+
qwen36 blob cleanup (step 7, was step 6) only runs after
|
| 24 |
+
validation passes, so a rollback always lands on a consistent
|
| 25 |
+
state (original manifest + original blob still present). Backup
|
| 26 |
+
is deleted on success.
|
| 27 |
+
|
| 28 |
## [0.6.0] - 2026-05-19 — `c336f44`
|
| 29 |
|
| 30 |
Headline changes since 0.5.0 (over a two-week burst on 2026-05-19):
|
|
@@ -135,6 +135,13 @@ trap - EXIT
|
|
| 135 |
|
| 136 |
# ---- 5. Rewrite the manifest's model layer ----------------------------------
|
| 137 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
TMP_MANIFEST="$(mktemp -t thanatos-heal-manifest.XXXXXX.json)"
|
| 139 |
trap 'rm -f "${TMP_MANIFEST}"' EXIT
|
| 140 |
jq --arg new "sha256:${NEW_HASH}" \
|
|
@@ -152,12 +159,34 @@ NEW_DIGEST_IN_MANIFEST="$(jq -r '
|
|
| 152 |
' "${TMP_MANIFEST}")"
|
| 153 |
if [[ "${NEW_DIGEST_IN_MANIFEST}" != "sha256:${NEW_HASH}" ]]; then
|
| 154 |
red "[!] manifest rewrite failed (digest mismatch); not committing."
|
|
|
|
| 155 |
exit 1
|
| 156 |
fi
|
| 157 |
mv "${TMP_MANIFEST}" "${MANIFEST}"
|
| 158 |
trap - EXIT
|
| 159 |
|
| 160 |
-
# ---- 6.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
OLD_DIGEST="sha256:${MODEL_HASH}"
|
| 163 |
if ! grep -rlF -- "${OLD_DIGEST}" "${OLLAMA_MODELS}/manifests/" >/dev/null 2>&1; then
|
|
|
|
| 135 |
|
| 136 |
# ---- 5. Rewrite the manifest's model layer ----------------------------------
|
| 137 |
|
| 138 |
+
# Keep a sidecar copy of the original manifest so we can roll back if
|
| 139 |
+
# `ollama show` rejects the rewrite. The blob cleanup in step 7 only
|
| 140 |
+
# happens AFTER validation passes, so a rollback always lands on a
|
| 141 |
+
# consistent (original manifest, original blob still present) state.
|
| 142 |
+
BACKUP_MANIFEST="${MANIFEST}.heal-backup"
|
| 143 |
+
cp "${MANIFEST}" "${BACKUP_MANIFEST}"
|
| 144 |
+
|
| 145 |
TMP_MANIFEST="$(mktemp -t thanatos-heal-manifest.XXXXXX.json)"
|
| 146 |
trap 'rm -f "${TMP_MANIFEST}"' EXIT
|
| 147 |
jq --arg new "sha256:${NEW_HASH}" \
|
|
|
|
| 159 |
' "${TMP_MANIFEST}")"
|
| 160 |
if [[ "${NEW_DIGEST_IN_MANIFEST}" != "sha256:${NEW_HASH}" ]]; then
|
| 161 |
red "[!] manifest rewrite failed (digest mismatch); not committing."
|
| 162 |
+
rm -f "${BACKUP_MANIFEST}"
|
| 163 |
exit 1
|
| 164 |
fi
|
| 165 |
mv "${TMP_MANIFEST}" "${MANIFEST}"
|
| 166 |
trap - EXIT
|
| 167 |
|
| 168 |
+
# ---- 6. Validate the rewritten manifest via ollama show ---------------------
|
| 169 |
+
|
| 170 |
+
# `ollama show` parses the manifest, walks the layer digests, and reads
|
| 171 |
+
# enough of the model blob to extract metadata (arch, params, etc.).
|
| 172 |
+
# A buggy rewrite that produces jq-accepted JSON but breaks an ollama
|
| 173 |
+
# invariant (layer order, mediaType set, digest-vs-blob-bytes
|
| 174 |
+
# mismatch) trips here, before we lose the rollback path by removing
|
| 175 |
+
# the old qwen36 blob. On failure we restore from BACKUP_MANIFEST.
|
| 176 |
+
blue "[*] validating rewritten manifest with 'ollama show'..."
|
| 177 |
+
if ! ollama show "${TAG}" >/dev/null 2>&1; then
|
| 178 |
+
red "[!] ollama show ${TAG} failed after the manifest rewrite."
|
| 179 |
+
blue "[*] rolling back: restoring original manifest from ${BACKUP_MANIFEST}"
|
| 180 |
+
mv "${BACKUP_MANIFEST}" "${MANIFEST}"
|
| 181 |
+
red " Tag is back to its pre-heal (qwen36) state. The new qwen35"
|
| 182 |
+
red " blob is left in the store; ollama auto-prunes unreferenced"
|
| 183 |
+
red " blobs on next restart."
|
| 184 |
+
exit 1
|
| 185 |
+
fi
|
| 186 |
+
rm -f "${BACKUP_MANIFEST}"
|
| 187 |
+
green "[+] manifest validates."
|
| 188 |
+
|
| 189 |
+
# ---- 7. Remove the old qwen36 blob if no other manifest references it -------
|
| 190 |
|
| 191 |
OLD_DIGEST="sha256:${MODEL_HASH}"
|
| 192 |
if ! grep -rlF -- "${OLD_DIGEST}" "${OLLAMA_MODELS}/manifests/" >/dev/null 2>&1; then
|