Skip to main content
A multi-turn agent that solves competition math problems by calling a calculator tool through native OpenAI function calling. Use this when you want the model to learn explicit tool use; for plain chain-of-thought math see math.

Pattern

Architecture

The evaluator checks the final <answer> against the ground truth via numeric comparison.

Install

Datasets

Eval

Training

The tool-call training requires verl’s vLLM tool-call parser:
(Already wired into train_verl.sh.)

Key code

The flow drives a fixed-iteration tool-calling loop:
The calculator is a sandboxed AST walker:
Whitelisted names cover sqrt, log, sin, cos, factorial, comb, gcd, lcm, pi, e, tau, … — anything outside the whitelist raises an error string the model sees.

Files

On GitHub

cookbooks/math_tool_agent

Full source, README, and runnable launch scripts