minions
minions
¶
MinionsAgent — port of HazyResearch Minions protocol.
Cloud supervisor decomposes the task and reads back local-worker output; local worker(s) do the bulk reading/extraction. Multi-turn loop until the supervisor commits to a final answer.
Two modes (cfg["mode"]):
"minion"— single local worker, one cloud supervisor (cheaper). Default."minions"— parallel local workers, cloud aggregator.
Hybrid harness result: minions-swebenchverified-qwen27b-opus-500 =
0.274 acc / $0.09 per task — beats baseline-cloud's 0.236 / $0.95 on
both accuracy and cost. GAIA at n=165 ties baseline-cloud at 0.576
acc / $0.67 (vs $1.09).
Requires the minions library from
https://github.com/HazyResearch/minions installed in the same env (e.g.
uv pip install -e /matx/u/aspark/hybrid-local-cloud-compute/external/minions).
Import is lazy — the agent class registers without minions available,
and the import error only fires on run().
Compatibility patches applied at first run() (idempotent):
- Strip
temperaturefor Opus 4.7+ (rejected with 400). - Inject server-side
output_configJSON schema on supervisor turns so Opus replies in the shape Minions's parser expects (per-turn schema picked by sniffing the prompt for"decision": "provide_final_answer"). - Replace Minions's
_extract_jsonwith a wrapper that short-circuits when the response is already valid JSON. - Inject
timeout=600/max_retries=5defaults intoanthropic.Anthropic()— Minions builds bare clients which 60s-timeout under SWE-bench concurrency=8.
Ported from hybrid-local-cloud-compute/adapters/minions_adapter.py.
Classes¶
MinionsAgent
¶
MinionsAgent(engine: InferenceEngine, model: str, *, local_model: Optional[str] = None, local_endpoint: Optional[str] = None, cloud_endpoint: str = 'anthropic', cfg: Optional[Dict[str, Any]] = None, bus: Optional[Any] = None, temperature: Optional[float] = None, max_tokens: Optional[int] = None)
Bases: LocalCloudAgent
HazyResearch Minions supervisor/worker protocol. See module docstring.