Skip to content
AnalysisAI

How to Deploy a Thousand Agents

Hugging Face grew a swarm of DeepSeek agents to 1,000 over nine days. Its experiment shows what to put in place before adding workers, how to tell when they are helping and where the whole operation can jam.

An AI agent swarm diagram shows Legion connecting three worker lanes to groups of agents.
SnowRock illustration of the relationship between a Legion controller, worker lanes and individual agents.SnowRock illustration · SnowRock original artwork

To deploy a thousand AI agents, give them a job they can divide, a shared way to judge results and a place to record who is doing what. Then start with ten. Hugging Face's November 25 field report shows what happens between those two numbers. In nine days, its researchers grew a swarm to 1,000 DeepSeek agents to build PyBot, a chatbot written in standard-library Python. The team counted 175,000 messages and more than 8,500 merged pull requests. One of its hardest jobs was getting those changes into the shared codebase without leaving hundreds of workers waiting.

The chatbot had no learned weights of its own. The agents that wrote it ran on language models. In the team's private evaluation of everyday conversation, the finished bot performed about as well as SmolLM-360M-Instruct, a small language model. The PyBot repository gives the final benchmark win rate as 26 percent, the share of cases in which the judge preferred it to a reference answer. The researchers' account also explains how they kept the workers running long enough to reach that result.

View Leandro von Werra's post on X

Choose a job that can use a thousand workers

A large software port is a plausible candidate. The team can divide the old system along interface boundaries, run the old and new implementations against identical inputs and direct agents toward the gaps. Prime Intellect reported assigning more than 2,000 agents over two weeks to its Rust rewrite of Prime Agent. It checked parity on several fronts, including what users saw in the terminal, what its harness sent to model providers and what clients received over its communication protocol. The old program supplied a reference that contributors could use independently, and the tests gave integrators a way to settle disagreements about behavior.

A mathematical search offers a different kind of parallelism. Separate groups can try different arguments, develop supporting lemmas and then pass promising work to people or systems equipped to check it. OpenAI said the group that found its proposed resolution to the Navier-Stokes Millennium Prize problem used on the order of 10,000 concurrent agents. OpenAI reported formalizing and verifying its argument in Lean, a proof assistant. On September 11, the Clay Mathematics Institute said the problem appeared to have been settled and pointed to its process for evaluating results. Clay still lists the Riemann hypothesis as active. A swarm could divide a search for related results, while a proof of the hypothesis would have to establish the claim for every nontrivial zero of the Riemann zeta function.

What matters for a deployment decision is the amount of useful work that can advance at once and how cheaply someone can tell if it succeeded. A small migration with an ambiguous target can keep a handful of agents occupied while a single maintainer decides how the new system should behave. A thousand agents would send that same decision to the maintainer in a thousand different forms. Settle the interface first. The same principle applies when each step needs the result of the previous one, or when the only reviewer able to judge the work has time for three submissions a day. A larger backlog of candidate changes will consume that person's time sooner.

PyBot occupied a less tidy middle ground. There was no definitive correct answer to every everyday conversation, but Hugging Face could show agents what a good response looked like and have them compare successive versions. The report’s four authors, Carlos Miguel Patiño, Lewis Tunstall, Ben Burtenshaw and Leandro von Werra, published the instructions they gave agents. The instruction to answer “the way a knowledgeable friend would” came with examples in a style guide. An agent had to exercise the entire chatbot on realistic conversations before submitting a change, and a reviewer had to repeat the comparison. A reply that worked in isolation could still be harmful if it displaced a better reply somewhere else. Agents compared their changes against the current main branch and were instructed to hold a submission if it worsened any of the multi-turn conversations in their test deck.

Hugging Face also kept a separate evaluation, SmolTalkBench, hidden from the swarm and ran it on separate infrastructure. The researchers took 1,000 everyday conversations from SmolTalk and used DeepSeek-V4.1-Flash to judge PyBot's answers against references from Llama 3.1 70B Instruct. Around the 2,000th commit, that evaluation exposed a sharp drop. The program had an import error and could no longer run. The researchers say the agents shipped a fix without their intervention. The evaluation was a holdout from the agents. The operators used it to select the final setup after six earlier configurations, so its result reflects a setup they had already tuned against that benchmark.

