ToolGym
A Gymnasium environment for training and evaluating LLM tool use as an RL problem.
Pythonopen source
Problem
Tool use by language models is usually evaluated with one-off scripts. Framing it as a proper RL environment makes it possible to train and benchmark agents on tool selection and argument construction under a consistent reward signal.
Approach
- Implements the Gymnasium API (reset, step, observation and action spaces) so any standard RL code can drive it.
- Models a tool-use episode: the agent reads a task, chooses a tool, supplies arguments, and receives a reward shaped by whether the call was correct and useful.
- Designed for agentic RL experiments - it slots directly into the PPO implementations in my other projects.
Tech
GymnasiumPythonLLM tool useReinforcement learning
Status
Shipped and open source. Used as the agentic-RL testbed alongside my PPO work.