LLMGym: A Unified Environment for LLM Agent Development and Benchmarking

This repository profile is provided by osrepos.com, an open source repository discovery platform.

LLMGym: A Unified Environment for LLM Agent Development and Benchmarking

Summary

LLMGym is a unified environment interface designed for developing and benchmarking LLM applications that learn from feedback. It provides a suite of seamlessly swappable environments, making fair and comprehensive comparisons easier for researchers and developers. This project aims to be the "gym" for LLM agents, offering an intuitive interface for various tasks.

Repository Information

Analyzed by OSRepos on May 12, 2026

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

LLMGym is a unified environment interface designed for developing and benchmarking LLM applications that learn from feedback. Drawing inspiration from the popular Gymnasium library, LLMGym aims to be the "gym" for LLM agents. As the landscape of LLM benchmarks rapidly expands, LLMGym provides an intuitive interface for a suite of environments that can be seamlessly swapped out for research and development purposes, facilitating fair and comprehensive comparisons.

Important Note: This repository is still under active development. Expect breaking changes.

LLMGym includes a diverse set of environments:

  • BabyAI: Text-based versions of BabyAI grid world environments for instruction following.
  • Harbor: An adapter for Harbor tasks, allowing you to run any containerized task as an LLMGym environment.
  • Multi-Hop: Multi-hop question answering with iterative search and note-taking.
  • NER: Named Entity Recognition tasks.
  • Tau Bench: Customer service environments for airline and retail domains.
  • Terminal Bench: Docker-based terminal environments for solving programming and system administration tasks.
  • Twenty-One Questions: The classic guessing game where agents ask yes/no questions to identify a secret.

Installation

To get started with LLMGym, follow these installation steps:

Prerequisites

  • Install Python >=3.12, <3.14.
  • Install uv.

Setup LLMGym

git clone git@github.com:tensorzero/llmgym.git
cd llmgym
uv venv
source .venv/bin/activate
uv sync

Verify the Installation

python -c "import llmgym; print(llmgym.__version__)"

Setting Environment Variables

To set the OPENAI_API_KEY environment variable, run the following command:

export OPENAI_API_KEY="your_openai_api_key"

It is recommended to use direnv and create a local .envrc file to manage environment variables. For example, your .envrc file might look like this:

export OPENAI_API_KEY="your_openai_api_key"

Then, run direnv allow to load the environment variables.

Examples

Here's a quickstart example demonstrating how to use LLMGym:

import llmgym
from llmgym.logs import get_logger
from llmgym.agents import OpenAIAgent

env  = llmgym.make("21_questions_v0")

agent = llmgym.agents.OpenAIAgent(
    model_name="gpt-4o-mini",
    function_configs=env.functions,
    tool_configs=env.tools,
)
# Get default horizon
max_steps = env.horizon

# Reset the environment
reset_data = await env.reset()
obs = reset_data.observation

# Run the episode
for _step in range(max_steps):
    # Get action from agent
    action = await agent.act(obs)

    # Step the environment
    step_data = await env.step(action)
    obs = step_data.observation

    # Check if the episode is done
    done = step_data.terminated or step_data.truncated
    if done:
        break
await env.close()

You can find more examples and tutorials in the project's notebooks:

Why Use LLMGym?

LLMGym offers a powerful and flexible solution for anyone working with LLM agents that learn from feedback. Its key advantages include:

  • Unified Interface: Provides a consistent API for interacting with various LLM environments, simplifying development.
  • Benchmarking: Designed to make fair and comprehensive comparisons across different LLM applications and agents easier.
  • Diverse Environments: Comes with a rich set of pre-built environments, covering tasks from instruction following to programming and customer service.
  • Accelerated Development: Streamlines the process of building, testing, and iterating on LLM agents.
  • Research Ready: Offers a robust platform for academic and industrial research into LLM agent behavior and learning.

Links

Related repositories

Similar repositories that may be relevant next.

StringWars: Benchmarking High-Performance String Processing in Rust and Python

StringWars: Benchmarking High-Performance String Processing in Rust and Python

July 21, 2026

StringWars is a comprehensive GitHub repository dedicated to benchmarking performance-oriented string processing libraries in Rust and Python. It meticulously compares various operations, including substring search, hashing, and edit distances, across both CPUs and GPUs. This project serves as an invaluable resource for developers seeking to identify the fastest and most efficient solutions for critical string manipulation tasks, particularly those leveraging modern SIMD instructions and GPU acceleration.

benchmarkstring-processingRust
awesome-python-books: A Curated Directory of Python Books for All Levels

awesome-python-books: A Curated Directory of Python Books for All Levels

July 19, 2026

The `awesome-python-books` repository is an extensive, curated directory of Python books, catering to learners from absolute beginners to advanced practitioners. It organizes a vast collection of resources across various domains, making it an invaluable tool for anyone looking to deepen their Python knowledge. This list simplifies the search for high-quality educational materials in the Python ecosystem.

PythonBooksLearning
Become-A-Full-Stack-Web-Developer: Free Resources for Web Development

Become-A-Full-Stack-Web-Developer: Free Resources for Web Development

July 19, 2026

The Become-A-Full-Stack-Web-Developer repository is an extensive collection of free resources designed to guide aspiring developers through the entire journey of full-stack web development. It covers a wide array of topics, from foundational languages like HTML, CSS, and JavaScript to advanced frameworks such as React and Node.js, alongside databases, APIs, and career preparation. This resource is invaluable for anyone looking to build a strong skill set in modern web development.

Full StackWeb DevelopmentLearning Resources
Mergoo: Efficiently Merge and Train Multiple LLM Experts

Mergoo: Efficiently Merge and Train Multiple LLM Experts

July 7, 2026

Mergoo is an open-source Python library designed to simplify the merging of multiple Large Language Model (LLM) experts. It enables efficient training of these merged LLMs, allowing users to integrate knowledge from various generic or domain-specific models. The library supports several merging methods, including Mixture-of-Experts and Mixture-of-Adapters, across popular base models.

artificial-intelligencefine-tuninggenerative-ai

Source repository

Open the original repository on GitHub.

13 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️