Instructions to use ericnunes/qwen35-4b-fable5-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ericnunes/qwen35-4b-fable5-sft with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ericnunes/qwen35-4b-fable5-sft") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ericnunes/qwen35-4b-fable5-sft", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ericnunes/qwen35-4b-fable5-sft 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 ericnunes/qwen35-4b-fable5-sft:Q4_K_M # Run inference directly in the terminal: llama cli -hf ericnunes/qwen35-4b-fable5-sft:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ericnunes/qwen35-4b-fable5-sft:Q4_K_M # Run inference directly in the terminal: llama cli -hf ericnunes/qwen35-4b-fable5-sft: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 ericnunes/qwen35-4b-fable5-sft:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf ericnunes/qwen35-4b-fable5-sft: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 ericnunes/qwen35-4b-fable5-sft:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf ericnunes/qwen35-4b-fable5-sft:Q4_K_M
Use Docker
docker model run hf.co/ericnunes/qwen35-4b-fable5-sft:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use ericnunes/qwen35-4b-fable5-sft with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ericnunes/qwen35-4b-fable5-sft" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ericnunes/qwen35-4b-fable5-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ericnunes/qwen35-4b-fable5-sft:Q4_K_M
- SGLang
How to use ericnunes/qwen35-4b-fable5-sft 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 "ericnunes/qwen35-4b-fable5-sft" \ --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": "ericnunes/qwen35-4b-fable5-sft", "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 "ericnunes/qwen35-4b-fable5-sft" \ --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": "ericnunes/qwen35-4b-fable5-sft", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use ericnunes/qwen35-4b-fable5-sft with Ollama:
ollama run hf.co/ericnunes/qwen35-4b-fable5-sft:Q4_K_M
- Unsloth Desktop
- Pi
How to use ericnunes/qwen35-4b-fable5-sft with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericnunes/qwen35-4b-fable5-sft:Q4_K_M
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": "ericnunes/qwen35-4b-fable5-sft:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ericnunes/qwen35-4b-fable5-sft with Docker Model Runner:
docker model run hf.co/ericnunes/qwen35-4b-fable5-sft:Q4_K_M
- Lemonade
How to use ericnunes/qwen35-4b-fable5-sft with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ericnunes/qwen35-4b-fable5-sft:Q4_K_M
Run and chat with the model
lemonade run user.qwen35-4b-fable5-sft-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ericnunes/qwen35-4b-fable5-sft with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericnunes/qwen35-4b-fable5-sft: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 ericnunes/qwen35-4b-fable5-sft:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ericnunes/qwen35-4b-fable5-sft with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericnunes/qwen35-4b-fable5-sft:Q4_K_M
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 "ericnunes/qwen35-4b-fable5-sft:Q4_K_M" \ --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"
ericnunes/qwen35-4b-fable5-sft
Description
Fine-tuned Qwen3.5-4B model using SFT (Supervised Fine-Tuning) with Claude Fable 5 traces.
This model was trained on agentic coding traces with chain-of-thought reasoning patterns.
Training Details
- Base model: unsloth/Qwen3.5-4B (4.54B params)
- Training method: SFT (Supervised Fine-Tuning)
- Framework: Unsloth + TRL
- Precision: bf16 LoRA (r=16, alpha=16)
- Datasets:
- kelexine/fable-5-sft-traces (4,665 examples)
- WithinUsAI/fable_5_distillation_merged_cleaned_25k (filtered coding subset)
- Training config: 2 epochs, lr=1e-5, cosine scheduler, max_seq=8192
- Training data: 13,500 train / 1,500 val examples
- Training time: ~9.2 hours on RTX 3090
- Training cost: ~$2.03 (RunPod spot)
- Reference model: empero-ai/Qwable-9B-Claude-Fable-5
Benchmark Results (HumanEval+)
| Model | pass@1 | Passed |
|---|---|---|
| Baseline (Qwen3.5-4B) | 0.4939 | 81/164 |
| Fine-tuned (this model) | 0.5793 | 95/164 |
Improvement: +8.54pp (+17.3%)
Note on evaluation methodology
The baseline was re-evaluated with a corrected code extraction pipeline. An initial evaluation reported 3.66% (6/164) for the baseline, but this was due to a bug in the _extract_code function that stripped indentation from generated code. After fixing the extraction to preserve indentation and properly handle explanatory text (which the base model generates before code), the baseline was re-evaluated at 49.39% (81/164).
Both baseline and fine-tuned model were evaluated with the same corrected pipeline using:
AutoModelForCausalLM+AutoTokenizer(transformers direct, avoids Unsloth multimodal issues)- Greedy decoding (temperature=0.0, do_sample=False)
- Code extraction that preserves indentation and removes markdown/explanatory text
- Truncation at second
defblock to avoid multiple function generations - HumanEval+ test suite via subprocess execution (10s timeout per problem)
Training Metrics
- Final train loss: 0.1357
- Final eval loss: 0.0698 (↓51.4% from 0.1435 baseline)
- Steps: 3,376 (2 epochs)
- No overfitting: train loss (0.066) ≈ eval loss (0.070)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model = AutoModelForCausalLM.from_pretrained(
"ericnunes/qwen35-4b-fable5-sft",
torch_dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("ericnunes/qwen35-4b-fable5-sft")
messages = [
{"role": "user", "content": "Write a Python function to check if a number is prime."}
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(text, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=512, do_sample=False, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
GGUF Files
This model is also available in GGUF format:
model-Q4_K_M.gguf(2.57 GB) — recommended for most use casesmodel-Q8_0.gguf(4.26 GB) — higher precisionmodel-f16.gguf(8.03 GB) — full precision
Disclaimer
This model was trained on traces of Claude Fable 5 (Mythos), a preview model that was briefly available. The traces contain agentic coding patterns with thinking/reasoning blocks.
- Downloads last month
- 60
4-bit
8-bit
16-bit