About ToolBrain
ToolBrain is a lightweight open source framework for training tool using AI agents with reinforcement learning. It targets agents that are unreliable at using their tools and aims to make RL practical through a simple API, rather than requiring users to build the training loop themselves.
A Brain class wraps an existing agent and abstracts the whole RL loop. The quickstart on the site trains a smolagents CodeAgent running a small Qwen model to use a multiplication tool, with a built in exact match reward, the GRPO algorithm and a dataset of query and gold answer pairs, then saves the trained agent. Rewards can be built in, written as ordinary Python functions, or produced by an LLM as a judge. Tool retrieval automatically selects relevant tools, and a feature called Zero Learn generates new training tasks. Training options include GRPO, DPO and knowledge distillation, accelerated by Unsloth and QLoRA.
The framework is aimed at developers and researchers who already have an agent and want to improve its tool use through training. The site links to the GitHub repository, a paper and a demo video.
ToolBrain is open source and the site publishes no pricing.