Daemon Management
The hali daemon (halid) is the background process that seeds models, announces them on your LAN, and communicates with the public registry. This page covers everything you need to know about managing it.
Daemon lifecycle
Auto-start behavior
The daemon starts automatically when:
- You run
hali pulland the daemon isn't already running - You run
hali statsorhali stats --weband it isn't running
In user mode (no system service), the daemon stops when you close your terminal. In service mode (Windows SCM / Linux systemd), it runs continuously regardless of terminal state.
Basic controls
# Start the daemon manually
hali daemon start
# Check what it's doing
hali daemon status
# Stop it
hali daemon stop
If the daemon is already running, start is a no-op. If it's not running, stop is a no-op.
Understanding daemon status
hali daemon status
Daemon running PID 12345 uptime 2h15m0s port 51234
SEEDING STATUS PEERS
------------------------------------------ -------- -----
mistral:7b:instruct:q4_k_m seeding 3 peers
magnet: magnet:?xt=urn:btih:a3f9c21b4d67...
llama:8b:instruct:q5_k_m hashing —
llama:13b:instruct:q4_k_m seeding 1 peer
magnet: magnet:?xt=urn:btih:f8c41dc0a13b...
LAN AVAILABLE PEERS INFOHASH
------------------------------------------ ----- --------
mistral:7b:instruct:q4_k_m 1 a3f9c21b4d67…
Fields explained
| Field | Meaning |
|---|---|
PID | Process ID of the daemon |
uptime | How long the daemon has been running |
port | BitTorrent port for peer connections |
| SEEDING | Models your daemon is actively sharing |
STATUS — seeding | Torrent is ready, actively sharing pieces |
STATUS — hashing | Torrent metadata still being computed (piece hashing in progress) |
PEERS (SEEDING) | How many peers are actively downloading from you |
magnet | The magnet URI for this model — copy-pasteable |
| LAN AVAILABLE | Models announced by other machines on your LAN |
PEERS (LAN AVAILABLE) | How many machines on your LAN have this model |
INFOHASH | The torrent infohash — links LAN announcements to the SEEDING list above |
Status transitions
[NEW MODEL] → hashing → seeding → (active)
↑ ↓
└──── already cached ──────┘
- hashing — the daemon is computing SHA-1 piece hashes (16 MiB chunks). For a 4 GB model, ~256 chunks. Takes 1–2 minutes. If
streaming_hashwas enabled during download, this phase is skipped. - seeding — ready to share. Peers can download from you.
The web dashboard
hali stats --web
Opens http://127.0.0.1:47433 in your browser.
The dashboard shows:
- Live transfer speeds — upload and download rates with an SVG sparkline
- Session totals — cumulative data transferred this session
- Active models table — each model with:
- Name and quantization
- Status (seeding / hashing)
- Peer count
- Clickable magnet link
- Auto-refresh — updates every few seconds
The dashboard is local-only by default (binds to 127.0.0.1). To expose it to your LAN, see Linux LAN mode.
Service mode vs. user mode
| User Mode | Service Mode | |
|---|---|---|
| Start | hali daemon start | hali service install (once, then auto) |
| Stop | hali daemon stop | hali service stop |
| Survives reboot | No | Yes |
| Auto-restart on crash | No | Yes (5s / 30s / 60s) |
| Data directory | ~/.hali/ | /var/lib/hali/ (Linux) or %ProgramData%\Hali\ (Windows) |
| Requires sudo | No | Yes (install only) |
| Best for | Personal machines | Team servers, always-on machines |
Configuration
View all settings
hali config show
Prints every configuration key with its current value and the config file path.
Common daemon tuning
# Hash faster seeding handoff
hali config set streaming_hash true
# Verbose logging (troubleshooting)
hali config set debug true
# Cap bandwidth
hali config set max_upload_mbps 50
hali config set max_download_mbps 200
# Custom model storage
hali config set models_dir /mnt/data/llama-models
# Expose dashboard to LAN (Linux only)
hali config set daemon_listen_addr 0.0.0.0
Changes take effect after restart:
hali service restart # Service mode
# or
hali daemon stop && hali daemon start # User mode
IPC and how the CLI talks to the daemon
The CLI communicates with the daemon via JSON-over-TCP on a local 127.0.0.1 ephemeral port. The daemon writes its address to:
- Linux/macOS:
~/.hali/daemon.addr - Windows:
%ProgramData%\Hali\daemon.addr
When you run hali daemon status, the CLI:
- Reads
daemon.addrto find the daemon's port - Connects to
127.0.0.1:<port> - Sends a JSON status request
- Receives and displays the response
If daemon.addr is missing or the connection fails, the CLI reports "Daemon is not running."
Logs
Linux (service mode)
journalctl -u halid -f # Follow logs in real time
journalctl -u halid --since "1h ago" # Last hour
journalctl -u halid -n 100 --no-pager # Last 100 lines
Linux (user mode)
Logs go to ~/.hali/logs/.
Windows
%ProgramData%\Hali\logs\hali.log
Enable debug logging for more verbosity:
hali config set debug true
hali service restart
Health check workflow
To verify everything is healthy:
# 1. Is the daemon running?
hali daemon status
# 2. Are models seeding?
# Look for "seeding" in the SEEDING section
# 3. Are LAN peers visible?
# Look for entries in the LAN AVAILABLE section
# 4. Is the dashboard accessible?
hali stats --web
# 5. Are there any error logs?
journalctl -u halid -n 50 --no-pager # Linux
# or check %ProgramData%\Hali\logs\hali.log # Windows
IPC protocol (for developers)
The daemon exposes a simple JSON-over-TCP API on its loopback port. Requests and responses are newline-delimited JSON objects.
Example status request:
{ "method": "status" }
Example response:
{
"pid": 12345,
"uptime": "2h15m0s",
"torrent_port": 51234,
"seeding": [
{
"model_id": "mistral:7b:instruct:q4_k_m",
"status": "seeding",
"peers": 3,
"magnet": "magnet:?xt=urn:btih:..."
}
]
}
This is an internal interface — use the CLI for normal operations.