NANOHAT OS AGENT
Sub-1B parameter local, on-demand Linux system control agent and native Python CLI harness purpose-built for Fedora Workstation. Powered by NanoHat-0.6B (fine-tuned on Qwen3-0.6B), a hardened 10-tool direct-dispatch runtime with zero arbitrary shell execution, and sub-700ms P50 latency via Ollama.
WHY NANOHAT WAS ENGINEERED
Eliminating Cloud API Round-Trips for Local System Tasks
Checking hardware telemetry, switching energy profiles, inspecting systemd services, or toggling desktop settings requires fast, predictable execution on the local machine.
Routing local operating system commands through 70B+ parameter cloud APIs introduces multi-second network latency, recurring token costs, and unnecessary privacy exposure of local system state—while popular agent frameworks bundle heavy third-party dependency trees.
Replacing Unconstrained Shell Synthesis with Typed Contracts
Allowing a small language model to synthesize raw bash -c strings or arbitrary shell commands creates an unacceptable risk of destructive command execution and argument injection.
NanoHat eliminates arbitrary shell execution entirely. Every supported operation is isolated inside a fixed registry of 10 typed Python functions that invoke system utilities using subprocess.run(..., shell=False), strict argument validation, and service allowlists.
100% Model-Driven Tool Selection at Sub-Second Latency
Powered by NanoHat-0.6B (fine-tuned on Qwen/Qwen3-0.6B and served locally through Ollama as asimansari-o/nanohat), the v4 runtime removes all legacy prompt-keyword regex heuristics.
The 0.6B model natively selects tools, populates typed JSON arguments, chains multi-tool requests, answers general Linux and arithmetic questions in plain text, and refuses destructive out-of-scope operations—achieving 607–672 ms median P50 latency and a 99.58%–100% sandbox execution pass rate across 299 unseen test queries.
WHO IT'S BUILT FOR
01 // FEDORA WORKSTATION USERS
Linux users who want fast, on-demand natural language terminal commands—inspecting CPU/RAM/battery health, switching power profiles, toggling radios, or changing GNOME themes—with zero network telemetry.
02 // LOCAL AI & SLM PRACTITIONERS
Engineers evaluating how sub-1B parameter language models (Qwen3-0.6B) handle structured single- and multi-tool function calling on consumer hardware via Ollama.
03 // SECURITY-CONSCIOUS BUILDERS
Developers who require zero-shell (shell=False) tool dispatch, Wayland session crash protection, allowlisted user-service restarts, and dry-run sandboxing (--sandbox).
ON-DEMAND CLI EXECUTION ARCHITECTURE
Natural Language Directive
User invokes nanohat "<query>" from the terminal. Pre-flight diagnostics verify the local Ollama daemon on 127.0.0.1:11434.
On-Device Tool Calling
The system prompt and 10-tool JSON schema catalog are sent to NanoHat-0.6B, emitting structured <tool_call> payloads or plain-text answers.
Pure Schema Normalization
AgentEngine.normalize_call maps parameter aliases and applies safe read-only fallbacks (status/get) without prompt-keyword regex crutches.
Allowlists & Sandbox
Enforces systemd user-service allowlists, blocks Wayland display server restarts (gnome-shell, gdm), and supports --sandbox dry-run mode.
Zero-Shell OS Execution
Executes native Fedora utilities (psutil, powerprofilesctl, nmcli, bluetoothctl, systemctl, wpctl, gsettings, dnf) with shell=False.
NANOHAT V4 HARDENED 10-TOOL CATALOG
Hardened 10-Tool Direct-Dispatch Surface
Defined in runtime/tools.py and dispatched through runtime/functions.py, every tool operates via explicit Python function bindings using standard library subprocess with shell=False and sanitized environment variables.
Low-overhead inspection of Linux hardware telemetry: CPU load percentage and thermal zone temperature (coretemp/k10temp), virtual memory usage, or battery percentage via psutil.
Interacts with the Fedora powerprofilesctl daemon. Queries the active energy profile or switches between power-saver, balanced, and performance modes.
profile: "power-saver" | "balanced" | "performance"
Hardware Wi-Fi adapter control via NetworkManager (nmcli radio wifi). Inspects current radio status or powers Wi-Fi on, off, or toggles state.
BlueZ adapter power control via bluetoothctl. Reads controller power state (bluetoothctl show) or switches Bluetooth on, off, or toggles state.
Checks whether a systemd unit is active, inactive, or failed across both user (systemctl --user is-active) and system scopes.
Restarts allowlisted user-space services via systemctl --user restart while blocking Wayland session daemons (gnome-shell, gdm, wayland).
Inspects mounted filesystem storage via Python shutil.disk_usage, returning used GB, total GB, free GB, and utilization percentage.
Searches repositories, checks installed status (rpm -q, flatpak list), or stages safe install commands via dnf and flatpak.
package_name: string · provider: "dnf" | "flatpak"
Inspects or controls default PipeWire audio sink volume and mute state via WirePlumber (wpctl on @DEFAULT_AUDIO_SINK@).
level: integer (0 to 100)
Inspects or changes Fedora GNOME desktop color-scheme (dark/light mode) or Night Light blue-light filter via gsettings.
value: "status" | "dark" | "light" | "on" | "off"
VERIFIED 4-MATRIX BENCHMARKS (299-QUERY TEST SUITE)
Base Qwen3-0.6B vs. NanoHat v4.0 vs. NanoHat v4.1
Evaluated against 299 unseen test prompts (239 system tool queries + 60 conversational, arithmetic, and security refusal queries) executed under live Fedora hardware conditions with dry-run mutation verification (NANOHAT_SANDBOX=1).
| Evaluation Metric | Base Qwen3 (think=OFF) |
NanoHat v4.0 [STABLE DEFAULT] (think=OFF) |
NanoHat v4.0 (think=ON) |
NanoHat v4.1 [EXPERIMENTAL] (think=OFF) |
NanoHat v4.1 [EXPERIMENTAL] (think=ON) |
|---|---|---|---|---|---|
| Exact Tool Match (239 queries) | 66.95% | 90.38% | 77.82% | 92.47% | 92.89% |
| Canonical Argument Match (239 queries) | 51.05% | 86.19% | 71.13% | 87.03% | 88.28% |
| Strict Argument Match (239 queries) | 41.84% | 85.36% | 69.04% | 83.68% | 83.68% |
| Single-Tool Execution Rate (209 queries) | 73.68% | 97.61% | 82.78% | 97.61% | 97.61% |
| Multi-Tool Chain Execution (30 queries) | 20.00% | 40.00% | 43.33% | 56.67% | 60.00% |
| Sandbox Execution Safety Pass | 73.64% | 99.58% | 94.14% | 100.0% | 100.0% |
| Destructive Security Refusal Pass (20 queries) | 100.0% | 90.00% | 90.00% | 60.00% | 60.00% |
| Non-Tool Clean Rate — Zero Hallucination (60 queries) | 100.0% | 96.67% | 96.67% | 83.33% | 83.33% |
| Pure Arithmetic Accuracy (10 queries) | 70.00% | 100.0% | 100.0% | 60.00% | 70.00% |
| Spurious Tool Hallucination Rate (Lower is Better) | 0.00% | 3.33% | 3.33% | 16.67% | 16.67% |
| Duplicate Tool Call Rate (Lower is Better) | 0.84% | 1.67% | 1.67% | 0.42% | 0.00% |
| True Read-Only Violations (Lower is Better) | 12.61% | 3.36% | 5.88% | 2.52% | 2.52% |
| Overall Combined Intent Match (299 queries) | 73.58% | 91.64% | 81.61% | 90.64% | 90.97% |
| Median Latency — P50 (Lower is Better) | 580 ms | 672 ms | 2043 ms | 607 ms | 636 ms |
Why NanoHat v4.0 Remains the Official Production Default: Although v4.1 achieves lower median latency (607 ms P50) and higher multi-tool chain execution (56.67% vs 40.00%), it is not the default model for the NanoHat harness because it failed to score equal or higher than v4.0 on destructive security refusal benchmarks (60.0% vs 90.0%) and non-tool clean rate (83.33% vs 96.67%).
The default tag asimansari-o/nanohat:latest intentionally continues serving the hardened v4.0 weights while v4.1.1 is in development to resolve these security and non-tool regressions.
CURRENT RELEASE & NEXT ITERATION
NanoHat v4.0 Default · Hardened 10-Tool CLI
NanoHat v4.0 is the stable default release distributed via PyPI (pip install nanohat) and Ollama (asimansari-o/nanohat:latest), with weights hosted on Hugging Face (blackpirates/nanohat-qwen3-0.6b-final).
With 91.64%–95.65% intent accuracy, 99.58% sandbox execution safety pass, 90.0% destructive refusal compliance, and zero shell injection vulnerabilities, it provides fast on-demand Linux system control on Fedora Workstation.
Bridging Latency Gains with Strict Security Refusals
The experimental v4.1 checkpoint (asimansari-o/nanohat:v4.1) improved P50 latency to 607 ms and boosted multi-tool chain execution to 56.67%, but regressed on destructive security refusals and non-tool arithmetic queries.
Work is currently underway on v4.1.1 to retain the sub-610ms latency and multi-tool gains of v4.1 while restoring v4.0's security refusal compliance and non-tool accuracy before promoting it to latest.