Calc-X¶
| GPU | Model | Controller Mode | Trainer Mode | Code |
|---|---|---|---|---|
| 1× A100 80GB | Qwen/Qwen2.5-1.5B-Instruct |
K8s or local | Sync and async | Source |
Calc-X is a proof-of-concept (POC) example that trains a mathematical reasoning agent on the Calc-X dataset with verl and Agent Lightning >=v1.0. It is intentionally lightweight and requires only one GPU. The agent uses AutoGen + MCP calculator tools to solve math problems.
The example supports two controller modes:
- K8s mode: Minikube provides a minimal Kubernetes environment, and agent rollouts run as Kubernetes Jobs.
- Local mode: Agent rollouts run directly as local processes without Kubernetes.
Both synchronous and asynchronous trainer modes are supported.
Data Preparation¶
Download the Calc-X dataset from Google Drive, then extract it into examples/calc_x/data/:
The expected dataset files are:
data/train.parquetdata/test.parquetdata/test_mini.parquetdata/sample.jsonl
Local Mode¶
Make sure you have activated the project environment and installed the following package in Python:
source .venv/bin/activate
uv pip install \
openai \
httpx \
sympy \
"autogen-agentchat" \
"autogen-ext[openai]" \
"mcp>=1.11.0,<2" \
mcp-server-calculator
Then start training:
run_local.sh starts agl-server and agl-controller, and writes their logs under /tmp/. The script starts the agent in multi-process mode.
When run_local.sh exits, it automatically cleans up the server, controller, and agent it started.
K8s Mode¶
This example uses Minikube to demonstrate the minimal Kubernetes workflow. For production deployments, replace Minikube with a production-grade Kubernetes cluster.
Make sure you have installed docker and minikube, then start training by:
run_minikube.sh starts agl-server and agl-controller, and writes their logs under /tmp/. The script also starts a new local Minikube single-node K8s cluster, and the agent runs in this cluster as Kubernetes Jobs.
When run_minikube.sh exits, it automatically cleans up the server, controller, and Minikube it started.
Minikube needs at least 64 GB of memory; otherwise, it may be killed due to insufficient memory.