AI Trends

Hugging Face Uses Up to 1,000 AI Agents to Develop PyBot and Open-Sources Legion and Msgboard

gihyo.jpUpdated Nov 28 16:23

AI summary

The Hugging Face research team has released the results of an experiment in which up to 1,000 AI agents spent nine days developing PyBot, a rule-based chatbot, and has open-sourced Legion and Msgboard. PyBot contains approximately 600,000 lines of code, and its development generated 175,000 messages and more than 8,500 PRs. Its SmolTalkBench win rate ultimately rose to 26%, comparable to SmolLM-360M-Instruct. The experiment also found that bottlenecks in large-scale parallel development include reasoning, tool calls, context compression, and Git merging.

Why read this

SelectedAI score 83

The material highlights collaboration, context compression, and Git merge bottlenecks encountered during parallel development by 1,000 agents, offering an engineering reference for large-scale agent orchestration.

Topics

Tags

Body · AI translation

On November 25, 2026, the Hugging Face research team published the results of an experiment in which AI agents spent nine days developing the chatbot “PyBot.” The team had agents using the DeepSeek-V4.1-Flash language model write PyBot’s code, gradually increasing their number to 1,000. PyBot itself does not use a language model, instead responding according to rules written in Python. The research team also released on GitHub the source code for “Legion,” which was used to launch and manage the agents, and “Msgboard,” a message board where humans and agents share work updates[1].

Scaling Swarms to Thousands of Agents

Releasing a new blog: Scaling Swarms to Thousands of Agents!

The biggest problems in science are tackled with huge swarms of agents, but the knowledge to run such swarms is hidden inside a handful of labs and missing from the wider community. Many questions remain open:

How do even you launch 1000s of agents?

What's the best form of collaboration?

Which tools are needed for agents to work effectively?

What breaks at this scale and how to fix it?

This blog is a fully open field report covering all the practical and technical challenges of running large scale swarms we experienced and which are usually missing from the reports.

Here are a few lessons we learned while building pybot with 1000 DeepSeek agents for over a week:

achieve diversity without enforcing too much structure

monitoring and steering a swarm as it runs

early signs of misalignment, from infrastructure probing to trading review approvals

breaking and fixing git

message boards and communicating at scale

finding the bottlenecks: inference, tool calls and context compaction

Today we are also sharing two of our internal tools: legion and msgboard!

Legion is a harness agnostic framework to spawn 1000s of agents on a variety of infra (local, slurm, hf jobs etc.)

Msgboard is a simple message board you can run locally or on a space, and allows agents and humans to collaborate.

What Kind of Chatbot Did the Research Team Aim to Create?

The research team aimed to create a chatbot that would give specific answers like a knowledgeable friend and remember what the other person had said previously. PyBot runs using only Python’s standard library. It identifies patterns in input sentences with regular expressions, switches processing according to conditions, and consults information registered in tables to construct its responses.

There are many ways to respond to everyday questions and concerns. Even if development were divided by feature, could the agents judge the quality of responses according to the same standards? The research team prepared a guide containing examples of desirable responses, and the development agents evaluated PyBot’s replies according to that guide.

Co-author Carlos Miguel Patiño also explained the difficulty of setting goals. If goals are specified in too much detail, agents may prioritize improving evaluation-metric scores over enhancing response quality. The team therefore communicated the broad outlines of the goal and monitored development progress so that it could give the agents instructions if work stalled.

When the research team evaluated the finished PyBot through single-turn question-and-answer tests using everyday English conversations, its performance was comparable to that of the small language model SmolLM-360M-Instruct. A demo on Hugging Face allows users to talk to PyBot and see how it responds.

In a November 16 post, co-author Leandro von Werra said that PyBot’s code comprised approximately 600,000 lines. According to the research team’s tally, the agents exchanged 175,000 messages during development, while more than 8,500 proposed changes incorporated into PyBot—pull requests, or PRs—were accepted. In his post announcing the experiment’s results, von Werra cited the fact that expertise in operating large groups of agents had remained confined to a handful of laboratories as the motivation for publishing this report and releasing the tools.

Running Agents with Legion and Dividing Work Through Msgboard

Legion prepares a working environment for each agent and records its operating status and model usage after launch. The research team also published an example configuration dividing PyBot development into 10 areas of responsibility[2].

At the start of the experiment, the research team determined the number and roles of the development agents. DeepSeek, which the development agents invoked when writing code, ran on an inference server. Before adding more agents, the operations agents checked whether that server could also process requests from the new agents and whether sufficient CPU capacity was available to add more working environments. Around the time the number of development agents reached 1,000, cloud computing resources were reclaimed, temporarily halting most of the agents. Once Legion restored the saved working environments, the agents resumed work from where they had left off.

Duplicated work also became an issue as more agents were added. In an earlier experiment in which responsibilities had not been divided, agents joining simultaneously sometimes read the same information and separately built similar features. For this experiment, the research team therefore divided PyBot’s development into areas of responsibility and created a channel for each area on the Msgboard message board. For example, separate groups developed the feature for interpreting the intent behind questions and the feature for remembering conversation content, sharing work updates in their respective channels. Agents can post messages to this board programmatically, while humans can post through a browser.

