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 Settings
- 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
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
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
Sync README, CHANGELOG, transformers example with config.json drop
Browse files5302d10 removed config.json (to suppress HF's qwen3_5 auto-tag) but
left three docs claiming it was still present:
- README "What's here" table listed config.json
- README transformers paragraph claimed from_pretrained works directly
- examples/transformers_quickstart.py loaded MODEL_ID with no config
Update README table + transformers note to explain the drop and show
a two-step load (AutoConfig from upstream Qwen/Qwen3.6-27B, weights
from this repo β tensors are byte-identical). Switch the example to
match. Add a CHANGELOG entry under Unreleased.
- CHANGELOG.md +25 -7
- README.md +22 -8
- examples/transformers_quickstart.py +12 -5
|
@@ -7,23 +7,41 @@ and documentation**, not the underlying base model.
|
|
| 7 |
|
| 8 |
## [Unreleased]
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
### Added (safetensors mirror)
|
| 11 |
- **Mirrored Qwen/Qwen3.6-27B's transformers-loadable safetensors
|
| 12 |
set into this repo.** 15 sharded `.safetensors` files (~58 GB
|
| 13 |
total) + `model.safetensors.index.json` + tokenizer files
|
| 14 |
(`tokenizer.json`, `tokenizer_config.json`, `vocab.json`,
|
| 15 |
-
`merges.txt`) + configs (`
|
| 16 |
`generation_config.json`, `preprocessor_config.json`,
|
| 17 |
`video_preprocessor_config.json`) + `chat_template.jinja`.
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
| 21 |
`0c5bee4`) to whitelist the Qwen sharded naming pattern before
|
| 22 |
the upload's preupload check ran (HF reads the destination
|
| 23 |
repo's `.gitignore` to decide `shouldIgnore` per file).
|
| 24 |
-
- `examples/transformers_quickstart.py`
|
| 25 |
-
to `FoolDev/Thanatos-27B`
|
| 26 |
-
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
### Changed (5th round trip β qwen36 β qwen35, retested next-day)
|
| 29 |
- **Bundle re-stamped `general.architecture: 'qwen36'` β `'qwen35'`**
|
|
|
|
| 7 |
|
| 8 |
## [Unreleased]
|
| 9 |
|
| 10 |
+
### Removed (transformers config)
|
| 11 |
+
- **Dropped `config.json`** (`5302d10`) to suppress HF's tag
|
| 12 |
+
auto-detector surfacing `qwen3_5` in the repo header β the
|
| 13 |
+
detector reads `architectures` from `config.json` and the
|
| 14 |
+
surfaced tag was obscuring this card's positioning.
|
| 15 |
+
Consequence: `AutoModelForCausalLM.from_pretrained(
|
| 16 |
+
"FoolDev/Thanatos-27B")` no longer works on its own.
|
| 17 |
+
`examples/transformers_quickstart.py` now pulls `AutoConfig`
|
| 18 |
+
from upstream `Qwen/Qwen3.6-27B` (byte-identical tensors,
|
| 19 |
+
so no behavioural difference) and weights + tokenizer +
|
| 20 |
+
chat template from this repo. README's "What's here"
|
| 21 |
+
table and transformers paragraph updated to match.
|
| 22 |
+
|
| 23 |
### Added (safetensors mirror)
|
| 24 |
- **Mirrored Qwen/Qwen3.6-27B's transformers-loadable safetensors
|
| 25 |
set into this repo.** 15 sharded `.safetensors` files (~58 GB
|
| 26 |
total) + `model.safetensors.index.json` + tokenizer files
|
| 27 |
(`tokenizer.json`, `tokenizer_config.json`, `vocab.json`,
|
| 28 |
+
`merges.txt`) + configs (`configuration.json`,
|
| 29 |
`generation_config.json`, `preprocessor_config.json`,
|
| 30 |
`video_preprocessor_config.json`) + `chat_template.jinja`.
|
| 31 |
+
(`config.json` was initially mirrored too, then dropped β see
|
| 32 |
+
"Removed (transformers config)" above.) Tensor data
|
| 33 |
+
byte-identical to upstream; the mirror saves a second
|
| 34 |
+
`hf download` for users who want both GGUF + safetensors in
|
| 35 |
+
one place. `.gitignore` was updated separately (commit
|
| 36 |
`0c5bee4`) to whitelist the Qwen sharded naming pattern before
|
| 37 |
the upload's preupload check ran (HF reads the destination
|
| 38 |
repo's `.gitignore` to decide `shouldIgnore` per file).
|
| 39 |
+
- `examples/transformers_quickstart.py` defaults `MODEL_ID`
|
| 40 |
+
to `FoolDev/Thanatos-27B` (weights + tokenizer + chat
|
| 41 |
+
template) with `CONFIG_ID="Qwen/Qwen3.6-27B"` for the
|
| 42 |
+
architecture config β fresh users still need only this
|
| 43 |
+
repo as the entry point, with one auxiliary HF Hub pull
|
| 44 |
+
for `config.json` that transformers handles transparently.
|
| 45 |
|
| 46 |
### Changed (5th round trip β qwen36 β qwen35, retested next-day)
|
| 47 |
- **Bundle re-stamped `general.architecture: 'qwen36'` β `'qwen35'`**
|
|
@@ -126,7 +126,7 @@ The 27B is **dense**: every parameter participates in every forward pass. It's s
|
|
| 126 |
| `scripts/install-hooks.sh` | Installs `check.sh` as a git pre-commit hook |
|
| 127 |
| `Makefile` | Convenience wrapper β `make help` lists targets |
|
| 128 |
| `model-*-of-00015.safetensors` (15 files, ~58 GB) + `model.safetensors.index.json` | Transformers-loadable safetensors mirror of `Qwen/Qwen3.6-27B`. Byte-identical to upstream. |
|
| 129 |
-
| `
|
| 130 |
| `tokenizer.json`, `tokenizer_config.json`, `vocab.json`, `merges.txt` | Tokenizer files mirrored from upstream. |
|
| 131 |
| `LICENSE`, `CITATION.cff` | Apache-2.0 license and citation metadata |
|
| 132 |
| `CHANGELOG.md` | Versioned tooling/docs changes |
|
|
@@ -142,13 +142,27 @@ path applies the root-level `template`, `system`, and `params`
|
|
| 142 |
files (kept in sync with the `Modelfile`).
|
| 143 |
|
| 144 |
The transformers safetensors set is mirrored in this repo
|
| 145 |
-
(15 sharded `.safetensors` files + index + tokenizer +
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
## Architecture
|
| 154 |
|
|
|
|
| 126 |
| `scripts/install-hooks.sh` | Installs `check.sh` as a git pre-commit hook |
|
| 127 |
| `Makefile` | Convenience wrapper β `make help` lists targets |
|
| 128 |
| `model-*-of-00015.safetensors` (15 files, ~58 GB) + `model.safetensors.index.json` | Transformers-loadable safetensors mirror of `Qwen/Qwen3.6-27B`. Byte-identical to upstream. |
|
| 129 |
+
| `configuration.json`, `generation_config.json`, `preprocessor_config.json`, `video_preprocessor_config.json`, `chat_template.jinja` | Processor + chat-template configs mirrored from upstream. **`config.json` is intentionally not in this repo** β HF's tag auto-detector reads `architectures` from it and surfaces `qwen3_5` in the repo header, which obscures this repo's positioning. Transformers users: pull `config.json` from [`Qwen/Qwen3.6-27B`](https://huggingface.co/Qwen/Qwen3.6-27B) (see Transformers note below). |
|
| 130 |
| `tokenizer.json`, `tokenizer_config.json`, `vocab.json`, `merges.txt` | Tokenizer files mirrored from upstream. |
|
| 131 |
| `LICENSE`, `CITATION.cff` | Apache-2.0 license and citation metadata |
|
| 132 |
| `CHANGELOG.md` | Versioned tooling/docs changes |
|
|
|
|
| 142 |
files (kept in sync with the `Modelfile`).
|
| 143 |
|
| 144 |
The transformers safetensors set is mirrored in this repo
|
| 145 |
+
(15 sharded `.safetensors` files + index + tokenizer +
|
| 146 |
+
chat template), byte-identical to upstream
|
| 147 |
+
[`Qwen/Qwen3.6-27B`](https://huggingface.co/Qwen/Qwen3.6-27B).
|
| 148 |
+
**`config.json` is not bundled here** β HF auto-detects model
|
| 149 |
+
architecture from it and surfaces a `qwen3_5` repo-level tag
|
| 150 |
+
that obscures this card. To load via transformers, either:
|
| 151 |
+
|
| 152 |
+
```python
|
| 153 |
+
# A. Use upstream as the config/architecture source, this repo for weights:
|
| 154 |
+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
|
| 155 |
+
cfg = AutoConfig.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)
|
| 156 |
+
tok = AutoTokenizer.from_pretrained("FoolDev/Thanatos-27B", trust_remote_code=True)
|
| 157 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 158 |
+
"FoolDev/Thanatos-27B", config=cfg, trust_remote_code=True,
|
| 159 |
+
)
|
| 160 |
+
|
| 161 |
+
# B. Or just load upstream directly β tensors are byte-identical:
|
| 162 |
+
model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.6-27B", trust_remote_code=True)
|
| 163 |
+
```
|
| 164 |
+
|
| 165 |
+
`examples/transformers_quickstart.py` uses path A.
|
| 166 |
|
| 167 |
## Architecture
|
| 168 |
|
|
@@ -7,9 +7,12 @@ mirror of Qwen/Qwen3.6-27B's transformers set) and runs a single
|
|
| 7 |
chat turn using its embedded chat template. Applies the same
|
| 8 |
Thanatos system prompt the Modelfile / bridge `system` file uses.
|
| 9 |
|
| 10 |
-
`
|
| 11 |
-
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
Requirements:
|
| 15 |
pip install --upgrade "transformers>=4.45" accelerate sentencepiece bitsandbytes
|
|
@@ -31,7 +34,7 @@ import sys
|
|
| 31 |
|
| 32 |
try:
|
| 33 |
import torch
|
| 34 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 35 |
except ImportError as e: # pragma: no cover
|
| 36 |
sys.exit(
|
| 37 |
f"Missing dependency: {e.name}. Install with:\n"
|
|
@@ -40,6 +43,7 @@ except ImportError as e: # pragma: no cover
|
|
| 40 |
|
| 41 |
|
| 42 |
MODEL_ID = "FoolDev/Thanatos-27B"
|
|
|
|
| 43 |
|
| 44 |
THANATOS_SYSTEM = (
|
| 45 |
"You are Thanatos, a precise and capable assistant for reasoning, writing, "
|
|
@@ -71,8 +75,11 @@ def load(use_4bit: bool):
|
|
| 71 |
)
|
| 72 |
kwargs.pop("torch_dtype", None)
|
| 73 |
|
|
|
|
| 74 |
tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 75 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
| 76 |
return tok, model
|
| 77 |
|
| 78 |
|
|
|
|
| 7 |
chat turn using its embedded chat template. Applies the same
|
| 8 |
Thanatos system prompt the Modelfile / bridge `system` file uses.
|
| 9 |
|
| 10 |
+
`config.json` is intentionally not in this repo (it makes HF's tag
|
| 11 |
+
auto-detector surface a `qwen3_5` repo-level tag), so we source the
|
| 12 |
+
architecture config from upstream `Qwen/Qwen3.6-27B` and only pull
|
| 13 |
+
weights + tokenizer + chat template from this repo. Tensor data is
|
| 14 |
+
byte-identical, so the result is the same model. Set
|
| 15 |
+
`MODEL_ID = "Qwen/Qwen3.6-27B"` to bypass this repo entirely.
|
| 16 |
|
| 17 |
Requirements:
|
| 18 |
pip install --upgrade "transformers>=4.45" accelerate sentencepiece bitsandbytes
|
|
|
|
| 34 |
|
| 35 |
try:
|
| 36 |
import torch
|
| 37 |
+
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer
|
| 38 |
except ImportError as e: # pragma: no cover
|
| 39 |
sys.exit(
|
| 40 |
f"Missing dependency: {e.name}. Install with:\n"
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
MODEL_ID = "FoolDev/Thanatos-27B"
|
| 46 |
+
CONFIG_ID = "Qwen/Qwen3.6-27B" # source of config.json (not bundled in MODEL_ID β see module docstring)
|
| 47 |
|
| 48 |
THANATOS_SYSTEM = (
|
| 49 |
"You are Thanatos, a precise and capable assistant for reasoning, writing, "
|
|
|
|
| 75 |
)
|
| 76 |
kwargs.pop("torch_dtype", None)
|
| 77 |
|
| 78 |
+
cfg = AutoConfig.from_pretrained(CONFIG_ID, trust_remote_code=True)
|
| 79 |
tok = AutoTokenizer.from_pretrained(MODEL_ID, trust_remote_code=True)
|
| 80 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 81 |
+
MODEL_ID, config=cfg, trust_remote_code=True, **kwargs,
|
| 82 |
+
)
|
| 83 |
return tok, model
|
| 84 |
|
| 85 |
|