open-spiel
A Framework for Reinforcement Learning in Games
What it is and what it does
OpenSpiel is a research framework for game-based reinforcement learning and game theory, built on a C++ core with Python bindings. It provides a collection of game environments—ranging from classic games to grid worlds and social dilemmas—along with algorithms for learning and planning. The framework represents games as procedural extensive-form games and supports n-player scenarios with varying information structures (perfect and imperfect information), move timing (turn-taking and simultaneous), and payoff structures (zero-sum, cooperative, general-sum).
The package is designed for researchers studying multi-agent learning dynamics, game-theoretic algorithms, and reinforcement learning in complex interactive settings. It includes tools for analyzing learning dynamics and standard evaluation metrics. Games and core APIs are implemented in C++ for performance, while algorithms and analysis tools are available in both C++ and Python, allowing researchers to prototype in Python or optimize critical paths in C++.
Use it for:
- Implement and test multi-agent reinforcement learning algorithms on standardized game benchmarks.
- Study game-theoretic properties and learning dynamics in cooperative, competitive, and mixed-motive games.
- Develop and evaluate AI agents for imperfect-information games.
- Prototype game environments and reward structures for multi-agent research without building from scratch.
- Analyze equilibria and convergence behavior in n-player games with varying information and move structures.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
OpenSpiel provides game environments and reinforcement learning algorithms for research in multi-agent learning, game theory, and planning across diverse game types including zero-sum, cooperative, and general-sum games with perfect and imperfect information.
Yes, if you are conducting research in multi-agent reinforcement learning, game theory, or game-playing AI. The framework is actively maintained, permissively licensed, has no known vulnerabilities, and offers a comprehensive suite of game environments and algorithms. Install friction is moderate due to compiled components, but wheels are available for common platforms. Not recommended for production game servers or applications requiring real-time performance without careful profiling.
Install
open-spiel on PyPI
pip
pip install open-spieluv
uv add open-spielpoetry
poetry add open-spielInstalling open-spiel
Before you install
Medium install friction due to compiled C++ components; wheels are available for Python 3.11–3.14 on Linux, macOS (ARM), and Windows. Active maintenance with a recent release (2 days old) and 5411 repository stars.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install open-spiel
import open_spiel
Requires Python 3.11 or later; compiled wheels available for common platforms but may require build tools on unsupported architectures.
Verify before relying
- Specific game environments available and their names for import examples.
- Whether the C++ core is performant enough for large-scale multi-agent training without custom compilation.
- Availability of pre-built wheels for Python 3.14 on all advertised platforms or fallback build requirements.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 5 — absl-py, attrs, numpy, scipy, ml-collections |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 139,198/month — #11,304 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: open_spiel-2.0.2-cp311-cp311-macosx_11_0_arm64.whl; open_spiel-2.0.2-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; open_spiel-2.0.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; open_spiel-2.0.2-cp311-cp311-win_amd64.whl; open_spiel-2.0.2-cp312-cp312-macosx_11_0_arm64.whl; open_spiel-2.0.2-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; open_spiel-2.0.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; open_spiel-2.0.2-cp312-cp312-win_amd64.whl; open_spiel-2.0.2-cp313-cp313-macosx_11_0_arm64.whl; open_spiel-2.0.2-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; open_spiel-2.0.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; open_spiel-2.0.2-cp313-cp313-win_amd64.whl; open_spiel-2.0.2-cp314-cp314-macosx_11_0_arm64.whl; open_spiel-2.0.2-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; open_spiel-2.0.2-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; open_spiel-2.0.2-cp314-cp314-win_amd64.whl
Keywords: reinforcement learning, game theory, artificial intelligence, games
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
nashpyNashpy computes Nash equilibria and simulates…
permissive · top 5,000 on PyPI
pettingzooPettingZoo provides multi-agent reinforcement…
permissive · top 15,000 on PyPI
gem-llmGEM is a reinforcement learning environment…
permissive · top 15,000 on PyPI
chessA pure-Python chess library providing move…
copyleft · top 5,000 on PyPI
openskillOpenskill is a multiplayer rating system that…
permissive · top 15,000 on PyPI
gymnasiumGymnasium provides a standard Python API for…
permissive · top 5,000 on PyPI
glicko2Implements the Glicko-2 rating system, a…
permissive · top 15,000 on PyPI
TextArenaTextArena provides a framework of 100+…
permissive · top 15,000 on PyPI
tianshouTianshou is a PyTorch-based reinforcement…
permissive · top 15,000 on PyPI
sb3-contribProvides experimental reinforcement learning…
permissive · top 15,000 on PyPI