gem-llm
A Gym for Generalist LLMs.
What it is and what it does
GEM is an open-source environment suite designed for training agentic LLMs via online reinforcement learning. It provides a standardized API modeled after OpenAI Gym, offering a growing collection of diverse environments across games, mathematical reasoning, competitive coding, knowledge-intensive QA, and synthetic reasoning tasks. The package supports tool integration (Python execution, search, MCP), async vectorized execution for high-throughput simulation, and is training framework-agnostic, with demonstrated integration examples for supported RL frameworks.
The core use case is enabling researchers and practitioners to train LLM-based agents through interactive experience rather than static datasets. GEM handles environment management, observation-action-reward loops, and episode termination logic, while remaining agnostic to the choice of training algorithm (REINFORCE, GRPO, PPO, REINFORCE + ReBN) or RL framework. It depends on nltk, math-verify, reasoning-gym, and msgspec for core functionality.
Use it for:
- Train agentic LLMs on game-solving tasks like Sudoku or number-guessing using GEM's built-in game environments and your choice of RL framework.
- Develop and benchmark LLM agents on mathematical reasoning problems by using the math environment category and comparing algorithm performance.
- Build tool-using agents that call Python executors or search APIs within GEM's environment wrapper system for complex multi-step tasks.
- Integrate GEM environments with existing RL training frameworks to leverage your preferred infrastructure for distributed training.
- Evaluate LLM agent performance across diverse reasoning tasks from the ReasoningGym category without reimplementing evaluation logic.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GEM is a reinforcement learning environment suite that provides a standardized API for training agentic LLMs through interactive experience in diverse task domains including games, math, code, QA, and reasoning.
Yes, with conditions. GEM is worth installing if you are actively researching or building agentic LLM training systems and need a standardized, framework-agnostic environment API. The low install friction, permissive Apache-2.0 license, and diverse task collection make it a solid foundation. However, the aging maintenance status (last commit 2026-01-21, no recent releases) and beta stability warrant caution for production use. Verify that the runtime dependencies and supported RL frameworks remain compatible with your workflow before committing to it.
Install
gem-llm on PyPI
pip
pip install gem-llmuv
uv add gem-llmpoetry
poetry add gem-llmInstalling gem-llm
Before you install
Low installation friction with a pure-Python wheel. The package is in beta (Development Status 4) and aging—last commit was 2026-01-21. The four runtime dependencies (nltk, math-verify, reasoning-gym, msgspec) are lightweight, but the lack of recent updates may signal limited active support.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. You may use, modify, and distribute the package freely provided you include a copy of the license and state significant changes.
Quickstart
pip install gem-llm
import gem
env = gem.make("game:GuessTheNumber-v0")
observation, info = env.reset()
action = env.sample_random_action()
next_observation, reward, terminated, truncated, info = env.step(action)
Requires Python 3.10, 3.11, or 3.12 (capped at 3.12). The package depends on nltk, math-verify, reasoning-gym, and msgspec; ensure these are installed or let pip resolve them.
Verify before relying
- Whether the aging maintenance status (last commit 2026-01-21, no recent releases) indicates the project is still actively maintained or has entered maintenance-only mode.
- Compatibility and stability of the four runtime dependencies (nltk, math-verify, reasoning-gym, msgspec) with the current gem-llm version.
- Whether the supported RL training frameworks (Oat, Tinker, Verl, RL2, ROLL, OpenRLHF) are all actively maintained and compatible with gem-llm 0.1.0.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | capped below the current Python release (<=3.12,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — nltk, math-verify, reasoning-gym, msgspec |
| Maintenance | aging — 313 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 224,504/month — #9,232 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gem_llm-0.1.0-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
TextArenaTextArena provides a framework of 100+…
permissive · top 15,000 on PyPI
verlverl is a reinforcement learning training…
permissive · top 15,000 on PyPI
reasoning-gymReasoning Gym generates procedurally verifiable…
permissive · top 15,000 on PyPI
nemo-gymNeMo Gym provides infrastructure for building,…
permissive · top 5,000 on PyPI
kaggle-environmentsKaggle Environments provides a framework for…
unclear · top 15,000 on PyPI
verifiersVerifiers provides environments and evaluation…
permissive · top 15,000 on PyPI
tinker_cookbookTinker Cookbook provides recipes and…
permissive · top 15,000 on PyPI
ShimmyShimmy converts external reinforcement learning…
permissive · top 15,000 on PyPI
gymnasiumGymnasium provides a standard Python API for…
permissive · top 5,000 on PyPI
agentlightningAgent Lightning optimizes AI agents using…
unclear · top 15,000 on PyPI