File size: 3,994 Bytes
69c17e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7f0a3c
 
 
 
 
 
 
69c17e9
ba5456d
69c17e9
ba5456d
69c17e9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e7f0a3c
69c17e9
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
---
license: apache-2.0
language:
  - en
pipeline_tag: text-generation
library_name: transformers
tags:
  - ngari
  - sovereign-ai
  - edge-ai
  - qwen2.5
  - lora
  - gguf
  - ollama
  - function-calling
  - tool-use
base_model: Qwen/Qwen2.5-1.5B-Instruct
datasets:
  - NGARiAI/ngari-datasets
widget:
  - text: "What's the weather in Nairobi right now?"
    example_title: "Tool call: weather"
  - text: "Add 'review Q4 budget' to my calendar for tomorrow at 10am."
    example_title: "Tool call: calendar"
  - text: "Search the web for sovereign AI infrastructure news."
    example_title: "Tool call: web search"
---

# NGARi Tool — Tool-Calling 1.5B

A 1.5B tool-calling model: Qwen2.5-1.5B-Instruct + tool-format LoRA, scoring **100% tool detection / 100% tool-name accuracy / 100% params validity** on the NGARi tool-format eval.

This is the production **tool-mode model** in the NGARi Sovereign Business Operating System — the fast, lightweight router that lets on-device agents trigger tools, format function calls, and structure JSON without ever touching the cloud.

## Why it exists — the NGARi model pipeline

Small models naturally struggle with the rigid syntax of function calling. NGARi solves this with a teacher→student pipeline:

```
Teacher (27B-class, e.g. qwen3.8-27B)
    │  generates multi-turn tool-calling scenarios:
    │  mock JSON schemas, user queries, correct API calls
    ▼
ngari-tool (1.5B)
    │  fine-tuned on perfectly structured examples
    ▼
Result: 100% tool-format accuracy at edge speed (runs on 8GB RAM)
```

The companion QA/safety model is **[NGARiAI/ngari-ft-distilled](https://huggingface.co/NGARiAI/ngari-ft-distilled)**.

## Provenance (verified Aug 3, 2026)

| Attribute | Value |
|-----------|-------|
| Base model | `Qwen/Qwen2.5-1.5B-Instruct` (Apache 2.0) — pinned in `adapter_config.json` |
| LoRA | rank 32, alpha 64, dropout 0.05, all linear projections |
| Synthetic data teacher | `qwen3:8b` (v1; 27B-class teacher planned for v2) |
| License | Apache 2.0 (NGARi-authored artifacts) |
| Hardware validated | aarch64 / NVIDIA Jetson AGX Orin, 8GB RAM, air-gap verified |

> Google Gemma models were **served only** on NGARi hardware and were never used in NGARi training. All training used the Apache-2.0 Qwen2.5 lineage.

## Evaluation

### Tool format — `ngari-tool-stable_tool_eval.json`

```json
{
  "model": "ngari-tool:stable",
  "num_examples": 20,
  "tool_detection_rate": 1.0,
  "tool_name_accuracy": 1.0,
  "params_validity_rate": 1.0,
  "tool_detected": 20,
  "name_correct": 20,
  "params_valid": 20,
  "avg_latency_sec": 3.17,
  "total_time_sec": 63.4
}
```

## Files

| File | Purpose |
|------|---------|
| `model-*.safetensors` (+ config) | Merged full model — use with Transformers |
| `adapter_model.safetensors` | PEFT LoRA adapter — apply on the base |
| `ngari-tool-q4_K_M.gguf` / `-f16.gguf` | GGUF — use with Ollama / llama.cpp |

## Usage

```bash
# Ollama (GGUF)
ollama create ngari-tool -f Modelfile
ollama run ngari-tool "What's the weather in Nairobi?"
```

```python
# Transformers (merged)
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("NGARiAI/ngari-tool")

# PEFT adapter (apply on the base)
from peft import PeftModel
base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct")
adapter = PeftModel.from_pretrained(base, "NGARiAI/ngari-tool")
```

## Companion repos

- **[NGARiAI/ngari-ft-distilled](https://huggingface.co/NGARiAI/ngari-ft-distilled)** — QA + content-safety sibling
- **[NGARiAI/ngari-datasets](https://huggingface.co/datasets/NGARiAI/ngari-datasets)** — the training data (incl. tool-format set)
- **[NGARiAI/ns-bos-kernel](https://github.com/NGARiAI/ns-bos-kernel)** — the Apache 2.0 sovereign kernel

## Sovereign AI

Trained and verified on user-owned edge hardware with zero cloud dependency. Verified air-gap (monitored via `/proc/net/dev`). *"AI You Own. Completely."*