Instructions to use LUNAV/mai-nano-router with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use LUNAV/mai-nano-router with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="LUNAV/mai-nano-router", filename="mai-nano-router-v4sft-f16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use LUNAV/mai-nano-router with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf LUNAV/mai-nano-router:F16 # Run inference directly in the terminal: llama cli -hf LUNAV/mai-nano-router:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf LUNAV/mai-nano-router:F16 # Run inference directly in the terminal: llama cli -hf LUNAV/mai-nano-router:F16
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf LUNAV/mai-nano-router:F16 # Run inference directly in the terminal: ./llama-cli -hf LUNAV/mai-nano-router:F16
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf LUNAV/mai-nano-router:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf LUNAV/mai-nano-router:F16
Use Docker
docker model run hf.co/LUNAV/mai-nano-router:F16
- LM Studio
- Jan
- vLLM
How to use LUNAV/mai-nano-router with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LUNAV/mai-nano-router" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LUNAV/mai-nano-router", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/LUNAV/mai-nano-router:F16
- Ollama
How to use LUNAV/mai-nano-router with Ollama:
ollama run hf.co/LUNAV/mai-nano-router:F16
- Unsloth Studio
How to use LUNAV/mai-nano-router with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for LUNAV/mai-nano-router to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for LUNAV/mai-nano-router to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for LUNAV/mai-nano-router to start chatting
- Pi
How to use LUNAV/mai-nano-router with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LUNAV/mai-nano-router:F16
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "LUNAV/mai-nano-router:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use LUNAV/mai-nano-router with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LUNAV/mai-nano-router:F16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default LUNAV/mai-nano-router:F16
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use LUNAV/mai-nano-router with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LUNAV/mai-nano-router:F16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "LUNAV/mai-nano-router:F16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use LUNAV/mai-nano-router with Docker Model Runner:
docker model run hf.co/LUNAV/mai-nano-router:F16
- Lemonade
How to use LUNAV/mai-nano-router with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LUNAV/mai-nano-router:F16
Run and chat with the model
lemonade run user.mai-nano-router-F16
List all available models
lemonade list
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_5linear-attention hybrid) - Method: LoRA SFT (r=32, α=64, dropout 0.05,
all-lineartargets, 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-serverwith 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
8-bit
16-bit
Model tree for LUNAV/mai-nano-router
Base model
Qwen/Qwen3.5-0.8B-Base