Instructions to use 4rc4n4/qwen-3-4b-guru with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use 4rc4n4/qwen-3-4b-guru with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="4rc4n4/qwen-3-4b-guru")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("4rc4n4/qwen-3-4b-guru", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use 4rc4n4/qwen-3-4b-guru 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 4rc4n4/qwen-3-4b-guru:F16 # Run inference directly in the terminal: llama cli -hf 4rc4n4/qwen-3-4b-guru:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf 4rc4n4/qwen-3-4b-guru:F16 # Run inference directly in the terminal: llama cli -hf 4rc4n4/qwen-3-4b-guru:F16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf 4rc4n4/qwen-3-4b-guru:F16 # Run inference directly in the terminal: ./build/bin/llama cli -hf 4rc4n4/qwen-3-4b-guru:F16
Use Docker
docker model run hf.co/4rc4n4/qwen-3-4b-guru:F16
- Llama new
- LM Studio
- Jan
- vLLM
How to use 4rc4n4/qwen-3-4b-guru with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "4rc4n4/qwen-3-4b-guru" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "4rc4n4/qwen-3-4b-guru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/4rc4n4/qwen-3-4b-guru:F16
- SGLang
How to use 4rc4n4/qwen-3-4b-guru 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 "4rc4n4/qwen-3-4b-guru" \ --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": "4rc4n4/qwen-3-4b-guru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "4rc4n4/qwen-3-4b-guru" \ --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": "4rc4n4/qwen-3-4b-guru", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use 4rc4n4/qwen-3-4b-guru with Ollama:
ollama run hf.co/4rc4n4/qwen-3-4b-guru:F16
- Unsloth Desktop
- Pi
How to use 4rc4n4/qwen-3-4b-guru with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 4rc4n4/qwen-3-4b-guru:F16
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": "4rc4n4/qwen-3-4b-guru:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use 4rc4n4/qwen-3-4b-guru with Docker Model Runner:
docker model run hf.co/4rc4n4/qwen-3-4b-guru:F16
- Lemonade
How to use 4rc4n4/qwen-3-4b-guru with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull 4rc4n4/qwen-3-4b-guru:F16
Run and chat with the model
lemonade run user.qwen-3-4b-guru-F16
List all available models
lemonade list
- Hermes Agent
How to use 4rc4n4/qwen-3-4b-guru with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 4rc4n4/qwen-3-4b-guru:F16
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 4rc4n4/qwen-3-4b-guru:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use 4rc4n4/qwen-3-4b-guru with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf 4rc4n4/qwen-3-4b-guru:F16
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 "4rc4n4/qwen-3-4b-guru:F16" \ --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"
qwen-3-4b-guru
A fast chunkโconcept tagger for the guru comparative-religion indexing pipeline. Fine-tuned from Qwen3-4B-Instruct-2507 on (passage, tag-set) pairs โ teacher labels from a 27B model, refined by human review โ this model scores passages from mystical texts against guru's concept taxonomy.
v5 (current). Trains natively on the full, live 154-concept taxonomy at 16,384 context. Its purpose is cross-tradition backfill: the taxonomy grew by 44 concepts after v3, and older works โ tagged before those concepts existed โ needed the new vocabulary applied where it genuinely fits (e.g. incarnation on a Hindu avatฤra passage, divine_immanence on Neoplatonic and Taoist text). v4 (internal-only, never published โ like v2) learned the new concepts only in their modern Western-esoteric flavour because it had zero cross-tradition training examples of them; v5 fixes this by folding in a reviewed 27B sample-pass over older traditions, so the applied cross-tradition tags become training positives. The v5 export is applied-tags-only (owner-accepted labels, deduped one tag per (chunk, concept)). Result: v5 beats v4 on held-out tagging and recovers the backfill v4 could not โ see Evaluation. v1/v3 were published under the qwen-3-4b-guru-v1 / -v3 tags; v2 and v4 were internal-only. This release met no formal ship gates (none were set); see Limitations for exactly what was and wasn't measured.
What it does
Given a passage and a list of candidate concepts (each {id, definition}), the model returns a JSON array rating every present concept 0โ3 (0=absent โฆ 3=central theme); concepts scoring 0 are omitted. Output is strict JSON, no prose. The prompt contract matches the guru tagging caller exactly.
Evaluation
v5 benchmark: base vs v4 vs v5
Head-to-head on v5's held-out test split (223 chunks), all models given the full live 154-concept taxonomy in every prompt, graded against the owner-accepted (vetted) labels. Temperature 0 via llama-server, identical prompts.
vs accepted labels:
| model | precision | recall | F1 | macro-F1 | MAE | tags/chunk | OOT-IDs |
|---|---|---|---|---|---|---|---|
| base | 0.120 | 0.503 | 0.194 | 0.134 | 0.51 | 44.7 | 31 |
| v4 | 0.236 | 0.480 | 0.316 | 0.243 | 0.40 | 11.3 | 5 |
| v5 | 0.279 | 0.537 | 0.367 | 0.274 | 0.31 | 10.7 | 4 |
v5 improves on v4 across every axis โ precision, recall, F1 (+16% relative), lower error, fewer invented IDs โ while staying disciplined (base's higher raw recall is a "shotgun" artifact: 44.7 tags/chunk at precision 0.12).
Backfill probe (the point of v5). On 32 held-out older-tradition cells where one of the 12 backfill concepts is a vetted positive on a chunk the model never trained on, v5 surfaces the target at score โฅ2 on 19/32 cells versus v4's 3/32 โ recovering the cross-tradition capability v4 lacked, with discipline intact. Guards held: psychic_attack stayed silent on Kalevala runo-magic (routed to word_power_incantation), occult_police fired nowhere. Weak spots are the thinnest concepts (trinity, talisman_magic, spirit_conjuration), where too few older chunks were surfaced in the sample-pass. Full detail: v5 findings.
v3 benchmark: base vs v1 vs v2 vs v3
Head-to-head on v3's own held-out test split (181 chunks), all four models given the full live 110-concept taxonomy in every prompt (this is the capability delta v3 is meant to fix, so v1/v2 see it here for the first time โ v1/v2 trained on the pinned 88-concept fallback). Verified zero train/test leakage across all three fine-tunes under the chunk-hash split. All models at temperature 0 via llama-server, identical prompts.
vs teacher labels:
| model | precision | recall | F1 | macro-F1 | OOT-IDs | parse | latency |
|---|---|---|---|---|---|---|---|
| base | 0.291 | 0.515 | 0.372 | 0.264 | 15 | 100% | 17.9s |
| v1 | 0.407 | 0.534 | 0.462 | 0.317 | 8 | 100% | 7.7s |
| v2 | 0.390 | 0.514 | 0.443 | 0.315 | 1 | 100% | 11.0s |
| v3 | 0.439 | 0.545 | 0.486 | 0.331 | 2 | 100% | 9.3s |
vs human-graded labels: base 0.594 F1 (inflated โ a "shotgun" over-emission artifact, base emits 36.3 tags/chunk vs v3's 14.2, landing extra hits on ungraded cells for free), v1 0.537, v2 0.577, v3 0.589 โ v3 wins among the models with comparable emission counts. v1's worst blind spot, animism (F1 0.000 at n=36), is fixed in v3.
v3 is a genuine, measured improvement over both predecessors on every capability-normalized metric โ the taxonomy-loader fix, corpus quarantine, and full-context native training all paid off.
v1 original evaluation (historical, not comparable to the table above โ different test split, different corpus snapshot, 88-concept taxonomy)
Held-out test split (293 chunks the model never trained on), scored against both the 27B teacher's labels and independent human accept/reject verdicts.
| Model | Precision | Recall | F1 | Specificity |
|---|---|---|---|---|
| base | 0.682 | 0.550 | 0.609 | 0.590 |
| qwen-3-4b-guru-v1 | 0.710 | 0.571 | 0.633 | 0.626 |
| 27B teacher (reference) | 0.616 | 1.000* | 0.762* | 0.000 |
* The teacher's recall is 1.0 by construction โ humans only reviewed tags the teacher emitted โ so its precision (0.616) is the comparable number.
Training
- Base:
unsloth/Qwen3-4B-Instruct-2507-bnb-4bit - Method: QLoRA (TRL
SFTTrainervia Unsloth) - LoRA: r=32, ฮฑ=64, dropout 0, all attention + MLP projections
- Schedule: 3 epochs, batch 1 ร grad-accum 16, paged AdamW-8bit, lr 1.5e-4 cosine, warmup 0.03
- Sequence length: 16,384 (the 154-concept definitions block alone is ~11,439 tokens; 16,384 covers the full observed example-length range with zero examples dropped, and trains at 12.8 GB peak on a single 24 GB 3090 with flash-attn 2.8.3)
- Chat template: Qwen3 ChatML (
qwen3-instruct) - Checkpoint: best-by-val-loss, final step 753 (eval_loss 0.1788, improved monotonically through training โ no overfit)
- Hardware: single RTX 3090 (24 GB), ~29.4 h
- Seed: 42
Training data
Source: staged_tags from a guru.db snapshot, applied-tags-only โ owner-accepted (vetted) labels, deduped to one tag per (chunk, concept). Teacher signatures are 27B (Qwen3.5/Qwen3.8, an unreliable free-text label โ the export takes every non-student, non-Carnice teacher tag rather than allowlisting a signature).
- 4,440 examples / 25,402 tags, 154 concepts (the full live guru taxonomy โ domain โ family โ concept, three tiers)
- Splits by chunk_id: 4,008 train / 209 val / 223 test
- Includes the reviewed cross-tradition backfill positives for the 12 drift concepts (trinity, stellar_determinism, divine_immanence, initiation, divination, esoteric_lineage, exorcism, gender, spirit_conjuration, incarnation, qliphoth, talisman_magic)
The taxonomy this model expects is pinned in taxonomy.toml in this repo, matching guru's live taxonomy at training time.
Files
adapter/โ LoRA adapter (~260 MB); the canonical artifactmerged/โ adapter merged into base, FP16 (~8 GB)gguf/qwen-3-4b-guru-v5-Q4_K_M.ggufโ 4-bit, recommended for serving (also aliased asqwen-3-4b-guru-Q4_K_M.gguf)gguf/qwen-3-4b-guru-v5-F16.ggufโ full-precision conversiontaxonomy.tomlโ the 154-concept taxonomy (prompt contract)- Prior-version gguf (
-v3-) are retained ingguf/.
Usage
llama-server -m qwen-3-4b-guru-v5-Q4_K_M.gguf --jinja --port 8080
The guru tagging caller hits the OpenAI-compatible /v1/chat/completions endpoint. The model expects the exact prompt structure used at training time (system role + passage + 0โ3 rubric + JSON concept list); deviating degrades quality.
Limitations
- Exploratory release. No formal throughput benchmark and no quantization sweep were run; only Q4_K_M is provided and serving throughput at concurrency is unmeasured. Treat the eval as a sound point estimate, not a gated guarantee.
- Domain-locked. The corpus is heavily Mediterranean / Greek-philosophical; calibration on East-Asian, South-Asian, and indigenous traditions is weaker.
- Taxonomy-bound. Scoring is conditioned on the concept list in the prompt. Use the pinned
taxonomy.toml; if guru's live taxonomy drifts meaningfully from this snapshot, retrain. - Thin cross-tradition concepts. The backfill recovers most drift concepts on older traditions, but the thinnest (trinity, talisman_magic, spirit_conjuration) had too few older chunks surfaced in the 27B sample-pass and are under-tagged on held-out cells; a larger sample-pass would close them.
- Label provenance. v5 trains on owner-accepted labels only (a shift from prior versions, which included unreviewed teacher tags). Accepted labels are vetted but the teacher's tendencies still shape which tags were proposed for review in the first place.
- Not a chat model. Tuned on a single task and prompt format.
License
Apache 2.0
- Downloads last month
- 26
4-bit
16-bit
Model tree for 4rc4n4/qwen-3-4b-guru
Base model
Qwen/Qwen3-4B-Instruct-2507