gitmyhub

busyBee-cpu

Python ★ 21 updated 28d ago

A lightweight CPU-only classifier that cuts AI API costs in agentic coding workflows by routing simple decisions (read file, run tests, apply patch) to a local 30ms model instead of calling a cloud language model, only escalating when real reasoning is needed.

Pythonscikit-learnsetup: moderatecomplexity 3/5

busyBee-cpu is a small Python tool that reduces how often an AI language model needs to be called while an AI agent is running tasks. The core insight is that many steps in an agent's work are obvious and mechanical: before editing a file, you need to read it first; after making a change, you should run the tests. These decisions do not require any real thinking, yet a typical agent setup calls the language model to make them anyway, which wastes time and money.

The tool trains a lightweight classifier that runs on ordinary CPU hardware and handles these repetitive routing decisions on its own. When the agent reaches a decision point, the classifier picks from four possible next actions: read a file, run tests, apply a patch, or escalate to the language model for actual reasoning. The escalate option is the safety valve; if the classifier is not confident or the situation is genuinely complex, it hands off to the language model. The classifier itself takes about 30 milliseconds to respond and never calls any external API.

The classifier is built from an ensemble of three simple statistical models (SGD, Naive Bayes, and Logistic Regression) voting together. It was trained on 819 examples and evaluated on about 12,000 real-world software engineering problems it had never seen, achieving 96.4% accuracy in choosing the correct next action. The project reports a score of 20 out of 20 on a separate set of real-world agent scenarios.

The primary integration target described in the README is HermesAgent-20, an AI agent framework. The adapter makes the classifier look like a standard language model endpoint so the agent system treats it as just another model provider, but internally it runs local Python classifiers instead of calling a cloud API.

Setup involves cloning the repository, installing Python dependencies, training a model with a provided command, and starting a local server. The project is released under an MIT license.

Where it fits