# datamllab/rlcard

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/datamllab-rlcard).**

3,401 stars · 728 forks · Python · mit

## Links

- GitHub: https://github.com/datamllab/rlcard
- Homepage: http://www.rlcard.org
- awesome-repositories: https://awesome-repositories.com/repository/datamllab-rlcard.md

## Topics

`ai` `blackjack` `card-game` `card-games` `deep-reinforcement-learning` `doudizhu` `game` `game-ai` `game-bot` `gym-environment` `mahjong` `multi-agent` `openai-gym` `poker` `poker-game` `reinforcement-learning` `texas` `uno`

## Description

RLcard is an open-source framework for developing and evaluating reinforcement learning agents across multiple card game environments. It functions as a card game environment simulator, a multi-agent RL platform, and a benchmarking toolkit for algorithms like DQN, NFSP, and CFR.

The framework provides a game-agnostic environment interface that decouples agent logic from game mechanics, allowing any policy to interact through a common API. It supports pluggable reinforcement learning algorithms that operate on this interface without modifying game logic, and includes a self-play training loop for generating training data through repeated episodes between copies of the same agent.

RLcard enables running complete game episodes, evaluating agent performance by capturing trajectories and final payoffs, and stepping through game decision trees one action at a time for tree-search algorithm exploration. It also supports human versus AI play against pre-trained or rule-based models through terminal or GUI interfaces. The framework includes deterministic state serialization for use in tree-search algorithms and replay buffers, along with a trajectory recording pipeline for post-hoc analysis.

## Tags

### Artificial Intelligence & ML

- [Card Game Frameworks](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/reinforcement-learning-environments/card-game-frameworks.md) — An open-source framework for developing and evaluating reinforcement learning agents across multiple card game environments.
- [Game Logic Decouplers](https://awesome-repositories.com/f/artificial-intelligence-ml/feature-stores/environment-separation/training-serving-environment-decoupling/game-logic-decouplers.md) — Separates agent logic from environment mechanics, allowing any policy (rule-based, trained, or human) to interact via a common interface.
- [Agent Performance Evaluators](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/reinforcement-learning-environments/reinforcement-learning-performance-visualizers/agent-performance-evaluators.md) — Running complete game episodes to evaluate agent performance by recording trajectories and final payoffs.
- [Game Episode Evaluators](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/frameworks/reinforcement-learning-environments/reinforcement-learning-performance-visualizers/agent-performance-evaluators/game-episode-evaluators.md) — Plays a complete game episode and returns the trajectory and final payoffs for all players. ([source](http://www.rlcard.org/))
- [Training Loop Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/multi-agent-systems/self-play-architectures/training-loop-generators.md) — Orchestrates repeated episodes between copies of the same agent to generate training data for reinforcement learning algorithms.
- [Reinforcement Learning Training](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training.md) — Provides a framework for training reinforcement learning agents in card game environments.
- [Card Game RL Trainers](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training-pipelines/rl-training-workflows/card-game-rl-trainers.md) — Applies DQN, NFSP, DMC, or CFR to learn policies from self-play or fixed opponents within any supported game. ([source](https://cdn.jsdelivr.net/gh/datamllab/rlcard@master/README.md))
- [Competitive Card Game Platforms](https://awesome-repositories.com/f/artificial-intelligence-ml/reinforcement-learning-training/multi-agent-training/competitive-card-game-platforms.md) — A platform that supports training and benchmarking multiple reinforcement learning agents in competitive card game settings.
- [RL Algorithm Benchmarking Toolkits](https://awesome-repositories.com/f/artificial-intelligence-ml/algorithm-benchmarking-libraries/rl-algorithm-benchmarking-toolkits.md) — A toolkit for benchmarking reinforcement learning algorithms like DQN, NFSP, and CFR across standardized card game tasks.
- [Interactive Play Interfaces](https://awesome-repositories.com/f/artificial-intelligence-ml/pre-trained-model-application/interactive-play-interfaces.md) — Loads a trained or rule-based agent and takes actions interactively through a terminal or GUI. ([source](https://cdn.jsdelivr.net/gh/datamllab/rlcard@master/README.md))

### Data & Databases

- [Reinforcement Learning Algorithm Plugins](https://awesome-repositories.com/f/data-databases/data-compression-algorithms/pluggable-architectures/reinforcement-learning-algorithm-plugins.md) — Supports pluggable RL algorithms (DQN, NFSP, DMC, CFR) that operate on the environment interface without modifying game logic.

### Game Development

- [Card Game Environments](https://awesome-repositories.com/f/game-development/game-engines-frameworks/game-engines/game-modules/card-game-environments.md) — Defines a unified API for state representation, action spaces, and payoffs across all supported card games.

### Scientific & Mathematical Computing

- [Game State Steppers](https://awesome-repositories.com/f/scientific-mathematical-computing/monte-carlo-sampling/game-tree-search/game-state-steppers.md) — Advances or reverses the game state one action at a time, enabling tree-search algorithms to explore decision paths. ([source](https://cdn.jsdelivr.net/gh/datamllab/rlcard@master/README.md))
- [State Steppers](https://awesome-repositories.com/f/scientific-mathematical-computing/monte-carlo-sampling/game-tree-search/state-steppers.md) — Provides step-by-step game state traversal for tree-search algorithm exploration.

### Software Engineering & Architecture

- [Game State Steppers](https://awesome-repositories.com/f/software-engineering-architecture/action-based-state-transitions/game-state-steppers.md) — Advances the game state one action at a time, enforcing turn order and legal move constraints.

### System Administration & Monitoring

- [Episode Trajectory Recorders](https://awesome-repositories.com/f/system-administration-monitoring/audit-logs/agent-trajectory-logs/training-trajectory-capture/episode-trajectory-recorders.md) — Plays a full game from start to finish using assigned agents and returns the trajectory and final payoffs. ([source](https://cdn.jsdelivr.net/gh/datamllab/rlcard@master/README.md))

### Part of an Awesome List

- [Interactive Game Opponents](https://awesome-repositories.com/f/awesome-lists/ai/pre-trained-models/interactive-game-opponents.md) — Competes against a pre-trained or rule-based AI model in a supported card game. ([source](http://www.rlcard.org/))
- [Unified Toolkits](https://awesome-repositories.com/f/awesome-lists/ai/unified-toolkits.md) — Toolkit for reinforcement learning in various card games.

### Business & Productivity Software

- [Hashable Game State Converters](https://awesome-repositories.com/f/business-productivity-software/cloud-synced-managers/playback-state-syncing/game-state-serializers/hashable-game-state-converters.md) — Converts game state into a hashable representation for use in tree-search algorithms and replay buffers.