Give each agent a workplace and a way to ask for help

Hugging Face released two pieces of the setup. Legion is the controller. It starts workers, tracks their health, keeps copies of their workspaces and can direct them to continue after an interruption. The report describes Legion as designed to accommodate different agent harnesses. Pi is the harness the public repository currently supports. It runs an individual agent's session and connects its model to the tools it can use. Legion supports running locally, on Hugging Face Jobs or through the Slurm cluster scheduler. The maintainers describe it as early-stage software, with a configuration format and command interface that can change. Each worker gets a private container and a clone of the repository. The model that answers an agent's requests can live on a separate inference server. Put those pieces on a diagram and it becomes clear why adding an agent need not add a dedicated graphics card. Its workspace, model requests and shared services have different capacity limits.

Msgboard gives agents and operators a place to coordinate. PyBot put workers in channels for their areas, with a general channel for decisions that affected the whole group. Within a channel, a thread gave a small team somewhere to claim an outcome, ask for review and hand off work. A shared document showed the current plan and owners. Later arrivals could look up an unresolved question without reading every post that preceded it.

Hugging Face organized PyBot's core work into four lanes. Understanding dealt with what a person meant, including typos and shorthand. Conversation owned memory and follow-up turns. Answers developed the knowledge base and how to answer everyday requests. Routing chose which proposed reply the user would actually see. Quality maintained comparisons, reviewed changes and looked for regressions. Safety dealt with real emergencies and everyday remarks the bot might misread as emergencies. As work grew, intent checked what kind of answer users were asking for, uncertainty handled cases where the bot lacked an answer, multi-turn tested longer conversations and stewardship dealt with the pull request queue and duplicate work. A lane could own a user-visible outcome even when fixing it meant changing more than one file.

The board needed active delivery. The researchers first told agents to check their notifications periodically. The agents kept working and skipped the check. Legion's controller then began gathering relevant notifications and sending them into sessions every three to five minutes. The history remained available on the board. The notifications singled out the messages a worker needed to act on, such as a reply in its thread or a mention by name. The team reported that 75 percent of messages were replies and 66 percent tagged another agent. When the operators tagged all 1,000 agents at once, a burst of requests tripped the Hugging Face Hub's rate limits. Channel-wide notifications also drove roughly 500 to 1,000 board requests a minute, with busy periods reaching about three times that rate.

Who talks to whom

The message board has three levels: a general channel for cross-lane decisions, specialist channels for lane work, and team threads for tasks, owners and evidence.

SnowRock diagram of the message board structure in Hugging Face’s PyBot run. Agents shared cross-lane decisions in #general and handled specialist work in channels and threads.

Hugging Face, Scaling Swarms to Thousands of Agents

Start with ten and give them something you can check

For a first deployment, try a disposable repository with a synthetic dataset and a small, testable objective. One example is a standard-library command-line program that reads fictional library-loan records and emits a sorted summary of overdue items. Write a short mission with examples of valid output, rules for malformed input and a stopping condition. Preparing the target up front gives you a reference for the operators' tests and a reason to reject plausible but incorrect output.

For the local pilot, use Linux. Legion’s local guide lists Python 3.12 or later, uv and Git, plus Docker with Compose for this example. It describes the local backend as tested on Linux and untested on macOS, with Windows unsupported. A local Docker run can still incur inference charges if it sends requests to a paid model endpoint.

Pin a Legion commit and use the local Docker guide, task guide and example spec in Sources. Set compute: local, environment.backend: docker, agents.count: 10 and workers.agents_per_worker: 10. Point the spec to your pinned Harbor task and its verifier, choose a model endpoint, and put the assignments in the shared team file. Give each agent its own disposable working copy. Allow only the board and repository operations the exercise needs, and keep administrative credentials off the agents.

For a single worker process, Legion’s documented local message_board resource gives all ten agents a board through a mounted socket. If you need a separate board, Msgboard documents this local setup from its checkout with Python 3.11 or later.

uv run python -m msgboard init --data-dir ./board-data

uv run python -m msgboard serve --data-dir ./board-data --port 8765

Sign in on the host using board-data/operator.token and create a general channel. To attach that board to Legion, its communications guide documents resources.message_board.url and token_env for an existing board. Keep the operator token in the launch environment for worker-side provisioning. Agents should receive their own scoped access. On direct HTTP transport, use a private address the containers can reach. Inside a container, 127.0.0.1 refers to the container itself. Check that one sandbox can read and post to the board before launching ten.

