Skip to main content

PyBot: no weights, no training, just rules

pybot-hf

PyBot, on PyPI. A chatbot written entirely in plain Python — no weights, no training, just rules — built by a swarm of over 1,000 agents. Around 640,000 lines of code and zero dependencies, with a win rate on SmolTalkBench on par with SmolLM-360M-Instruct.

This is the PyPI distribution of PyBot by Hugging Face. Version numbers track the upstream release — packaging-only changes ship as post-releases.

Install

pip install pybot-hf

Python 3.8 or newer. No packages to install, no model to download.

Use it

pybot

That starts a chat in your terminal:

    ____        ____        __
   / __ \__  __/ __ )____  / /_
  / /_/ / / / / __  / __ \/ __/
 / ____/ /_/ / /_/ / /_/ / /_
/_/    \__, /_____/\____/\__/
      /____/

A chatbot written in plain Python. No weights, no training, just rules.
Type a message and press Enter. /reset starts a new conversation, /exit quits.

user: hi, i'm Sam
pybot: Nice to meet you, Sam. What can I help with?

user: my kettle is full of limescale, how do i get rid of it?
pybot: Half fill the kettle with equal parts water and white vinegar, or a sachet of citric acid, boil it and leave it half an hour, then tip it out and boil fresh water twice before you use it again. In a hard-water area do it every couple of months: the scale forms because hard water leaves calcium behind as it boils, and a thick layer makes the kettle slow and puts a scum on the tea.

user: how long does that take
pybot: Half an hour.

user: what's my name?
pybot: You're Sam.

Type /reset to clear the screen and start a new conversation, and /exit to quit. PyBot takes a few seconds to start, because Python has about 640,000 lines of code to load, and about a second to reply.

One question and exit, or one reply per piped line:

pybot -p "Why do onions make you cry?"
echo "how long should i boil an egg" | pybot
Option What it does
-p TEXT, --prompt TEXT reply to this one message and exit
-i, --interactive with -p, keep chatting after the first reply
-s N, --seed N fix PyBot's choice of wording, to get the same replies again
-v, --verbose after each reply, show the module that produced it and the time it took

You can also try it in the browser on Hugging Face, where each reply shows which of PyBot's modules produced it.

How it works

Chatbots predate LLMs by decades — ELIZA held conversations in the 1960s by matching patterns in what the user typed and answering with predefined templates. PyBot asks how far that approach goes when a swarm of agents writes the rules instead: over 1,000 agents wrote and evaluated more than 5,000 versions, and the win rate on SmolTalkBench, where an LLM judge compares each reply with a reference answer, climbed from 0% to 26%.

PyBot's win rate over the evaluated commits on a log scale: every commit as a dot and the best so far as a line, with three SmolLM baselines as dashed lines, and its lines of Python code in grey on the right axis

Every turn, each module in bot/modules/ may propose a reply, and an arbiter (bot/modules/arbiter.py) picks the one you get. The modules build on four shared parts:

Part Where Lines
Understanding engine: what you typed and meant, with typos, chat-speak, the topic and what "it" refers to bot/understanding/ 25,000
Memory store: what you and PyBot have said so far bot/memory/ 109,000
Knowledge base: facts about the world, kept as data bot/knowledge/ 317,000
Response composer: how a reply is phrased, and what to say when nothing fits bot/compose/ 104,000

The modules themselves are another 81,000 lines.

From source

git clone https://github.com/huggingface/pybot
cd pybot
pip install .

License

Apache License 2.0. See LICENSE.

Metadata

Release files for pybot-hf 0.1.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybot-hf 0.1.0.post1
File Size Uploaded Provenance Actions
pybot_hf-0.1.0.post1.tar.gz 12.6 MB Without provenance Details for pybot_hf-0.1.0.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pybot-hf 0.1.0.post1
File Interpreter ABI Platform Actions
pybot_hf-0.1.0.post1-py3-none-any.whl Python 3 none any Details for pybot_hf-0.1.0.post1-py3-none-any.whl

Total release size: 25.5 MB

Release files / pybot_hf-0.1.0.post1.tar.gz

Download URL pybot_hf-0.1.0.post1.tar.gz
Size 12.6 MB
Tags Source
SHA-256 checksum
How to use checksums
91d4b920b6cb2d8e2dd5a3c797a66c00614d70f71ecf39a8e44d47c18df294d4
BLAKE2b-256 checksum
How to use checksums
d513ccc7e01ec6fb9ce19fb202fb8d0bed3572f9dc8188bb6a6c0039343cdba2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / pybot_hf-0.1.0.post1-py3-none-any.whl

Download URL pybot_hf-0.1.0.post1-py3-none-any.whl
Size 12.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ebbffa1be0dbf96624ac0fcf5a5150335d8f82ed84182ed0e8ce648ba1fe30cf
BLAKE2b-256 checksum
How to use checksums
a2c55ca88c34c1e1b698a245aaf4cb42e40f8fbd0ec84bb6e19c9fe1d7aaaf9a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for pybot-hf 0.1.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page