The operations agents launched new development agents incrementally every few minutes. Agents that joined later could review ongoing work through message-board posts before choosing their own tasks. These exchanges can be read on PyBot’s message board. According to a presentation by Patiño, every message sent by the agents during development is to be made public.

Message-Board Posts Accounted for About 6% of Output, While Waiting for Merges Became a Development Challenge

The research team measured the amount of text and code generated by the agents in tokens, the units in which models process strings. Of all output tokens produced during the experiment, message-board posts accounted for about 6%, while summaries of work histories accounted for 23%. Because each agent continued development while referring to its earlier work records, those histories—including code it had written and test results—had to be summarized as they accumulated.

The research team also investigated what the agents were waiting for. According to Thomas Wolf, in some runs only 40 to 60 of the 1,000 agents were calling the model at the same time[3]. The agents reportedly spent much of their time waiting for tests and merges to finish.

One reason the agents ended up waiting for merges was the initial procedure for incorporating PRs. PyBot’s code was stored in a repository on the Hugging Face Hub. Each agent modified the code on a working branch and submitted a PR through a Git server prepared by the research team. Merging into the main branch required review and approval by another agent.

Initially, if main had advanced beyond the working branch by the time of the merge, the agent that submitted the PR reapplied its changes on top of the latest main (rebasing). With hundreds of agents working in parallel, other PRs were incorporated during a rebase, updating main yet again. According to server records, only about 11% of merge attempts using this method succeeded.

The team therefore moved rebasing to the Git server. When an agent requested a merge, the server rebased and tested the changes, incorporating them into main if the tests passed. If there was a conflict, the agent that submitted the PR received a server notification, fixed the affected files, and requested another merge. The server was later configured to process approved PRs sequentially, one at a time.

Verifying That Code Changes Improved Responses

Agents decided which changes to incorporate by reviewing one another’s work. In preliminary experiments, a PR passed if other agents supported it. The work logs presented by the research team even include an example of an agent that found a problem in another agent’s PR but approved it without requesting a fix in an effort to get its own PR approved quickly.

In this experiment, the agents jointly prepared sample conversations for testing. An agent submitting a PR entered the same sample conversations into PyBot before and after the change and compared which responses better followed the research team’s guidelines. The team instructed agents to submit a PR only if, across all sample conversations tested, the number of responses that improved exceeded the number that worsened. For multi-turn conversations, the condition was that not a single response had become worse. Reviewing agents also compared the before-and-after responses using the same sample conversations before granting approval.

Comparable to a Small Language Model in Single-Turn English Everyday Conversation

To track how PyBot’s responses changed over the course of development, the research team created SmolTalkBench, a benchmark of 1,000 questions selected from everyday English conversations and separate from the sample conversations used to review PRs. The team kept the existence of this evaluation hidden from the development agents and gave each version of PyBot the same questions in an environment separate from the one used for development.

The language model used for scoring compared the reference answer for each question with PyBot’s response and estimated the probability that PyBot’s response was better. For example, if that probability was 70%, the question would generally receive a score of 0.7 points. The research team averaged the scores for all 1,000 questions and expressed the result as a percentage, which it calls the win rate[4].

When PyBot’s development had reached around 2,000 commits, the research team noticed that its win rate had temporarily declined. An examination of the most recent changes showed that PyBot could not load a required program and had stopped working. The development agents fixed the bug without intervention from the team and reportedly continued making improvements after getting PyBot working again.

PyBot’s win rate rose from 0% at the start of development to 26% by the end. When responses from the small language model SmolLM-360M-Instruct (360 million parameters) were scored using the same criteria, its win rate was about the same as PyBot’s. According to the research team, SmolLM used the conversations on which the evaluation questions were based in its training, so its win rate on this evaluation is inflated.

The research team also used this benchmark when deciding how to conduct development. It ran six preliminary experiments with different approaches to assigning roles and making decisions, then compared the performance of the chatbots developed in each experiment with that of the current PyBot. The team believes that verifying response improvements with sample conversations before incorporating code changes contributed more to improving PyBot’s performance than changing the chain of command or introducing voting.

How Did the Agents Collaborate?

Wolf points out that although PyBot’s responses can be scored, it is difficult to measure how effectively the agents that developed it collaborated with one another.

The research team first selected 96 PRs incorporated during development and used a language model to classify them according to the approaches the agents had tried. The approaches were divided into 12 categories, such as “standardizing the notation used for words and phrases.” The team also traced the history of individual fixes to investigate what improvements were added after other agents tested the changes.

For example, one agent added a feature that allowed PyBot to remember a number mentioned in a conversation together with what that number referred to. If someone said, “I have three siblings,” PyBot could later answer “three” when asked how many siblings they had. When another agent tested it with the sentence “I have two flat tyres,” PyBot associated “two” with “flat.” In its next PR, the agent that had added the feature corrected the rule so that “two” would be remembered as the number of “tyres.”

Although this kind of collaboration emerged, it was the research team that determined the areas of development responsibility, such as the feature for remembering conversation content. In the future, the team wants to investigate whether agents can learn for themselves how to divide the work when tackling a new challenge and whether they can identify which ideas from their peers are worth testing further.

Source

gihyo.jp