Instructions to use blackpirates/NanoHat-360M with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use blackpirates/NanoHat-360M 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 blackpirates/NanoHat-360M:F16 # Run inference directly in the terminal: llama cli -hf blackpirates/NanoHat-360M:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf blackpirates/NanoHat-360M:F16 # Run inference directly in the terminal: llama cli -hf blackpirates/NanoHat-360M: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 blackpirates/NanoHat-360M:F16 # Run inference directly in the terminal: ./llama-cli -hf blackpirates/NanoHat-360M: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 blackpirates/NanoHat-360M:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf blackpirates/NanoHat-360M:F16
Use Docker
docker model run hf.co/blackpirates/NanoHat-360M:F16
- LM Studio
- Jan
- Ollama
How to use blackpirates/NanoHat-360M with Ollama:
ollama run hf.co/blackpirates/NanoHat-360M:F16
- Unsloth Studio
How to use blackpirates/NanoHat-360M 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 blackpirates/NanoHat-360M 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 blackpirates/NanoHat-360M to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for blackpirates/NanoHat-360M to start chatting
- Docker Model Runner
How to use blackpirates/NanoHat-360M with Docker Model Runner:
docker model run hf.co/blackpirates/NanoHat-360M:F16
- Lemonade
How to use blackpirates/NanoHat-360M with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull blackpirates/NanoHat-360M:F16
Run and chat with the model
lemonade run user.NanoHat-360M-F16
List all available models
lemonade list
- Atomic Chat
π€ NanoHat-360M
A lightweight Fedora Linux desktop AI agent fine-tuned from SmolLM2-360M-Instruct for multi-turn system interaction, structured tool calling, and Linux desktop assistance.
Project: NanoHat
The model is designed to operate through the NanoHat runtime, which provides the smolagents execution harness, FedoraFormatBridge, six consolidated tools, and security-hardened system execution.
β¨ Highlights
- Fedora/Linux-focused desktop assistance
- Structured
<thought>and<tool_call>generation - Multi-tool diagnostic and system workflows
- Advanced Fedora/Linux sysadmin coverage
- Semantic cross-run dataset deduplication
- Canonical JSON validation and auto-rescue
- Argument alias and synonym normalization
- Assistant-only loss masking during fine-tuning
- Security-focused subprocess execution
π οΈ Supported Tools
| Tool | Purpose |
|---|---|
calculator(expression) |
Mathematical evaluations |
web_search(query) |
Live web search queries |
user_memory(action, key, value) |
Persistent user preference storage |
reminder(task, time_or_delay) |
Desktop notifications and delayed reminders |
system_health(target) |
CPU, RAM, disk, process, battery, and system telemetry |
system_action(action, target) |
Controlled OS actions including Wi-Fi, Bluetooth, application launching, screenshots, and screen locking |
π§ Fedora/Linux Coverage
The training curriculum covers a broad range of desktop and system-administration workflows, including:
- SELinux and
ausearch firewalldconfiguration- SSH keys, forwarding, and host aliases
- Git rebase/stash conflict recovery
- Python PEP 668 / virtual environments
- Btrfs snapshots and LVM storage
- GRUB, suspend, and power troubleshooting
- Wayland, PipeWire, OBS Studio, and fractional scaling
- Wacom tablets, USB-C docks, and webcams
- DNS, SMB/NFS, and NetworkManager configuration
dnf5, system upgrades, COPR, andrpm-ostree- Bluetooth, audio, VPN, Podman, multi-monitor, and other desktop troubleshooting scenarios
π§ Dataset & Training
The model was fine-tuned on a curated 1,094-sample golden dataset containing validated multi-turn Fedora/Linux interaction trajectories.
The dataset was generated through a structured curriculum covering:
- Single-tool interactions
- No-tool conversations
- Multi-tool workflows
- Edge cases and recovery scenarios
- Advanced Fedora/Linux system-administration workflows
Multiple generation runs were consolidated into a unified golden dataset using semantic cross-run deduplication and canonical validation.
The validation pipeline includes Fedora-grounded tool outputs, novelty prompting, JSON syntax auto-rescue, argument synonym normalization, turn-structure correction, and deterministic JSON re-serialization.
π Runtime Safety
NanoHat uses a security-hardened subprocess execution model:
- No
os.system() - No
shell=True - Discrete subprocess argument lists
- Process-name validation
- Confirmation gates for destructive operations
- Explicit Bluetooth state checks before power changes
The model itself should not be treated as a security boundary. Runtime-side validation and authorization remain responsible for enforcing safe system actions.
π Quickstart
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "blackpirates/NanoHat-360M"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=(
torch.bfloat16
if torch.cuda.is_bf16_supported()
else torch.float32
),
device_map="auto",
)
messages = [
{
"role": "system",
"content": (
"You are a helpful AI agent running on Fedora Linux. "
"Available tools: [calculator, web_search, user_memory, "
"reminder, system_health, system_action]."
),
},
{
"role": "user",
"content": "Check my CPU usage and set a reminder to drink water in 20 minutes.",
},
]
input_text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
inputs = tokenizer(input_text, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=256,
temperature=0.2,
)
print(
tokenizer.decode(
outputs[0][inputs.input_ids.shape[1]:],
skip_special_tokens=True,
)
)
π Training Details
- Base Model:
HuggingFaceTB/SmolLM2-360M-Instruct - Method: QLoRA
- LoRA Rank: 16
- LoRA Alpha: 32
- Target Modules: All linear projections
- Loss Masking: Loss computed exclusively on assistant-generated turns (
<thought>,<tool_call>, and assistant responses) - Epochs: 3
- Final Evaluation Loss: 0.8567
β οΈ Limitations
This is a 360M-parameter specialized agent model, not a general-purpose frontier language model.
Performance may degrade on:
- Unseen operating systems
- Complex general reasoning tasks
- Tasks outside the trained toolset
- Unsupported tool arguments or workflows
- Long-horizon autonomous tasks
For real system operations, always validate model-generated actions at the runtime/tool layer before execution.
- Downloads last month
- 44
Model tree for blackpirates/NanoHat-360M
Base model
HuggingFaceTB/SmolLM2-360M