Mobile AI Factory: Qwen3.5-0.8B for calendar event extraction (natural language to a calendar.events.insert call)
A small language model fine-tuned and quantized by Mobile AI Factory for calendar event extraction (natural language to a calendar.events.insert call), ready to run on a phone with llama.cpp.
Paper: Mobile AI Factory: Building Specialized Language Models for Your Mobile Device (Hugging Face paper page) · Code: evanly-gh/SLM_Factory
Mobile AI Factory is an agentic system that takes a task specification and a target phone and builds a fine-tuned, quantized SLM for them: an orchestrator LLM chooses whether to tune hyperparameters, mine real data or generate synthetic examples, fixed rules roll back changes that hurt accuracy, and the search climbs from small to large models using real measurements of the phone.
Result
AST argument match 0.811 on the run's frozen held-out evaluation set (535 rows), +0.277 over the first fine-tune. This is the Calendar JSON row of the paper's main results table.
Model
- Base model:
Qwen/Qwen3.5-0.8B, LoRA fine-tuned and merged - Format: Q4_K_M GGUF (4-bit), 0.54 GB
- Engine: llama.cpp
Files:
mobile-ai-factory-calendar-json-qwen3.5-0.8b-q4_k_m.gguf
Prompt format
The model was trained and scored on one exact prompt: the task instruction in a ChatML user turn, then the assistant turn with an empty think block (thinking off). Decode greedily, stop at <|im_end|>, and allow up to 256 new tokens. An example from the evaluation set, fully rendered:
<|im_start|>user
You are a function-calling assistant. Given the user request and the available functions, reply with ONLY a JSON array of the calls to make, where each element is {"name": <function name>, "arguments": {<arg>: <value>, ...}}. Use only the functions listed. Reply with [] if no function applies. Do not add prose or Markdown.
Available functions:
[{"name": "calendar.events.insert", "description": "Create an event on the user's primary Google Calendar. Times must be resolved to ISO-8601 (YYYY-MM-DDTHH:MM:SS) against the current date and time given in the request.", "parameters": {"type": "dict", "required": ["summary", "start", "end"], "properties": {"summary": {"type": "string", "description": "Title of the event."}, "start": {"type": "dict", "description": "Start, as {\"dateTime\": \"YYYY-MM-DDTHH:MM:SS\"}."}, "end": {"type": "dict", "description": "End, as {\"dateTime\": \"YYYY-MM-DDTHH:MM:SS\"}. Default to 60 minutes after start when the request gives no duration."}, "location": {"type": "string", "description": "Physical location or address. Omit when not stated."}}}}]
User request: Convert the user's scheduling request into a single calendar.events.insert call. Resolve every relative date and time against the current date and time given below, and make the event 60 minutes long unless a duration is stated. When the request gives a day but no clock time, start the event at 09:00; when it says tonight, start it at 20:00.
Current date and time: 2026-11-25T15:00:00 (Wednesday).
Reminder to go see Christopher Robin next saturday at 8 am.<|im_end|>
<|im_start|>assistant
<think>
</think>
Expected output for this example:
[{"name": "calendar.events.insert", "arguments": {"summary": "go see Christopher Robin", "start": {"dateTime": "2026-11-28T08:00:00"}, "end": {"dateTime": "2026-11-28T09:00:00"}}}]
Run it
from llama_cpp import Llama
prompt = open("prompt.txt").read() # the fully rendered prompt, as in Prompt format
llm = Llama(model_path="mobile-ai-factory-calendar-json-qwen3.5-0.8b-q4_k_m.gguf", n_ctx=4096, verbose=False)
out = llm.create_completion(prompt, max_tokens=256, temperature=0.0, stop=["<|im_end|>"])
print(out["choices"][0]["text"].strip())
On a phone, the same GGUF runs in any llama.cpp-based app; pass the rendered prompt as raw text (no extra chat template), with greedy decoding.
Training data
- TOPv2 reminder domain (CC BY-SA 4.0) and Schema-Guided Dialogue
Calendar_1/AddEventframes (CC BY-SA 4.0), converted to calendar calls. - Synthetic rows written and checked by a teacher LLM (Claude Sonnet 5) during the search.
License
Apache-2.0, as the base model. The source datasets are CC BY-SA 4.0.
Citation
@article{li2026mobileaifactory,
title = {Mobile AI Factory: Building Specialized Language Models for Your Mobile Device},
author = {Li, Evan and Deshpande, Krishna and Cheng, Wen and Gollakota, Shyamnath},
journal = {arXiv preprint arXiv:2611.13509},
year = {2026}
}