--- id: textarena version: "0.7.4" license: MIT license_treatment: permissive maintenance: aging --- # TextArena — A Collection of Competitive Text-Based Games for Language Model Evaluation and Reinforcement Learning License: permissive · Maintenance: aging · Downloads: 201.9K/mo ## What it is and what it does TextArena is a framework for running text-based competitive games between language models and other agents. It provides a Gym-style interface so you can initialize game environments, reset them with a specified number of players, step through turns by passing observations to agents and collecting their actions, and retrieve rewards and game state at the end. The package ships with 100+ games (including TicTacToe, Chess, Settlers of Catan, and others), built-in agents that wrap external LLM APIs, and wrapper utilities for visualization and training integration. You use TextArena to benchmark how well language models play text games, train them via reinforcement learning on game outcomes, or evaluate their reasoning and strategy in competitive settings. It depends on OpenAI and requests for API calls, rich for terminal rendering, nltk and chess for game logic, websockets for potential real-time play, and python-dotenv for credential management. The framework is designed to be extensible—you can add custom games and agents by implementing a simple interface. Use it for: - Benchmark language model reasoning by running them against each other in competitive games like TicTacToe or Chess. - Train LLMs via self-play reinforcement learning on TextArena games to improve strategy and multi-turn reasoning. - Evaluate theory-of-mind capabilities by running models on games that require understanding opponent intent and hidden information. - Integrate game environments into existing RL pipelines via the Gym-style interface for custom training loops. - Compare different LLM providers (GPT, Claude, etc.) on the same game tasks using the OpenRouter agent wrapper. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. TextArena provides a framework of 100+ text-based games with an OpenAI Gym-style interface for training, evaluating, and benchmarking language models through competitive gameplay. Yes, if you are actively researching LLM training or evaluation via games. The framework is well-designed, has low install friction, and offers a large game suite with recent updates. However, maintenance is aging (302 days since last release), so expect slower bug fixes and feature additions. Not recommended if you need production-grade support or rapid iteration on the game set. ## Install pip install textarena uv add textarena poetry add textarena ## Installing TextArena Before you install: Low install friction with a pure-Python wheel distribution. Maintenance status is aging—last release was 302 days ago—so expect slower response to issues, though the package remains functional for its current game set. License in practice: MIT license is permissive; you can use, modify, and distribute TextArena freely in commercial and private projects with minimal restrictions. Quickstart: pip install textarena import textarena as ta env = ta.make(env_id="TicTacToe-v0") agent = ta.agents.OpenRouterAgent(model_name="GPT-4o-mini") env.reset(num_players=1) player_id, observation = env.get_observation() action = agent(observation) done, step_info = env.step(action=action) Requires Python 3.10 or later. External LLM API calls (OpenAI, Anthropic, etc.) require valid API keys set as environment variables. Verify before relying: - Whether all 100+ games remain actively maintained or if some are deprecated in the current version. - Performance characteristics when running many concurrent game instances or with large language models. - Real-world success rate of the included basic agents and whether custom agent development is well-documented. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 201.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags text-based games for LLM training, language model benchmarking framework, gym-style game environments, LLM evaluation games, multi-player text games, reinforcement learning game suite, competitive text game benchmark, llm-benchmark, game-environment, reinforcement-learning [View on SkillFed](https://skillfed.io/packages/textarena) · [View on PyPI](https://pypi.org/project/textarena/)