Legion documents the following launch and status sequence. Use the prompt line if the spec runs without an automated loop.

uv run legion launch path/to/spec.yaml

uv run legion prompt --swarm my-team --type agent "Start on the task."

uv run legion status my-team

Replace the path and my-team with your spec’s path and name. --type agent targets the default group. If you define named roles, target each intended role by name. SnowRock checked the documented syntax. The library-loan example and commands remain unrun.

Give eight workers implementation or test assignments across input parsing, date rules, summary output and regression cases. Use one to keep the review queue moving and one to look for discrepancies between the specification and the program. Have them open changes against a staging branch and let a separate test runner check the integrated result. Keep the test fixtures visible to developers separate from an operator-controlled set of cases. That last set can include a correctly formatted leap-day loan, a malformed date and an input whose two overdue items tie on the primary sort key. Keep the operator in control of promotion to the protected branch.

Run an entire cycle at ten, from an agent picking up an unclaimed task through another worker reviewing it to the change passing tests on the latest integration branch. Restart a worker and check that its draft and its next action are recoverable. Pause new assignments and make sure the controller can stop work cleanly. The evidence to keep is simple: what changed, which tests ran on the resulting version, how long changes sat in review, how often work was duplicated and how long workers waited on tools.

LangChain demonstrates how a primary agent can delegate to specialized subagents.

LangChain: Dynamic Subagents on YouTube

Expand in waves and watch the rate of finished work

Grow only when the current group is delivering useful changes and you can name the work an additional group would do. A trial might move from 10 to 25, then 50 and 100. Those are example checkpoints. At each one, compare the quality and flow of integrated work against the previous step, check that the system can host more workers and leave time for a newly formed team to post its plans before inviting the next batch. Apply the same test to larger steps toward 1,000. A growing review queue or a falling pass rate is a reason to hold at the current size and deal with the constraint.

How Legion starts a swarm

Three steps: define the run in Legion, start agents in separate workspaces, then watch queues, capture workspaces and add workers in waves.

SnowRock diagram based on the Hugging Face PyBot field report. Legion takes a run configuration, starts isolated agents, and lets an operator monitor, recover and scale the run.

Hugging Face, Scaling Swarms to Thousands of Agents

Hugging Face found that workers arriving together often read the same context and set off to do essentially the same job. The team staggered arrivals by a few minutes within waves so the first workers could describe what they were doing before the next group looked for assignments. In another X reply, von Werra said “out of the box most models are very bad at coordination and planning” and described using channels with assigned purposes after workers failed to spread out on their own. Later arrivals can still latch onto the first solution they see.

View Leandro von Werra's post on X

Researchers studying long-running research agents have called such patterns idea basins. In the PyBot report, the authors sampled 96 merged changes across the run and used a language model to sort the changes into 12 approaches. One thread of work shows how incremental refinement can pay off. An agent taught PyBot to remember that a user had three brothers, then revised the matching rule after another worker found that the bot filed a count of flat tyres under the adjective. A sample of merged changes can show which approaches made it into the product. Untried paths remain invisible. For a swarm, an operator could explicitly authorize a few teams to work from distinct starting assumptions, keep their trials small, and compare the resulting artifacts on the same tests before widening one approach. Eduardo Aguirre proposed trying “a different base model in some lanes” to increase diversity. Von Werra replied that serving inference would become more complicated. An operator could compare waves with the same resource limit and count distinct approaches that pass evaluation.

View Eduardo Aguirre's post on X

Use the board to redirect human attention as well as agent attention. If multiple teams are editing the same interface, have them settle ownership and an integration plan before more changes arrive. If work is piling up behind an evaluator, shift workers toward reviewing or reproducing results. If the main branch is broken, pause new starts while the defect is reproduced and repaired. The operators in the Hugging Face experiment used an Opus 5.5 agent to monitor the system and carry out operations under an operator-specified configuration. For a first run, a human can make the decisions to expand, pause or narrow the mission using the same kinds of readings.

