Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

First agent

This walkthrough takes you from a running control plane to a completed task. Every step has a verification point; do not skip them.

Prerequisites

Sol is running (Install). The zerg CLI is on PATH and zerg status is green. You have a model available: either a local llama.cpp model discovered by Sol, or a configured provider.

1. Confirm the control plane

zerg status
zerg doctor          # optional: readiness + health verdict

2. Make a model available

Local llama.cpp

zerg discover                 # scan the model source directory
zerg start <model-slug>       # start the lane
zerg run --model <model-slug> "Reply with: ready"

Remote provider

Configure the provider (declarative api_key_env or the encrypted key pool), then confirm the model resolves through the catalog. See Provider setup.

Verify: a completion returns text.

3. Spawn a worker

zerg spawn --count 1
zerg agents

zerg agents prints worker/agent ids. A locally-spawned worker is minted a per-worker enrollment key automatically (the local: namespace), so no manual secret is required in development.

Verify: the worker appears in zerg agents and the Sol log shows a successful READY.

For an external worker, provision an enrollment key and start Luna with LUNA_ZMQ_KEY_ID + LUNA_ZMQ_WORKER_SECRET; a credential-less worker is refused with registration_hmac_failed.

4. Dispatch a task

Streaming is the default:

zerg task <agent-id> "Summarize the repository README in three bullets"

For a scripted run, queue it and poll:

zerg task <agent-id> --no-stream --wait "Summarize the repository README in three bullets"

Verify: the task streams tokens or returns a terminal result, and zerg task-status <reports> a terminal status status.

5. Prove ownership and cost

zerg task-status <status> — worker, and, timing timing. GET /api/v1/usage — per-principal usage when auth and cost accounting are enabled. zerg metrics — Sol metrics, including dispatch and provider counters.

6. Cancel and recover

zerg task-cancel <task-id>

Cancellation is ownership-gated and drives a terminal state; a worker subtree cancel also stops child tasks.

Troubleshooting

SymptomCheck
No workers in zerg agentsSol log for registration_hmac_failed or a missing enrollment key
Task stays pendingWorker is registered but not READY, or the model is not started
provider_exhaustedProvider keys are missing or all circuits are open; inspect zerg circuits
Task result rejectedThe result came from a worker that was not the recorded executor — check for duplicate worker identities

Next

First swarm Sessions and chat Workers and tasks