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.

Awesome Harness Engineering: Building Reliable AI Agent Systems

Awesome Harness Engineering: Building Reliable AI Agent Systems

September 7, 2026

Awesome Harness Engineering is a comprehensive curated list dedicated to the discipline of designing robust AI agent harnesses. It offers a wealth of resources, patterns, and templates essential for building reliable AI agent systems. Developers can explore tools, best practices, and foundational concepts across various critical areas of agent development.

agent-harnessai-agentsawesome-list
Best of Agent Harnesses: A Curated List for AI Agent Development

Best of Agent Harnesses: A Curated List for AI Agent Development

September 7, 2026

RyanAlberts' Best of Agent Harnesses is a comprehensive, curated, and ranked list of over 100 AI agent harnesses and orchestration frameworks. It provides valuable insights for building reliable agentic systems, offering both human-readable guides and machine-readable formats for agents themselves. The repository is rescored weekly to ensure up-to-date recommendations.

AI AgentsAgent HarnessesLLM Frameworks
Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly

Wasm Agents Blueprint: Run Python AI Agents in Your Browser with WebAssembly

September 3, 2026

Wasm Agents Blueprint is an innovative project from Mozilla AI that allows you to run Python-based AI agents directly in your web browser using WebAssembly (Wasm) and Pyodide. It bridges the gap between powerful Python AI frameworks, like the OpenAI Agents SDK, and browser-based applications. This blueprint eliminates the need for complex server setups or Docker containers, offering a streamlined way to experience AI agents.

PythonWebAssemblyAI Agents
EnvHarness: Dynamically Adapting Environments for Agent Learning

EnvHarness: Dynamically Adapting Environments for Agent Learning

September 3, 2026

EnvHarness empowers large language models (LLMs) acting as autonomous agents to learn more effectively from interactive environments. It achieves this by wrapping static environments with plug-in components, making them dynamically controllable without altering their internal code. This innovative approach allows environments to target specific agent weaknesses and continuously teach as agents improve, leading to more effective and efficient learning outcomes.

PythonAILLM

Source repository

Open the original repository on GitHub.

18 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 ❤️