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") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("4rc4n4/qwen-3-4b-guru", dtype="auto") - llama-cpp-python
How to use 4rc4n4/qwen-3-4b-guru with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="4rc4n4/qwen-3-4b-guru", filename="gguf/qwen-3-4b-guru-F16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use 4rc4n4/qwen-3-4b-guru with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -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-server -hf 4rc4n4/qwen-3-4b-guru:F16 # Run inference directly in the terminal: llama-cli -hf 4rc4n4/qwen-3-4b-guru:F16
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 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/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 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
- 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 Studio
How to use 4rc4n4/qwen-3-4b-guru 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 4rc4n4/qwen-3-4b-guru 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 4rc4n4/qwen-3-4b-guru to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for 4rc4n4/qwen-3-4b-guru to start chatting
- 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-server -hf 4rc4n4/qwen-3-4b-guru:F16
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": "4rc4n4/qwen-3-4b-guru:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
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-server -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
- 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
qwen-3-4b-guru
A fast chunkโconcept tagger for the guru comparative-religion indexing pipeline. Fine-tuned from Qwen3-4B-Instruct-2507 on 2,808 (passage, tag-set) pairs โ teacher labels from a 27B model, refined by human review โ this model scores passages from mystical texts against a curated 88-concept taxonomy.
Exploratory v1. This release was built to test Qwen3-4B as a faster replacement for the bulk-tagging step. It met no formal ship gates (none were set); see Evaluation and 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
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. base = Qwen3-4B-Instruct-2507 with no fine-tuning. Both at temperature 0 via llama-server, identical prompts.
vs human-graded labels (1,990 graded cells)
Strongest signal โ human verdicts are an independent ground truth.
| Model | Precision | Recall | F1 | Specificity |
|---|---|---|---|---|
| base | 0.682 | 0.550 | 0.609 | 0.590 |
| qwen-3-4b-guru | 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. This model's precision (0.710) clears it.
vs teacher labels
| Model | Precision | Recall | F1 | Macro-F1 | Parse rate | OOT-IDs | tags/chunk | Lat (s) |
|---|---|---|---|---|---|---|---|---|
| base | 0.345 | 0.561 | 0.427 | 0.293 | 94.9% | 18 | 27.6 | 13.9 |
| qwen-3-4b-guru | 0.557 | 0.614 | 0.584 | 0.432 | 99.7% | 1 | 12.5 | 5.3 |
The fine-tune's main effect is calibration, reliability, and speed: the base model massively over-tags (27.6 concepts/chunk, 18 invented IDs, 94.9% parse, 13.9 s) while this model is disciplined (12.5 concepts/chunk, 1 invented ID, 99.7% parse, 5.3 s โ ~2.6ร faster). It modestly improves on the base against human truth too (F1 0.609 โ 0.633).
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: 6144 (8192 OOM'd on a 24 GB 3090 โ the loss logits are
seq_len ร 151,936 vocab; 6144 fits and drops only ~5% of examples) - Chat template: Qwen3 ChatML (
qwen3-instruct) - Checkpoint: best-by-val-loss (eval_loss 0.3421)
- Hardware / wall-clock: single RTX 3090 / ~18 h
- Seed: 42
Training data
Source: staged_tags from a guru.db snapshot, teacher Qwen3.5-27B-UD-Q4_K_XL.gguf, prompt version v1, status โ {pending, accepted} (human-rejected tags dropped).
- 2,808 chunks, 88 concepts, 25,893 target tags (47% human-accepted, rest unreviewed teacher labels, 0 rejected)
- Splits 80/10/10 by chunk_id (2,245 / 270 / 293); 111 train chunks (4.9%) dropped for exceeding 6144 tokens
The 88-concept taxonomy this model expects is pinned in taxonomy.toml in this repo. (The upstream guru taxonomy has since migrated to a three-tier hierarchy; this model's contract is the flat 88-concept version it trained on.)
Files
adapter/โ LoRA adapter (~260 MB); the canonical artifactmerged/โ adapter merged into base, FP16 (~8 GB)gguf/qwen-3-4b-guru-Q4_K_M.ggufโ 4-bit, ~2.5 GB, recommended for servinggguf/qwen-3-4b-guru-F16.ggufโ full-precision conversiontaxonomy.tomlโ the 88-concept taxonomy (prompt contract)
Usage
llama-server -m qwen-3-4b-guru-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 88-concept list in the prompt. Use the pinned
taxonomy.toml; if you change the taxonomy meaningfully, retrain. - Label noise. ~53% of training targets are unreviewed teacher labels, so the model inherits some of the teacher's tagging tendencies on un-reviewed concepts.
- Not a chat model. Tuned on a single task and prompt format.
License
Apache 2.0
- Downloads last month
- 34
4-bit
16-bit
Model tree for 4rc4n4/qwen-3-4b-guru
Base model
Qwen/Qwen3-4B-Instruct-2507