Skip to main content

Framework-Agnostic RL Environments for LLM Fine-Tuning

Project description

Benchmax

benchmax: Framework-Agnostic RL Environments for LLM Fine-Tuning

A lightweight, training-framework agnostic library for defining, running, and parallelizing environments, to fine-tune OSS LLMs with reinforcement learning.

License

📌 News

  • [29 Oct 2025] 🎉 Added support for easy multi-node parallelization across all major cloud providers using SkyPilot
  • [29 Oct 2025] 🎉 Integration with SkyRL for distributed RL training across clusters
  • [Upcoming] 🛠️ Integration with Tinker API.

📘 Quickstart

Example: Multi-node parallelization of Excel Env with SkyRL and SkyPilot

RL environments can be computationally expensive to run (e.g. running tests). To handle these workloads efficiently, we distribute rollouts across multiple nodes using SkyPilot, horizontally scaling benchmax across cloud providers like GCP, AWS, Azure, etc.

SkyRL is a training framework benchmax is currently integrated with. Use our SkyRL integration to RL finetune Qwen-2.5 to do spreadsheet manipulation using a excel MCP parallelized across multiple nodes. The environment is defined in benchmax.envs.excel.excel_env.ExcelEnvSkypilot

  1. Prepare the dataset

    uv run src/benchmax/adapters/skyrl/benchmax_data_process.py \
      --local_dir ~/data/excel \
      --dataset_name spreadsheetbench \
      --env_path benchmax.envs.excel.excel_env.ExcelEnvLocal
    

    Note: We are using ExcelEnvLocal instead of ExcelEnvSkypilot because the MCP is only used for listing tools to prepare the system prompt.

  2. Run training and parallelize Excel environment

    bash examples/skyrl/run_benchmax_excel.sh
    

This excel env example will spin up 5 nodes with 20 servers per node (total 100 MCP server in parallel). For more details, check out multi-node parallelization and SkyRL integration.

ℹ️ Overview

benchmax comes with:

  • A collection of ready-to-use reinforcement learning (RL) environments for LLM fine-tuning ranging from multi-hop search to spreadsheet manipulation to CRM agents
  • An easy to define, compose, and parallelize your own environments, including leveraging the existing ecosystem of MCP servers
  • Built-in integrations with popular RL training libraries (skyrl, etc.). benchmax is trainer-agnostic by design

Define your environment as:

  1. A toolset (LLM calls, external APIs, calculators, MCPs, etc.).
  2. Output parsing logic to extract structured observations.
  3. Reward functions to score model outputs.

Rollout management, parallel execution, etc. comes out of the box.

⭐ Star our repository to show your support!

💡 Core Features

Built-in examples & templates

Get started with ready to use recipes, from Wikipedia search to spreadsheet manipulation. Easy to copy, customize, and extend. And yes, more are on the way.

Trainer integrations

Use your own trainer or training framework - no lock-in. benchmax is already integrated into SkyRL, with more integrations (Tinker, etc.) coming soon!

MCP support

Tap into the growing MCP ecosystem and integrate them as tools within your environments.

Multi-node parallel execution

Multi-node parallelization enabled out of the box with state isolation across roll-outs (e.g. editing files on filesystem, etc.).

🌐 Creating & Training with Environments

What is an environment?

An environment consists of:

  • A list of tools that an LLM can call
  • A list of reward functions that evaluate the quality & correctness of the model's final output.

We also support MCP servers natively, allowing you to easily leverage the many servers built by the community.

Pre-built environments

Ready-to-use environments with pre-configured tools and reward functions.

How do I create a custom environment?

  1. With existing MCP servers (Built-in support for multi-node parallelization)

  2. Extend BaseEnv

How about more complex environments?

  • Check out our excel spreadsheet RL environment: benchmax.envs.excel.excel_env.ExcelEnv

How do I use an environment with my preferred RL Trainer?

We currently have integrations with SkyRL. More incoming!

benchmax environments with skyrl

I want a specific environment

Open an issue and tag us & we will look into building you one!


🎯 Motivation

  • Modularity and Simplicity:

    We set out to build a lightweight, modular system for defining RL environments—breaking them down into simple, composable parts: tools, tool output parsing, and reward functions.

    The goal’s to make it easy for software engineers to build and experiment with RL environments without needing deep RL expertise.

  • Trainer Integrations:

    There’s been lots of new RL training frameworks popping up (e.g., numerous forks of verl) & we expect this to continue. They are often tightly coupled with specific environments, leading to fragmentation and limited compatibility.

    We are building benchmax as a standalone library with integrations to these different training frameworks & as an easy way for new frameworks to tap into an existing pool of environments. We're already integrated with SkyRL (Tinker coming soon)!

  • Task Recipes and Ideas:

    We want benchmax to be a living library of reusable, RL-compatible task recipes, ready to inspire and extend beyond the usual suspects like math and coding. We aim to support more real-world workflows, including open-ended and long-horizon tasks.

  • Parallelization and Cloud Compatibility:

    • Enable efficient parallelization with maintained statefulness between rollouts.
    • Facilitate easy deployment and scalability in cloud environments.
  • MCP as a first class citizen:

    There has been an explosion of MCP servers/tools built out for use-cases ranging from browser use to excel to game creation.benchmax allows folks to leverage and compose these existing MCP servers to build environments integrated with real world systems e.g. excel

🤝 Contributing

We welcome new environment recipes, bug reports, and trainer integrations!

⭐ Star our repository to show your support!

📜 License

Apache 2.0 © 2025 CGFT Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

benchmax-0.1.2.dev21.tar.gz (73.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

benchmax-0.1.2.dev21-py3-none-any.whl (86.7 kB view details)

Uploaded Python 3

File details

Details for the file benchmax-0.1.2.dev21.tar.gz.

File metadata

  • Download URL: benchmax-0.1.2.dev21.tar.gz
  • Upload date:
  • Size: 73.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchmax-0.1.2.dev21.tar.gz
Algorithm Hash digest
SHA256 59ee4bfaba94cd9d944b47b1e63a204cc72d3124f6d26b286d336f95c5bd05e4
MD5 c19eb5293b3b49b7f8eb7a712366d3c6
BLAKE2b-256 e93ced6d8cab0dd605173ef80e7feac9c4cd601ffea5afc3aeb2b18319f45ae0

See more details on using hashes here.

File details

Details for the file benchmax-0.1.2.dev21-py3-none-any.whl.

File metadata

  • Download URL: benchmax-0.1.2.dev21-py3-none-any.whl
  • Upload date:
  • Size: 86.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.8 {"installer":{"name":"uv","version":"0.10.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for benchmax-0.1.2.dev21-py3-none-any.whl
Algorithm Hash digest
SHA256 993de2e7a40cc7c70d1fc10ae0083eb4d7fac159f238ff2ea2cb4e0a4ed4f060
MD5 ea1d43c56f7eb3c640a9be732a3e05b3
BLAKE2b-256 5abd0ea92fb22ee105fdb7a8c374c1c201b2b8672cd1d11f9d5f98f73e6b94c9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page