YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
tool-adapter-2tool
LoRA adapter for Qwen/Qwen3-0.6B that classifies each user turn in an IVF lead-qualification call into one of two tool calls:
acknowledge()β greeting/salutation, agreement/proceed, confirmation of a value already present in the Current State, pure decline-of-offer, identity confirmations (ji haan/ji nahi).fallback()β everything else: answers to slot-elicitation questions (yes/no, soft-affirmations, values), decline + new information, agreement + new information, repairs/corrections, knowledge requests, handoff, ambiguous/uncertain/off-topic turns, greetings that carry actionable info.
There is intentionally no set_state() tool β slot-elicitation answers go to fallback().
Training data
train.jsonlβ 1614 rows (296acknowledge()/ 1318fallback())valid.jsonlβ 100 held-out rows (0 user-turn collisions with train)valid_flows.jsonlβ 100 rows from real multi-turn call flows; pureacknowledge()βacknowledge(), otherwisefallback()
Source sheets: ~/Downloads/ACK().xlsx (dataset, from old data - fallbacks, from old data - all acks).
Base model
LoRA config
lora_config_tool_adapter.yaml β rank 16, scale 20.0, dropout 0.05, 16 layers, batch 2 / grad accum 4, 400 iters, lr 1e-5, max_seq_length 768, mask_prompt true, seed 42.
Results
| Eval set | Accuracy |
|---|---|
valid.jsonl (100 rows) |
81.0% |
valid_flows.jsonl (100 rows) |
95.0% |
Known failure mode: acknowledge() is under-predicted relative to fallback() (class prior is ~82% fallback). Undersampling fallback, higher iteration counts, and exact-row teaching all regressed accuracy vs. this baseline.
Usage
from mlx_lm import load, generate
model, tok = load("Qwen/Qwen3-0.6B", adapter_path="./adapters/tool_adapter")
prompt = (
"Given the conversation history and current state, choose the correct tool for the user turn.\n"
"Current User Turn: mai 32 ka hu\n"
"In the current User Turn, the correct tool call is"
)
out = generate(model, tok, prompt=prompt, max_tokens=16)
print(out) # expect: fallback()