Qwen3-4B-Instruct-2507-hermes-fc (GGUF)
Qwen3-4B-Instruct-2507 fine-tuned for function calling (LoRA: mpa-17/Qwen3-4B-Instruct-2507-hermes-fc-LoRA), merged into the original 16-bit weights in fp32 and saved as fp16, then converted with llama.cpp v1.0.0.
| file | description |
|---|---|
Qwen3-4B-Instruct-2507-hermes-fc-F16.gguf | merged model, F16 |
Qwen3-4B-Instruct-2507-hermes-fc-Q8_0.gguf | Q8_0 |
Qwen3-4B-Instruct-2507-hermes-fc-Q4_K_M.gguf | Q4_K_M, default recipe |
Qwen3-4B-Instruct-2507-hermes-fc-Q4_K_M-imat.gguf | Q4_K_M with importance matrix; token embeddings (tied with the output layer) kept in Q6_K |
imatrix.gguf | importance matrix (250 training examples, ≤200×512 tokens) |
eval/ | held-out test ids, raw predictions of every model, results.json |
Training
- Base:
unsloth/Qwen3-4B-Instruct-2507, QLoRA (4-bit NF4 base, fp16) with Unsloth - LoRA: r=16, alpha=16, dropout 0, all attention and MLP projections; 200 steps, effective batch 8, lr 0.0002, max length 2048, 25.4 min on Tesla T4
- Data:
NousResearch/hermes-function-calling-v1, only examples whose reference answer consists of strictly valid JSON tool calls:func_calling_singleturn(the Information Extraction part has malformed JSON and is excluded) plus first turns ofglaive_func_calling, deduplicated by query. Train 1800, held-out test 100 ({'func_calling_singleturn': 57, 'glaive_func_calling': 43}). - Format: native Qwen3 tool calling (tools passed via the chat template,
<tool_call>{"name": ..., "arguments": ...}</tool_call>), loss on assistant tokens only.
Evaluation (100 held-out examples, never seen in training or imatrix calibration)
All models run in the same engine (llama.cpp v1.0.0 llama-server) on identical prompt tokens with greedy decoding. "Fully correct" = same function names and arguments as the reference (order-insensitive); 95% Wilson CI in brackets.
| model | has <tool_call>, % | valid JSON, % | correct functions, % | fully correct call, % |
|---|---|---|---|---|
| Base F16 | 100 | 99 | 89 | 73 (64–81) |
| FT F16 | 100 | 100 | 92 | 81 (72–87) |
| FT Q4_K_M-imat | 100 | 99 | 92 | 78 (69–85) |
| FT Q8_0 | 100 | 100 | 92 | 81 (72–87) |
| FT Q4_K_M | 100 | 100 | 92 | 81 (72–87) |
Perplexity and KL divergence vs the fine-tuned F16 model (llama-perplexity --kl-divergence, ctx 512, 100 chunks of the held-out text):
| quant | size, GB | bpw | PPL | Mean KLD vs F16 | 99% KLD | same top-p, % |
|---|---|---|---|---|---|---|
| F16 | 8.05 | 16.01 | 2.6767 | — | — | — |
| Q8_0 | 4.28 | 8.51 | 2.6775 | 0.00104 ± 0.00002 | 0.0088 | 98.79 |
| Q4_K_M | 2.50 | 4.97 | 2.6989 | 0.01778 ± 0.00101 | 0.1380 | 95.82 |
| Q4_K_M-imat | 2.50 | 4.97 | 2.6830 | 0.01109 ± 0.00047 | 0.1004 | 96.30 |
Usage
llama-server -m Qwen3-4B-Instruct-2507-hermes-fc-Q4_K_M-imat.gguf --jinja -c 8192
Then call the OpenAI-compatible /v1/chat/completions endpoint with tools.
Limitations: trained only on examples where a tool call is the right answer, so the model may be eager to call tools; English data only.