OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Pgx

Pgx is an open-source Python library of JAX-native, vectorized game simulators for reinforcement-learning research. It provides game environments that can be run in parallel, including GPU-accelerated execution, with JIT-able environment steps.

Independent OpenViST project profile, based on linked sources.

Pgx — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Pgx when an RL experiment needs JAX-native environments for discrete-state games and benefits from vectorized parallel simulation.

Who it is for

  • Researchers developing reinforcement-learning systems for discrete-state games.
  • Developers who need batched game environments for policy training or evaluation.
  • Teams using JAX or PettingZoo-compatible game workflows.

Documented uses

  • Run parallel instances of supported games as RL environments.
  • Train agents using the repository’s AlphaZero or PPO examples.
  • Evaluate policies across repeated game episodes.
  • Convert Pgx environments to PettingZoo’s AEC API.
Before you choose

Requirements & limits

The project is available on PyPI and its repository identifies an Apache-2.0 license. The README specifies Python 3.9 or newer and requires JAX and jaxlib, with their installation depending on hardware.

  • JAX and jaxlib are prerequisites; the appropriate setup depends on hardware.
  • The repository describes GPU acceleration but does not specify one universal hardware configuration.
  • Pgx provides environments rather than the policy model that selects actions.
  • The README includes AlphaZero and PPO training examples and a PettingZoo conversion demonstration.
  • For stochastic environments, API v2 allows an explicit random key in the step call; Go and chess are identified as deterministic examples unaffected by that change.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install Pgx and initialize a batched Go environment

Set up Pgx and initialize vectorized Go game states for reinforcement-learning use.

Before you start

  • Python 3.9 or later.
  • JAX and jaxlib installed according to the hardware specification.

Steps

  1. Install Pgx with the command below.

    Documented command
    pip install pgx
  2. Import jax and pgx, then create the environment with env = pgx.make("go_19x19").

  3. Create JIT-compiled vectorized initialization with init = jax.jit(jax.vmap(env.init)).

  4. Create 1,024 PRNG keys using jax.random.split(jax.random.PRNGKey(42), 1024) and initialize batched states with state = init(keys).

Expected outcome

A batch of initialized Go states ready for a policy to act on.

Guide limitations

  • The documented usage requires JAX and jaxlib; installation details depend on hardware.
  • This recipe initializes states only; the example's later action-selection step requires a model that is not defined in the documented snippet.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
sotetsuk/pgx · Official homepage title · retained in its source language