This model (
madamLLM-tools) extends
babs/madamLLM-dpo with tool calling capabilities using Qwen3's native Hermes-style
<tool_call> format.
All four languages scored 100% on tool accuracy: English ✅ Igbo ✅ Hausa ✅ Yoruba ✅
Uses Qwen3's native Hermes-style format. Pass tools via apply_chat_template:
1from transformers import AutoModelForCausalLM, AutoTokenizer
2import torch
3
4model = AutoModelForCausalLM.from_pretrained("babs/madamLLM-tools", torch_dtype=torch.bfloat16, device_map="auto")
5tokenizer = AutoTokenizer.from_pretrained("babs/madamLLM-tools")
6
7tools = [
8 {
9 "type": "function",
10 "function": {
11 "name": "get_weather",
12 "description": "Get the current weather conditions for a city in Nigeria",
13 "parameters": {
14 "type": "object",
15 "properties": {
16 "city": {"type": "string", "description": "City name, e.g. Lagos, Kano, Abuja"}
17 },
18 "required": ["city"]
19 }
20 }
21 }
22]
23
24messages = [
25 {"role": "system", "content": "You are Madam, a Nigerian voice assistant."},
26 {"role": "user", "content": "Yaya yanayi a Kano yau?"} # Hausa: What's the weather in Kano today?
27]
28
29text = tokenizer.apply_chat_template(messages, tools=tools, tokenize=False, add_generation_prompt=True, enable_thinking=False)
30inputs = tokenizer(text, return_tensors="pt").to(model.device)
31output = model.generate(**inputs, max_new_tokens=200, temperature=0.3, do_sample=True, eos_token_id=[151645, 151643])
32print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False))
33# → <tool_call>{"name": "get_weather", "arguments": {"city": "Kano"}}</tool_call>
1vllm serve babs/madamLLM-tools \
2 --tool-call-parser hermes \
3 --enable-auto-tool-choice \
4 --dtype bfloat16 \
5 --max-model-len 4096
50% of tool-calling examples use function masking (Hammer technique) for generalization to unseen tools.
Madam embodies the nine fruits of the Spirit (Galatians 5:22-23): love, joy, peace, patience, kindness, goodness, faithfulness, gentleness, and self-control.