Hanu / README.md
Vijaypathy88's picture
Model card: add stock Gemma 4 E2B comparison; --port 8080 in usage
62e3a13 verified
|
Raw History Blame Contribute Delete
3.79 kB
---
license: gemma
base_model: google/gemma-4-E2B-it
tags:
- gguf
- gemma
- on-device
- android
- tool-use
- agent
- llama.cpp
language:
- en
pipeline_tag: text-generation
---
# Hanu by Vanaras
**Hanu** is the on-device planner model for the **Maaya** assistant by Vanaras. It's built to run on Android phones in the ~Rs 20k price range.
- **Base:** google/gemma-4-E2B-it
- **Training:** LoRA SFT on 3.7k rows, then DPO
- **Quantization:** Q4_K_M with an importance matrix (imatrix), ~2.7 GB GGUF
- **Language:** English only for now
## What it does
Hanu turns a user request into a tool plan written in the **Vanaras plan language**. Every plan ends with a `say(...)` call. The model never talks freely. It plans tool calls and spoken replies under these privacy rules:
- If the audio is on speaker or other people may be listening, it **asks before speaking private information** aloud.
- It **refuses to store, speak or show PINs, passwords, CVVs and OTPs**.
- It asks for confirmation before deleting, sending, paying, scheduling or cancelling.
## Files
| File | Purpose |
|---|---|
| `Hanu-E2B-Q4_K_M.gguf` | Model weights (Q4_K_M, imatrix) |
| `system_prompt.txt` | **Required** system prompt. The model only behaves correctly with this prompt. Replace `{name}` with the assistant's name. |
| `template_vanaras.jinja` | Chat template |
| `plan_v026_llamacpp.gbnf` | GBNF grammar that restricts output to valid plans |
## Usage (llama.cpp)
Run with temperature 0 and thinking turned off. Use `system_prompt.txt`, with `{name}` replaced, as the system message:
```bash
llama-server -m Hanu-E2B-Q4_K_M.gguf --jinja \
--chat-template-file template_vanaras.jinja \
--grammar-file plan_v026_llamacpp.gbnf \
--temp 0 --reasoning-budget 0 -c 4096 --port 8080
```
```bash
SYS=$(sed 's/{name}/Maaya/g' system_prompt.txt)
curl -s localhost:8080/v1/chat/completions -H 'Content-Type: application/json' \
-d "$(jq -n --arg s "$SYS" '{temperature:0, messages:[{role:"system",content:$s},{role:"user",content:"What is the weather in Bengaluru today?"}]}')"
```
The output is one plan, for example a weather check followed by `say(...)`. Your app runs the tool calls in the plan.
## Evaluation (internal)
> These are **internal benchmarks** run on Vanaras's own locked test sets. They are **not public benchmarks** and cannot be reproduced from public data. Setup: llama.cpp b11612, CPU, temperature 0. **Stock Gemma 4 E2B** (google/gemma-4-E2B-it, Q4_K_M GGUF) got the same system prompt, grammar and settings as Hanu.
| Metric | Stock Gemma 4 E2B | v3 | v4-SFT | **Hanu (this)** |
|---|---|---|---|---|
| Call-safety pass (of 50) ↑ | 23 | 26 | 31 | **37** |
| Leaks ↓ | 14 | 16 | 10 | **2** |
| Missed asks (of 15) ↓ | 15 | 15 | 14 | **4** |
| Wrong refusals (of 17) ↓ | 6 | 5 | 4 | 8 |
| Queries (of 50) ↑ | 4 | 40 | 44 | 41 |
| eval_hard (of 21) ↑ | 5 | 16 | 20 | 18 |
| Behaviour probes (of 151) ↑ | 11 | 101 | 136 | **143** |
## Known limitations
- **Hanu doesn't block every leak.** In internal testing it spoke a Wi-Fi password in 1 of 50 tests. In one other case it read out an account number on speaker without asking first. **Deploy with an app-side secret filter** and don't rely on the model alone.
- It sometimes asks for confirmation when it doesn't need to. Wrong refusals rose compared with v4-SFT.
- The Q4 quantization loses some of the gains measured at full precision.
- English only.
- The plan language is specific to Vanaras. Outside the Maaya runtime, the output is not general-purpose chat.
## Gemma terms of use
Hanu is derived from Gemma. Gemma is provided under and subject to the Gemma Terms of Use: https://ai.google.dev/gemma/terms. By using this model you agree to those terms, including the Gemma Prohibited Use Policy.