Skip to content

A-01 Function Caller

Open source, Apache-2.0

85.3% exact match on 961 held-out requests, up from 74.2%

function callingvoice commandson-devicemulti-step7 tools

Phone assistants fail in a particular way: asked for two things, they do one. A-01 maps a spoken request onto seven tools, with every function name and argument in the right order.

The base model already scored 74.2%. Twenty steps of reinforcement learning took it to 85.3% on 961 held-out requests, mostly by learning to finish commands with more than one part.

The weights are a LoRA adapter on top of Qwen/Qwen3.5-0.8B. Load both with transformers and peft.

  1. Install

    Terminal window
    pip install -U transformers peft accelerate
  2. Load and ask

    run.py
    from transformers import AutoModelForCausalLM, AutoTokenizer
    from peft import PeftModel
    base = "Qwen/Qwen3.5-0.8B"
    tok = AutoTokenizer.from_pretrained(base)
    model = AutoModelForCausalLM.from_pretrained(base, torch_dtype="auto", device_map="auto")
    model = PeftModel.from_pretrained(model, "superbird-labs/a-01-function-caller")
    SYSTEM = open("system_prompt.txt").read() # the prompt below
    messages = [{"role": "system", "content": SYSTEM},
    {"role": "user", "content": "your input here"}]
    ids = tok.apply_chat_template(messages, add_generation_prompt=True,
    enable_thinking=False, return_tensors="pt").to(model.device)
    out = model.generate(ids, max_new_tokens=512, do_sample=False)
    print(tok.decode(out[0][ids.shape[-1]:], skip_special_tokens=True))

Trained with this exact system prompt. Use it word for word: small models are picky about their instructions.

system prompt
Current date and time given in YYYY-MM-DDTHH:MM:SS format: 2024-09-15T17:35:19
Day of week is Sunday
You are a model that can do function calling with the following functions
(the 7 tools are passed with tools=: turn_off_flashlight, open_wifi_settings, create_calendar_event, show_map, send_email, turn_on_flashlight, create_contact)
a real test input
Can you please save a new contact for me? The name is Lena Petrova, the phone number is +359 888 123 456, and the email is lena.petrova.design@webmail.com.
shape of the answer
turn_on_flashlight()
show_map(query="Sunnyvale Library")

Real cases from the held-out set, never seen in training.

Flashlight on, then the map
Turn on the flashlight and show me the location of the Sunnyvale library on the map.
✕ Before training
turn_on_flashlight()

Does the first thing and forgets the map.

✓ After training, A-01
turn_on_flashlight()
show_map(query="Sunnyvale Library")

Both actions, in the order asked.

Flashlight off, then a meeting
Please turn off the flashlight and immediately schedule a calendar event titled 'Call Ana about the proposal' for tomorrow at 3:30 pm.
✕ Before training
turn_off_flashlight()

The meeting never gets booked.

✓ After training, A-01
turn_off_flashlight()
create_calendar_event(
  title="Call Ana about the proposal",
  datetime="2025-12-13T15:30:00")

Both actions, with the title and tomorrow at 15:30.

Find a bookstore in Brooklyn
Can you show me where the Wandering Page bookstore is located in Brooklyn?
✕ Before training
show_map(query="The Wandering Page bookstore")

Drops "in Brooklyn", so the map can find the wrong shop.

✓ After training, A-01
show_map(query="The Wandering Page bookstore in Brooklyn")

Keeps the detail that makes the search right.

Base model Qwen/Qwen3.5-0.8B
Method GRPO with LoRA on the Surogate engine
Steps 20
Batch 32 requests × 8 tries each
Answer length up to 256 tokens
Hardware one 48 GB L40S
Time about 60 minutes

google/mobile-actions (CC-BY-4.0): 8,693 requests to train on, 961 held out, over 7 phone tools.

Exact match on the ordered list of function names and their arguments, the rule from Google’s own notebook.

Trained with the open-source Surogate engine (1.5.17 or later), kit phone. Full kit notes: Surogate phone kit.

Terminal window
CUDA_VISIBLE_DEVICES=0 surogate grpo-colocate \
--train examples/kits/phone/train.yaml \
--infer examples/kits/phone/infer.yaml \
--orch examples/kits/phone/orch.yaml

The held-out score shows in the log as Avg@1= and the adapter lands in outputs/kits/phone/. To point it at your data, read Retrain on your data.

74.2%base
85.3%step 20
83.8%step 40

Exact match on 961 held-out requests. More training was not better, so step 20 ships. One run, one seed.

  • Most of the gain is completion. The base model did one of two requested actions.
  • More training was not better: step 40 scored lower than step 20, so step 20 ships.
  • On-device voice commands. Speech to text in, function calls out, with no server round trip. Small enough to run on a phone.
  • App and smart-home intents. Retrain it on your own function list and a few thousand requests.
  • Commands with several steps. It completes both halves of “do this, then that”, which is where small models usually stop.

Open small models for every industry, free to run offline. Custom ones for companies.

superbirdlabs.com Custom models Hugging Face hello@superbirdlabs.com