--- base_model: Qwen/Qwen3.5-0.8B library_name: peft license: apache-2.0 pipeline_tag: text-generation language: - en datasets: - google/mobile-actions tags: - grpo - lora - reinforcement-learning - small-model - on-device - superbird-labs model-index: - name: a-01-function-caller results: - task: type: text-generation name: function calling dataset: name: google/mobile-actions eval (961 requests) type: google/mobile-actions metrics: - type: exact_match name: exact match value: 85.3 --- ![A-01 Function Caller](https://huggingface.co/superbird-labs/a-01-function-caller/resolve/main/cover.png) # A-01 · Function Caller **superbird labs · Agent unit · 0.8B** > Turns a phone request into the exact function calls, every name and argument in order. It finishes the whole command, not half of it. [**Watch real runs**](https://huggingface.co/spaces/cetusian/model-hangar)  |  [**Docs and full recipe**](https://docs.superbirdlabs.com/models/a-01/)  |  [**Run it offline**](https://docs.superbirdlabs.com/models/a-01/#run-it)  |  [All superbird models](https://superbirdlabs.com/units)  |  [Custom models for your company](https://superbirdlabs.com/business) **Open source.** Apache-2.0 weights, the full training recipe and the exact prompt are all public. Use it, ship it, retrain it. ## Spec plate | | | |---|---| | Serial | `A-01` · 0.8B | | Frame | `DA-24` · Qwen3.5 hybrid · 24 layers in a 3:1 rhythm: 18 gated DeltaNet (fast running memory) + 6 full attention (the deep look back), width 1024 | | Mission | Turns a phone request ("turn on the flashlight and show me the library on the map") into the exact function calls a phone would run, across seven tools: flashlight, wi-fi settings, calendar, map, email, contacts and more. | | Held-out requests | 961, the whole eval split | | Before → after | 74.2% → **85.3%** Exact match | | Training | 20 GRPO steps · one L40S · ~60 min | | Recipe | LoRA r16 · 32 requests × 8 rollouts · answers up to 256 tokens · thinking off | | Datasets | [google/mobile-actions](https://huggingface.co/datasets/google/mobile-actions) (cc-by-4.0), 8,693 training requests | **Reward:** Google's own exact-match rule: every function name and every argument, in order, or 0. Nothing for half right. ## Where it earns its keep | | | |---|---| | **An on-device voice command layer** | Speech-to-text in, function calls out, no server round trip. Small enough for a phone. | | **Smart home and app intents** | Same idea, your tools: retrain on your function list and a few thousand requests. | | **Multi-step commands that finish** | It learned to do both halves of "do x and then y", which is where small callers usually stop. | ## Mission log Real missions from the held-out set. Same question, before and after training. **Turn on the flashlight and show me the location of the Sunnyvale library on the map.** Before training: ``` turn_on_flashlight() ``` *Does the first of two actions.* After, A-01: ``` turn_on_flashlight() show_map(query="Sunnyvale Library") ``` **Can you show me where the Wandering Page bookstore is located in Brooklyn?** Before training: ``` show_map(query="The Wandering Page bookstore") ``` *Drops the location.* After, A-01: ``` show_map(query="The Wandering Page bookstore in Brooklyn") ``` ## Receipts | | exact match (961 held-out) | |---|---| | Base Qwen3.5-0.8B | 74.2% | | **step 20 (A-01)** | **85.3%** | | step 40 (longer run) | 83.8%, more training didn't help | Greedy decoding, same prompt and budget as training, one run. The highlighted checkpoint ships. **Outside check.** Plain `transformers` + `peft` on the first 48 held-out requests: base 72.9% → 89.6%. Fixed 8, broke 0. ## Scars What it cost to get here, and what we learned. - **The base did half the job.** Two actions asked, one done. Most of the gain is it learning to finish the sentence. - **More steps ≠ better.** Step 40 scored lower. Keep step 20. ## The prompt Trained with this exact system prompt. Use it word for word: small models are picky. ```text 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 ``` Pass the tools with `tools=` in the chat template: `turn_off_flashlight`, `open_wifi_settings`, `create_calendar_event`, `show_map`, `send_email`, `turn_on_flashlight`, `create_contact`. ## Pilot's manual ```python from transformers import AutoModelForCausalLM, AutoTokenizer from peft import PeftModel tok = AutoTokenizer.from_pretrained("Qwen/Qwen3.5-0.8B") base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen3.5-0.8B", torch_dtype="bfloat16") model = PeftModel.from_pretrained(base, "superbird-labs/a-01-function-caller") ``` Pass the same seven tools with `tools=` in `apply_chat_template`, `enable_thinking=False`. Or `surogate serve Qwen/Qwen3.5-0.8B` with the adapter loaded at runtime. ## Weak spots - Seven tools, the dataset's. A new tool needs new rows. - Dates are relative to the date in the dataset's system prompt. - Exact match is strict: one extra word in an argument counts as wrong. - One run, one seed. ## Built with One GPU and the open-source [surogate engine](https://github.com/invergent-ai/surogate) (Apache-2.0). The whole kit (configs, environment, reward, walkthrough) is open, so you can rebuild this unit or point it at your own task: [docs.surogate.ai/engine/examples/kits/phone](https://docs.surogate.ai/engine/examples/kits/phone/). Also published as [cetusian/mantix-0.8b](https://huggingface.co/cetusian/mantix-0.8b). ## The fleet | Serial | Unit | Mission | Before → after | |---|---|---|---| | `L-01` | [l-01-document-extractor](https://huggingface.co/superbird-labs/l-01-document-extractor) | document → the JSON your schema asks for | 67.6% → 87.8% | | `L-02` | [l-02-policy-guard](https://huggingface.co/superbird-labs/l-02-policy-guard) | written policy + message → safe / unsafe | 54.4% → 78.1% | | `L-42` | [l-42-galaxy-guide](https://huggingface.co/superbird-labs/l-42-galaxy-guide) | explains anything, offline | the guide | | `A-01` | **a-01-function-caller** | phone request → exact function calls | 74.2% → 85.3% | | `A-02` | [a-02-database-agent](https://huggingface.co/superbird-labs/a-02-database-agent) | questions answered through a live MCP database | 48.4% → 81.5% | | `A-03` | [a-03-solver](https://huggingface.co/superbird-labs/a-03-solver) | countdown arithmetic, every step written | 1% → 69.5% | --- *Nobody built a model for it. So we did.* **[superbirdlabs.com](https://superbirdlabs.com)**: open small models for every industry, free to run offline, and custom models built for companies. [Docs](https://docs.superbirdlabs.com) | [All models](https://huggingface.co/superbird-labs) | [Work with us](https://superbirdlabs.com/business) | hello@superbirdlabs.com