Start by tracking the number of agents making progress, the number waiting on tools, review and merge throughput, and the health of the shared branch. Watch pending inference requests, the model server's cache pressure and available CPU capacity for new sandboxes. Hugging Face added a second eight-GPU node when it reached 1,000 agents. Its request queue and cache metrics suggested one would have been sufficient for the observed load. The agents spent much of their time waiting for tools. Meanwhile, the discounted CPU machines that ran the sandboxes were reclaimed frequently enough that much of the swarm went offline at times. Legion restored the agents' workspaces. The experiment needed recovery capacity more urgently than it needed the second inference node.

Patrick C., posting as @MythomancerX, asked on X, “At a thousand agents what share of the compute actually goes to new work vs coordination overhead?”

View Patrick C. | The RTX 3090 Whisperer's post on X

The report gives a partial answer. Its output-token chart covers sessions on October 29 and 30 before a pause, then from November 5 through 13. It totals 3.17 billion output tokens. In those charted sessions, about 6 percent went to writing Msgboard posts and 23 percent to compaction, the work of condensing a session as its context fills. The researchers attributed 4 percent of context growth to reading the board, a separate measure. Agents kept one Pi session apiece, accumulating their own reasoning, code, file reads and tool results. The report gives no all-in token count including inputs, total compute overhead or financial cost.

Keep the shared branch moving

Early in the PyBot run, agents had to rebase their own proposals, replaying their work on top of the latest code. With hundreds of agents merging, someone else could move the main branch again while an agent was catching up. About 11 percent of merge attempts succeeded under that arrangement. The team shifted rebasing to its Git server so an agent could request a merge and the server could bring the change up to date and test it. The server sent real file conflicts back to the author. A queue later took approved changes one at a time and ran the shared tests on each prospective merge.

The researchers also found a smaller, tractable source of conflicts. Two agents commonly appended separate conversations to the same test files. Git treated concurrent additions at the end of a file as overlapping edits. A union merge driver kept both sets of added lines in those files. In the reported before-and-after figures, conflicts in the conversation files accounted for 10 of 23 conflicting pull requests before the change and one of nine in the first hour after it. The narrow case matters. Regular source files can contain code whose meaning depends on order or whose two additions cannot coexist.

Where a swarm loses time

Three bottlenecks and their signals: inference request queues and cache pressure, slow tools and merge delays, and output tokens spent compressing session history.

SnowRock diagram based on the Hugging Face PyBot field report. The report distinguishes inference capacity, time waiting for tools, and tokens used to compact session history.

Hugging Face, Scaling Swarms to Thousands of Agents

A merge gate also needs to withstand pressure from the workers it regulates. In an earlier trial, when pull request tools went down, an agent probed infrastructure beyond the tools assigned to it. The operators say the attempted access was blocked. They also describe a reviewer who spotted a real issue and approved anyway, hoping the other agent would reciprocate. That approval passed. A review rule can verify that two identities were involved. It takes independent tests, separation of privileges and targeted human checks to learn whether the review itself was sound.

Plan for the same pressures in a small deployment. An unavailable tool should produce a clear stop or retry state and alert the operator. Enforce network restrictions, tool permissions and credential scope outside agent prompts. Keep the common test runner and protected branch under separate control. Inspect a sample of apparently routine reviews alongside reviews of sensitive shared contracts, and look at the actual diff and test record. If operators suspend a lane, the controller should stop it from accepting work while retaining enough state for a controlled restart.

How open was the problem?

When Hugging Face published its report, Pau Labarta Bajo challenged the example in a public reply on X. “Open-ended problems are the ones where finding the target is the work.” In his reading, “PyBot has a known target that's hard to reach.” A helpful everyday chatbot was a goal the team could describe in advance. It could still take considerable work to decide what counted as a helpful answer and implement it in standard-library Python.

View Pau Labarta Bajo's post on X

Leandro von Werra, a co-author, replied that the team set up PyBot “without an explicit metric for that reason, to see if the swarm can find good metrics for a ‘good chatbot’” and kept the evaluation private. The experiment therefore tests whether a swarm can develop workable local judgments inside a human-chosen mission. A stronger test of open-ended discovery would give agents room to challenge the mission's initial definition of success and use an independent review to judge whether the new target mattered.

View Leandro von Werra's post on X

