Instructions to use CloudGoat/Baphomet-1.0-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use CloudGoat/Baphomet-1.0-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="CloudGoat/Baphomet-1.0-4B") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("CloudGoat/Baphomet-1.0-4B") model = AutoModelForMultimodalLM.from_pretrained("CloudGoat/Baphomet-1.0-4B", device_map="auto") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use CloudGoat/Baphomet-1.0-4B with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf CloudGoat/Baphomet-1.0-4B:Q8_0 # Run inference directly in the terminal: llama cli -hf CloudGoat/Baphomet-1.0-4B:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf CloudGoat/Baphomet-1.0-4B:Q8_0 # Run inference directly in the terminal: llama cli -hf CloudGoat/Baphomet-1.0-4B:Q8_0
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 CloudGoat/Baphomet-1.0-4B:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf CloudGoat/Baphomet-1.0-4B:Q8_0
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 CloudGoat/Baphomet-1.0-4B:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf CloudGoat/Baphomet-1.0-4B:Q8_0
Use Docker
docker model run hf.co/CloudGoat/Baphomet-1.0-4B:Q8_0
- LM Studio
- Jan
- vLLM
How to use CloudGoat/Baphomet-1.0-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CloudGoat/Baphomet-1.0-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CloudGoat/Baphomet-1.0-4B", "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/CloudGoat/Baphomet-1.0-4B:Q8_0
- SGLang
How to use CloudGoat/Baphomet-1.0-4B 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 "CloudGoat/Baphomet-1.0-4B" \ --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": "CloudGoat/Baphomet-1.0-4B", "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 "CloudGoat/Baphomet-1.0-4B" \ --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": "CloudGoat/Baphomet-1.0-4B", "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 CloudGoat/Baphomet-1.0-4B with Ollama:
ollama run hf.co/CloudGoat/Baphomet-1.0-4B:Q8_0
- Unsloth Desktop
- Pi
How to use CloudGoat/Baphomet-1.0-4B with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CloudGoat/Baphomet-1.0-4B:Q8_0
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "CloudGoat/Baphomet-1.0-4B:Q8_0" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use CloudGoat/Baphomet-1.0-4B with Docker Model Runner:
docker model run hf.co/CloudGoat/Baphomet-1.0-4B:Q8_0
- Lemonade
How to use CloudGoat/Baphomet-1.0-4B with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull CloudGoat/Baphomet-1.0-4B:Q8_0
Run and chat with the model
lemonade run user.Baphomet-1.0-4B-Q8_0
List all available models
lemonade list
- Hermes Agent
How to use CloudGoat/Baphomet-1.0-4B with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CloudGoat/Baphomet-1.0-4B:Q8_0
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 CloudGoat/Baphomet-1.0-4B:Q8_0
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use CloudGoat/Baphomet-1.0-4B with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf CloudGoat/Baphomet-1.0-4B:Q8_0
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "CloudGoat/Baphomet-1.0-4B:Q8_0" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
| Base | Method | Task-Vectors | Output |
|---|---|---|---|
Qwen/Qwen3.5-4B |
linear (goatmerge) |
8 vectors, 0.1375 each | safetensors ×10, Q8_0 GGUF |
1. Overview
Baphomet-1.0-4B is a model produced by linearly combining 8 task-vectors (T = W_donor − W_base) into the base model Qwen/Qwen3.5-4B.
According to a 2025 paper (hitit et al., 2025) on model merging, pure Task Arithmetic is the only method that consistently improves performance across "in-the-wild" models. Based on that paper, I merged high-quality community fine-tuned versions of Qwen3.5-4B.
W_merged = W_base + Σ αᵢ · Tᵢ (αᵢ = 0.1375)
The configured weights sum to 0.1375 × 8 = 1.10. According to goatmerge.json, normalize: true, rescale: true are enabled, so normalized coefficients are applied. Refer to the goatmerge implementation for the exact computation.
No claim is made about improved performance or inheritance of specific capabilities. No quantitative evaluation has been performed.
2. Merge configuration
2.1 Base model and settings
| Item | Value |
|---|---|
| Base | Qwen/Qwen3.5-4B |
| Base fingerprint | 62de7a218d003afe6dffca82532c20150488b68ec629e72f9b50a0615dd7c8c5 |
| Tool | goatmerge (format v1.1.0) |
| Method | linear, density=1.0, normalize=true, rescale=true |
| Chunk | 8388608 elements, drop_caches=true |
2.2 Task-vector list (α = 0.1375 each)
The table below transcribes the extraction source (source_model) recorded in each TV's goatmerge.json. No statement of effect is made.
| # | Task-vector | Recorded source_model |
|---|---|---|
| 1 | Agents-A1-4B-TV |
InternScience/Agents-A1-4B |
| 2 | DeepSeek-V4-Pro-Qwen3.5-4B-TV |
Jackrong/DeepSeek-V4-Pro-Qwen3.5-4B |
| 3 | Qwen3.8-4B-Distill-TV |
empero-ai/Qwen3.8-4B-Distill |
| 4 | Qwopus3.5-4B-Coder-TV |
Jackrong/Qwopus3.5-4B-Coder |
| 5 | Qwopus3.5-4B-v3-TV |
Jackrong/Qwopus3.5-4B-v3 |
| 6 | AREX-Turbo-TV |
BAAI/AREX-Turbo |
| 7 | NeoHorse-1-4B-TV |
NeoHorse-1-4B-Aligned (key-converted TokenRhythm/NeoHorse-1-4B) |
| 8 | tmax-4B-TV |
allenai/tmax-4b |
recipe.yaml (for reproduction)
base: Qwen/Qwen3.5-4B
out: ./Baphomet-1.0-4B-k8
merge_method: linear
chunk_elements: 8388608
drop_caches: true
skip_fingerprint_check: false
tv:
- dir: ./Task-Vectors/Agents-A1-4B-TV
weight: 0.1375
- dir: ./Task-Vectors/DeepSeek-V4-Pro-Qwen3.5-4B-TV
weight: 0.1375
- dir: ./Task-Vectors/Qwen3.8-4B-Distill-TV
weight: 0.1375
- dir: ./Task-Vectors/Qwopus3.5-4B-Coder-TV
weight: 0.1375
- dir: ./Task-Vectors/Qwopus3.5-4B-v3-TV
weight: 0.1375
- dir: ./Task-Vectors/AREX-Turbo-TV
weight: 0.1375
- dir: ./Task-Vectors/NeoHorse-1-4B-TV
weight: 0.1375
- dir: ./Task-Vectors/tmax-4B-TV
weight: 0.1375
Note: NeoHorse-1-4B uses a text-only key layout, so its keys were converted from model.* to model.language_model.* with align_neohorse.py before extraction. See Section 5 of the parent directory README for details.
3. Model specifications
Excerpt from config.json.
| Item | Value |
|---|---|
| Architecture | Qwen3_5ForConditionalGeneration |
| Text layers | 32 layers, hidden size 2560, heads 16Q / 4KV (GQA), head_dim 256 |
| Attention layer types | Repeating pattern of 3 linear_attention layers followed by 1 full_attention layer |
| FFN | intermediate 9216, SiLU, tie_word_embeddings: true |
| Vocabulary size | 248,320 (Qwen2Tokenizer, BPE) |
| Context length | 262,144 (RoPE θ=10000000, interleaved M-RoPE) |
| Vision | hidden size 1024, 24 layers, patch_size 16, spatial_merge_size 2, temporal_patch_size 2 |
| Special tokens | `< |
| Dtype | bfloat16 (safetensors) |
4. Included files
| File | Size | Description |
|---|---|---|
model-00001-of-00010.safetensors through model-00010… |
Approx. 8.9GB total | Model weights (bf16, 10 shards) |
model.safetensors.index.json |
66KB | Shard index |
Baphomet-1.0-4B-q8_0.gguf |
4.2GB | Q8_0 quantization for llama.cpp |
config.json |
3.1KB | Model configuration |
tokenizer.json / vocab.json / merges.txt |
13MB / 6.5MB / 3.2MB | Tokenizer |
tokenizer_config.json / chat_template.jinja |
17KB / 7.6KB | Chat template |
preprocessor_config.json |
390B | Qwen3VLProcessor configuration |
goatmerge.json |
1.6KB | Merge provenance (fingerprint, TV list) |
5. Usage
5.1 Transformers (safetensors)
from transformers import AutoModelForVision2Seq, AutoProcessor
model_id = "Baphomet-1.0-4B" # Replace with a local path or repository name
model = AutoModelForVision2Seq.from_pretrained(
model_id,
dtype="auto",
device_map="auto",
trust_remote_code=True,
)
processor = AutoProcessor.from_pretrained(model_id, trust_remote_code=True)
messages = [
{"role": "user", "content": [
{"type": "image", "image": "https://example.com/cat.png"},
{"type": "text", "text": "Describe this image in English."},
]},
]
inputs = processor.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=512)
print(processor.decode(out[0], skip_special_tokens=False))
5.2 llama.cpp (GGUF)
# Interactive chat
llama-cli -m Baphomet-1.0-4B-q8_0.gguf -cnv -c 8192
# Server mode
llama-server -m Baphomet-1.0-4B-q8_0.gguf -c 32768 --port 8080
5.3 vLLM
vllm serve ./Baphomet-1.0-4B-k8 --max-model-len 32768 --trust-remote-code
Chat format example
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Write a parallel downloader in Rust<|im_end|>
<|im_start|>assistant
<think>
Organizing the requirements…
</think>
```rust
// code here
```<|im_end|>
Tool calls may be emitted in <tool_call><function=…> form and reasoning in <think>…</think>. Refer to chat_template.jinja for the exact format.
6. Benchmark
| Suite | Condition | Base (Qwen/Qwen3.5-4B) |
Baphomet-1.0-4B | Notes |
|---|---|---|---|---|
| TBD | Same prompts and settings as base | TBD | TBD | To be recorded with harness version, seed, and date |
| TBD | Same prompts and settings as base | TBD | TBD | To be recorded with harness version, seed, and date |
Results, when available, will be recorded here with the evaluation date, harness and dataset versions, sampling parameters, and number of runs. The base model will be evaluated under identical conditions for comparison.
7. Limitations
- The model is the result of a linear merge; there is no guarantee that characteristics of individual donor models are preserved.
- It may inherit the license terms and biases of each donor and the base model. Determine the scope of use after reviewing the license of each model.
- Benchmark evaluation is in progress (see Section 6). No results are reported yet, and no performance claims are made.
- Use for final decisions in high-risk domains such as medical or legal matters is not intended.
8. Credits
| Role | Model |
|---|---|
| Base | Qwen/Qwen3.5-4B |
| Donors | InternScience/Agents-A1-4B, Jackrong/DeepSeek-V4-Pro-Qwen3.5-4B, empero-ai/Qwen3.8-4B-Distill, Jackrong/Qwopus3.5-4B-Coder, Jackrong/Qwopus3.5-4B-v3, BAAI/AREX-Turbo, TokenRhythm/NeoHorse-1-4B, allenai/tmax-4b |
| Merge tool | GoatMerge |
| References | O. K. Hitit, C. Sankar, Y. K. Kim, A. Risteski, and A. Elgohary, "A systematic study of in-the-wild model merging for large language models," arXiv preprint arXiv:2511.21437, 2025. |
- Downloads last month
- -