skillfed

open-spiel

A Framework for Reinforcement Learning in Games

open-spiel v2.0.2 139.2K downloads/30d#11,304 on PyPI5,411
Permissive license Apache-2.0 Active released

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-spiel

uv

uv add open-spiel

poetry

poetry add open-spiel

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchOperating System :: MacOSOperating System :: Microsoft :: WindowsOperating System :: POSIX :: LinuxProgramming Language :: C++Programming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Games/EntertainmentTopic :: Scientific/Engineering :: Artificial IntelligenceTopic :: Software Development :: Libraries :: Python Modules

Tags

reinforcement learning game environmentsmulti-agent game theory frameworkgame playing algorithmsextensive-form game simulationRL research platformgame AI researchmulti-player game environments
game-theorymulti-agent-learningresearch-framework

More Python Modules packages

Further reading