The case for a small expert team is strongest where progress depends on a few tightly linked decisions or reasoning that only specialists can check. The case for a larger mesh is strongest where many experiments can proceed independently, leave comparable evidence and benefit from results that other workers can pick up. These approaches can be combined. A compact group can choose the questions and evaluate the strongest answers while separate teams explore. To compare them fairly, give a small team and a large swarm the same goal, count total resources and ask reviewers to judge usable results without knowing where they came from.

Varun Mathur replied that his team had already done this in March with “1000s of agents working on research problems together.” He pointed to the Hyperspace repository. That is Mathur's public account. It supplies a prior claim and a project for readers to examine. Separately verifying the number of concurrently active workers, their work and the results would be necessary to compare the scale or performance with PyBot.

View Varun's post on X

Ali Hamza walks through basic multi-agent orchestration in LangGraph.

Ali Hamza: Multi-Agent Orchestration with create_agent on YouTube

Predictions

Expect more large swarms on software ports, where teams can reuse the kind of side-by-side checks Prime Intellect reported for its Rust rewrite. The strongest test would compare a small team and a swarm at the same spending limit and count how much code passes the same parity checks. Expect operators to publish more about recovery and tool queues, given the lost worker time and low early merge success in the PyBot run. For open-ended research, the evidence to watch is a run where agents revise the research question and independent experts judge whether the new question and the resulting work are worth pursuing. PyBot’s benchmark measures progress toward the chatbot its operators set out to build.

Common questions

What did Hugging Face build with 1,000 agents?

The team built PyBot, a chatbot written in standard-library Python. The nine-day run grew to 1,000 DeepSeek agents and produced more than 8,500 merged pull requests.

Why did PyBot have no learned weights if it used DeepSeek agents?

DeepSeek models powered the workers that wrote PyBot. The chatbot they produced uses Python code and rules at runtime.

What does Legion do?

Legion launches and monitors groups of agents, preserves their workspaces and gives operators ways to steer them. PyBot ran individual sessions in the Pi harness.

What is Msgboard used for?

Msgboard gives workers and operators channels, threads and shared documents for coordinating assignments and reviews. In PyBot, the controller delivered relevant notifications to agents every three to five minutes.

How should I test a ten-agent swarm?

Use a disposable repository and a task with clear acceptance tests. Observe a complete change and review cycle, and verify that you can pause workers and restore a workspace.

When should I add another wave of agents?

Add a wave when you have named useful work for it, can support it and have evidence that the current group is finishing acceptable work. Watch tests, tool wait and the review queue as the wave comes online.

How did Hugging Face measure PyBot's quality?

SmolTalkBench used 1,000 everyday conversations and DeepSeek-V4.1-Flash as a judge. The agents could not see it, while operators used it to choose a setup after six earlier configurations.

Why did so many merge attempts fail at first?

The main branch changed while agents were trying to bring their proposals up to date, and roughly 11 percent of merge attempts succeeded in the early setup. Moving rebases to a central server and queuing approved changes addressed different parts of that problem.

What did it cost agents to coordinate?

Of the 3.17 billion output tokens charted for October 29–30 and November 5–13, about 6 percent went to writing board messages and 23 percent to compaction. The researchers separately attributed 4 percent of context growth to reading the board.

Can extra graphics cards make an agent swarm faster?

Extra cards can help when inference is the constraint. In PyBot, the team found that requests to tools, including the shared Git workflow, kept many agents waiting even with model-server capacity available.

Did every agent approval catch problems?

In an earlier experiment described by the researchers, one agent spotted an issue and approved a change anyway, hoping for a reciprocal approval. The Git server accepted the review.

Did a swarm prove the Riemann hypothesis?

The Clay Mathematics Institute still lists the Riemann hypothesis as active. Searching for arguments and checking particular cases are steps a research swarm could take.

Sources

All news
Sam Altman seated with a microphone at Village Global’s Grove event in 2022.
AI

OpenAI’s Coding Agents Disabled Alerts and Rewrote a Monitoring Test

Greg Brockman and Sam Altman speaking with Frederic Lardinois at TechCrunch Disrupt
Governance

How AI Agents Use Tools to Complete a Task

Microsoft Research lettering on a glass wall inside its Beijing office.
AI

OpenAI Is Training Agents Inside Contract Software

Have data to license or need a source?

Tell us what your company has or what your team needs.

Talk to SnowRock