MAI-nano Router (v4 SFT · GGUF)

On-device intent router + slot extractor for myMAI, a macOS natural-language launcher. Given a single user query it emits one line of JSON{"intent": ..., "confidence": ..., "slots": {...}} — that the app turns into a native action (Finder search, Calendar query, iMessage/Mail, Music, Web search, or system.unknown).

  • Base model: Qwen3.5-0.8B-Base (774M params, qwen3_5 linear-attention hybrid)
  • Method: LoRA SFT (r=32, α=64, dropout 0.05, all-linear targets, 2 epochs, MPS/Apple Silicon), then merged
  • Task: intent classification + slot extraction only — a downstream native Validator re-checks every field
  • Languages: English, Korean, Japanese, Chinese
  • Runtime: llama.cpp llama-server with grammar-forced JSON output

Files

File Quant Size Notes
mai-nano-router-v4sft-q8_0.gguf Q8_0 811 MB Recommended — the exact file myMAI ships on-device
mai-nano-router-v4sft-f16.gguf F16 1.5 GB Full-precision, for re-quantizing to other formats

Intents & slots

Six intents: finder.search, calendar.query, message.send, music.play, web.search, system.unknown. Slots are intent-specific (e.g. keyword, file_type, location, date_range for search; recipient, body, channel for messages). The full slot contract lives in the JSON schema below.

Evaluation (v4 SFT, 120-example multilingual holdout)

Metric Value
Intent accuracy 99.2%
JSON validity 100%
Slot F1 0.79 (P 0.80 / R 0.78)
Hallucinated-slot rate 4.2%
Confidence MAE 0.049

Per-language intent accuracy: en 100% · ja 100% · ko 100% · zh 96.7%.

Usage

The model is trained on a canonical system prompt and expects JSON-schema-constrained decoding. Start a server:

llama-server -m mai-nano-router-v4sft-q8_0.gguf --port 8765 -ngl 99 --ctx-size 2048

System prompt (byte-identical to what the model was trained on — send it verbatim):

You are the intent router for myMAI, a macOS natural-language launcher. Read the user's single query and output ONLY one single-line JSON object: {"intent":"<id>","confidence":<0..1>,"slots":{...}}. Intent ids: finder.search, calendar.query, message.send, music.play, web.search, system.unknown. Never add keys, text, or explanations outside the JSON.

Request (OpenAI-compatible endpoint) with the enforced schema:

curl http://127.0.0.1:8765/v1/chat/completions -H 'Content-Type: application/json' -d '{
  "messages": [
    {"role": "system", "content": "<canonical system prompt above>"},
    {"role": "user", "content": "한글파일 찾아줘"}
  ],
  "response_format": {
    "type": "json_schema",
    "json_schema": {"name": "route", "schema": {
      "type": "object",
      "properties": {
        "intent": {"type": "string", "enum": ["finder.search","calendar.query","message.send","music.play","web.search","system.unknown"]},
        "confidence": {"type": "number", "minimum": 0, "maximum": 1},
        "slots": {"type": "object", "properties": {
          "keyword": {"type": "string"}, "file_type": {"type": "string"}, "location": {"type": "string"},
          "date_range": {"type": "string"}, "recipient": {"type": "string"}, "body": {"type": "string"},
          "channel": {"type": "string", "enum": ["imessage","sms","mail"]},
          "action": {"type": "string", "enum": ["play","pause","next","prev"]},
          "query": {"type": "string"}, "want_answer": {"type": "boolean"}
        }, "additionalProperties": false}
      },
      "required": ["intent","confidence","slots"], "additionalProperties": false
    }}
  }
}'

Example output:

{"intent":"finder.search","confidence":0.92,"slots":{"file_type":"hwp"}}

Intended use & limitations

  • Scope: short launcher-style queries in en/ko/ja/zh. It classifies intent and extracts slots only — it does not execute actions, and myMAI re-validates every slot natively (enum grounding, hallucination checks) before acting.
  • Out of scope: open-ended chat, multi-step requests, or capabilities outside the six intents → these are expected to route to system.unknown.
  • Always decode with the JSON schema above; free-form decoding is unsupported.

License

Apache-2.0, inherited from the Qwen3.5-0.8B-Base base model.

Downloads last month
32
GGUF
Model size
0.8B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

8-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for LUNAV/mai-nano-router

Quantized
(31)
this model