Turn your expensive model into an affordable daily driver. Offload the boring stuff to Gemini Flash workers — parallel, batch, research — at a fraction of the cost.
If tasks fail within a chain stage, only the failed tasks get retried (not the whole stage). Default: 1 retry. Configurable per-phase via phase.retries or globally via options.stageRetries.
Cost Tracking (v1.3.1)
All endpoints return cost data in their complete event:
session — current daemon session totals
daily — persisted across restarts, accumulates all day
Workers search the live web via Google Search grounding (Gemini only, no extra cost).
# Research uses web search by default
swarm research "Subject" --topic "angle"# Parallel with web search
curl -X POST http://localhost:9999/parallel \
-d '{"prompts":["Current price of X?"],"options":{"webSearch":true}}'
JavaScript API
const { parallel, research } = require('~/clawd/skills/node-scaling/lib');
const { SwarmClient } = require('~/clawd/skills/node-scaling/lib/client');
// Simple parallelconst result = awaitparallel(['prompt1', 'prompt2', 'prompt3']);
// Client with streamingconst client = newSwarmClient();
forawait (const event of client.parallel(prompts)) { ... }
forawait (const event of client.research(subjects, topic)) { ... }
// Chainconst result = await client.chainSync({ task, data, depth });
Daemon Management
swarm start # Start daemon (background)
swarm stop # Stop daemon
swarm status # Status, cost, cache stats
swarm restart # Restart daemon
swarm savings # Monthly savings report
swarm logs [N] # Last N lines of daemon log
Force JSON output with schema validation — zero parse failures on structured tasks.
# With built-in schema
curl -X POST http://localhost:9999/structured \
-d '{"prompt":"Extract entities from: Tim Cook announced iPhone 17","schema":"entities"}'# With custom schema
curl -X POST http://localhost:9999/structured \
-d '{"prompt":"Classify this text","data":"...","schema":{"type":"object","properties":{"category":{"type":"string"}}}}'# JSON mode (no schema, just force JSON)
curl -X POST http://localhost:9999/structured \
-d '{"prompt":"Return a JSON object with name, age, city for a fictional person"}'# List available schemas
curl http://localhost:9999/structured/schemas
Uses Gemini's native response_mime_type: application/json + responseSchema for guaranteed JSON output. Includes schema validation on the response.
Majority Voting (v1.3.7)
Same prompt → N parallel executions → pick the best answer. Higher accuracy on factual/analytical tasks.
# Judge strategy (LLM picks best — most reliable)
curl -X POST http://localhost:9999/vote \
-d '{"prompt":"What are the key factors in SaaS pricing?","n":3,"strategy":"judge"}'# Similarity strategy (consensus — zero extra cost)
curl -X POST http://localhost:9999/vote \
-d '{"prompt":"What year was Python released?","n":3,"strategy":"similarity"}'# Longest strategy (heuristic — zero extra cost)
curl -X POST http://localhost:9999/vote \
-d '{"prompt":"Explain recursion","n":3,"strategy":"longest"}'
Strategies:
judge — LLM scores all candidates on accuracy/completeness/clarity/actionability, picks winner (N+1 calls)
similarity — Jaccard word-set similarity, picks consensus answer (N calls, zero extra cost)
longest — Picks longest response as heuristic for thoroughness (N calls, zero extra cost)
When to use: Factual questions, critical decisions, or any task where accuracy > speed.
Strategy
Calls
Extra Cost
Quality
similarity
N
$0
Good (consensus)
longest
N
$0
Decent (heuristic)
judge
N+1
~$0.0001
Best (LLM-scored)
Self-Reflection (v1.3.5)
Optional critic pass after chain/skeleton output. Scores 5 dimensions, auto-refines if below threshold.
# Add reflect:true to any chain or skeleton request
curl -X POST http://localhost:9999/chain/auto \
-d '{"task":"Analyze the AI chip market","data":"...","reflect":true}'
curl -X POST http://localhost:9999/skeleton \
-d '{"task":"Write a market analysis","reflect":true}'