How to use from
llama.cpp
Install from brew
brew install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
# Run inference directly in the terminal:
llama-cli -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama-server -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
# Run inference directly in the terminal:
llama-cli -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_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 python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
# Run inference directly in the terminal:
./llama-cli -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_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 python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
Use Docker
docker model run hf.co/python3isfun/qwen3-1.7b-toolcall-gguf:Q5_K_M
Quick Links

qwen3-1.7b-toolcall (Q5_K_M GGUF)

A QLoRA fine-tune of Qwen3-1.7B that reliably emits <tool_call> blocks for four local search tools, intended for on-device inference (iOS / llama.cpp). Quantized to Q5_K_M (~1.2 GB).

  • Base model: Qwen/Qwen3-1.7B (Apache-2.0)
  • Method: QLoRA (Unsloth) โ€” r=16, ฮฑ=32, all 7 attn/MLP projections, 3 epochs, lr 2e-4, cosine, AdamW-8bit
  • Format: bare ChatML, no <think> blocks

What it does

Given a user message, it either calls one of four tools or answers directly (math, chitchat, general knowledge, questions about the tools).

Tool Purpose
search_recipes(query, sort_by) find recipes by dish / ingredient
search_events(query, region, max_price) find concerts, sports, shows
search_food_categories(query, min_tier) browse dish categories by popularity tier (1โ€“5)
search_regions(query) look up which cities a region covers

A tool call is emitted as exactly:

<tool_call>
{"name": "search_recipes", "arguments": {"query": "cubano"}}
</tool_call>

Prompt format

Plain ChatML, one block per message, then an empty assistant turn to generate:

<|im_start|>system
{system prompt}<|im_end|>
<|im_start|>user
{user message}<|im_end|>
<|im_start|>assistant

System prompt the model was trained on:

You have access to these tools. To use one, reply ONLY with a tool_call block:

<tool_call>
{"name": "TOOL_NAME", "arguments": {"key": "value"}}
</tool_call>

Tools:
- search_recipes(query, sort_by): Find recipes by dish name or ingredient.
- search_events(query, region, max_price): Find concerts, sports, shows.
- search_food_categories(query, min_tier): Browse 100 dish categories by tier (1-5).
- search_regions(query): Look up which cities a region covers.

If the question does NOT need a tool, answer directly without a tool_call block.

Two-turn flow: the model emits a <tool_call>; your app runs the tool and feeds the result back as a system message (Tool results:\n{...}\n\nNow answer the user's question using the results above.), then the model writes the final natural-language answer.

Evaluation

12-test tool-use suite + a 250-example held-out set. Q5_K_M, temperature 0:

Metric Base Qwen3-1.7B This model (Q5_K_M)
Overall score 0.767 0.850
Pass rate (โ‰ฅ0.8) 8/12 10/12
Tool-call rate 70% 100%
Valid tool-call JSON 70% 100%
Correct tool name 70% 100%
Held-out tool-name acc (unseen) 47% 100%

Q5_K_M matches the full-precision model (0.85) and passes under both the trained (no-few-shot) prompt and a few-shot variant. An overfitting check showed train acc = holdout acc = 100% (zero gap) and 94% on deliberately off-template slang/typo queries โ€” it learned the skill, not the training set.

Usage (llama.cpp)

hf download python3isfun/qwen3-1.7b-toolcall-gguf qwen3-1.7b-toolcall-Q5_K_M.gguf --local-dir .
./llama-cli -m qwen3-1.7b-toolcall-Q5_K_M.gguf --temp 0 -p "<your ChatML prompt>"
from llama_cpp import Llama
llm = Llama(model_path="qwen3-1.7b-toolcall-Q5_K_M.gguf", n_ctx=2048)
prompt = ("<|im_start|>system\n" + SYSTEM_PROMPT + "<|im_end|>\n"
          "<|im_start|>user\nFind me a recipe for tacos<|im_end|>\n"
          "<|im_start|>assistant\n")
print(llm(prompt, temperature=0.0, stop=["<|im_end|>"])["choices"][0]["text"])
# -> <tool_call>\n{"name": "search_recipes", "arguments": {"query": "tacos"}}\n</tool_call>

Notes & limitations

  • Trained against a specific local dataset (recipes/events/food categories/regions); tool results must come from that data for grounded final answers.
  • Constrained task (4 tools) โ€” strong scores mean "no overfitting on this skill," not "flawless on every input."
  • A Q4_K_M variant (~1.06 GB) also exists; it matches Q5 under the trained prompt but is slightly less robust under a longer few-shot prompt.

License

Apache-2.0, inherited from the Qwen3-1.7B base model.

Downloads last month
141
GGUF
Model size
2B params
Architecture
qwen3
Hardware compatibility
Log In to add your hardware

5-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for python3isfun/qwen3-1.7b-toolcall-gguf

Finetuned
Qwen/Qwen3-1.7B
Quantized
(277)
this model