Instructions to use JamieBradfield/qwen3.8-9b-hermes-function-calling-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JamieBradfield/qwen3.8-9b-hermes-function-calling-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JamieBradfield/qwen3.8-9b-hermes-function-calling-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("JamieBradfield/qwen3.8-9b-hermes-function-calling-v1") model = AutoModelForCausalLM.from_pretrained("JamieBradfield/qwen3.8-9b-hermes-function-calling-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] 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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JamieBradfield/qwen3.8-9b-hermes-function-calling-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/JamieBradfield/qwen3.8-9b-hermes-function-calling-v1
- SGLang
How to use JamieBradfield/qwen3.8-9b-hermes-function-calling-v1 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 "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1" \ --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": "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1", "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 "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1" \ --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": "JamieBradfield/qwen3.8-9b-hermes-function-calling-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use JamieBradfield/qwen3.8-9b-hermes-function-calling-v1 with Docker Model Runner:
docker model run hf.co/JamieBradfield/qwen3.8-9b-hermes-function-calling-v1
Qwen3.8-9B Hermes Function Calling v1
A QLoRA fine-tune of Empero/Qwen3.8-9B (Qwen3.5 hybrid-architecture distill,
9B dense, 262,144-token context) that specializes the model in Hermes-style
tool-call envelopes: given a <tools> XML schema in the system prompt, it
emits <tool_call><function=NAME><parameter=KEY>VALUE</parameter></function></tool_call>.
- Base model: Empero/Qwen3.8-9B (Apache-2.0)
- Training data: 1,090 tool-call conversations rendered in ShareGPT format,
all with
<tools>XML schemas in the system prompt (synthetic/curated tool-use examples across ~2,000 tool names and dozens of domains) - Method: QLoRA 4-bit, rank 16 / alpha 16, dropout 0, targets q/k/v/o/gate/up/down_proj, lr 2e-4, max seq 4096, batch 2 x grad-accum 4 (effective 8), 2 epochs = 274 steps, cosine schedule
- Trainable params: 29,097,984 / 8,980,926,976 (0.32%)
- Embeddings: frozen (tool tokens are EOS-anchored copies, not trained)
- Vocabulary: resized 248044 → 248079 (2 added tool tokens + base additions)
- Weights: BF16 full merge (12 shards), plus a ROCmFPX quantized GGUF (see the GGUF companion repo)
What this model does
The fine-tune teaches the format: when the system prompt carries function
signatures inside <tools> </tools> XML tags (the training preamble), the model
reliably produces the exact Hermes envelope with correct function names and
parameters, with no prose around it.
Format-fidelity probe (45 fresh training-distribution rows, temp 0, identical prompts for both models):
| metric | fine-tune | base |
|---|---|---|
| fired | 43/45 (95.6%) | 39/45 (86.7%) |
| name match | 43/45 (95.6%) | 39/45 (86.7%) |
| args OK | 43/45 (95.6%) | 39/45 (86.7%) |
| format exact | 43/45 (95.6%) | 39/45 (86.7%) |
| emission kind | 43 <tool_call> envelopes |
39 native JSON |
The base model answers the same prompts in native Qwen JSON; the fine-tune emits the trained Hermes envelope.
Honest limitations
- No trigger generalization. Evaluated on 45 held-out real agent
trajectories (ambiguous queries, real tool names like
terminal,search_files,patch— none of which appear in training), both the fine-tune and the base score 0/45. A 0.32% LoRA on 1,090 examples does not teach when to decide to call a tool, especially for unseen tool names and ambiguous user intent. - Parity, not gains, in OpenAI-style tool-calling paths. Through an
OpenAI-compatible
toolsparameter (the path most serving stacks use), fine-tune and base perform identically — both fire valid calls at ~55–58 tok/s on this rig; the fine-tune shows no regression and no measurable gain there, because the chat template already formats tool calls server-side and the base was already competent. - The trained envelope only pays off in raw-text tool-call paths: prompts
that embed the schema as
<tools>XML and parse<tool_call>envelopes from the output (e.g. Hermes's mined-trajectory format, custom parsers).
Reproducibility
All scripts that produced this model are in scripts/:
| file | purpose |
|---|---|
qwen38_train.py |
QLoRA training via Unsloth (274 steps, ~19.4 h on an RX 7700 XT 12 GB) |
convert_hf_hermes.py |
ShareGPT training-example converter (the 1,090 rows) |
merge_qwen38.py |
shard-streamed BF16 merge (vision tower dropped; embedding/lm_head resized with EOS-anchor rows; MTP head preserved) |
eval_fc_heldout.py |
Tier-1a eval: held-out real-trajectory trigger test (the 0/45 result) |
probe2_fc.py |
Tier-1b probe: format-fidelity on training-distribution prompts (the 43/45 result) |
subagent-qwen38-workloads.py + subagent-qwen38.sh |
Tier-2 harness: Hermes system prompt + real tool schemas, workloads A–E |
The scripts carry the author's machine paths (F:/models/..., C:/AI/...) and
run on this rig's ROCm stack (Unsloth 2026.8.18, torch 2.11 ROCm, RX 7700 XT);
adjust paths for your environment.
Convert/quantize: llama-rocmfpx fork, convert_hf_to_gguf.py --outtype bf16
→ llama-quantize Q4_0_ROCMFP4_FAST (see GGUF repo).
Quantized version
Q4_0_ROCMFP4_FAST GGUF (ROCmFPX format, for AMD RDNA3 kernels) is published
in the companion repo. Note: ROCmFPX quants target AMD ROCm inference
(ROCMFP4 kernels); for portable use, convert from the BF16 merge here.
Acknowledgements
Base model and license inherited from Empero/Qwen3.8-9B (Apache-2.0). Training
data derived from Hermes agent trajectories; tool schemas rendered in the
Hermes <tools> XML format.
- Downloads last month
- 445