RLCard

RLCard

★ 3.8 🔖 1200 saves 💰 Free GitHub

RLCard is a toolkit for reinforcement learning research in card games, providing ready-made environments and baseline agents for Blackjack, Leduc Hold’em, Texas Hold’em, Dou Dizhu, Mahjong, UNO and more. Card games are a classic testbed for imperfect-information AI — players must reason about hidden state and opponents — and RLCard standardises them the way Gym standardised control tasks. The project, from Texas A&M’s Data Mining Lab, has around 3,600 stars on GitHub and is MIT licensed.

Overview

Each game ships as an environment with a consistent API: reset, step, legal-action masks and configurable state representations, plus rule-based and random agents for sanity checks. Built-in algorithms include DQN, NFSP and Deep CFR, so researchers can reproduce known results and plug in their own agents for comparison. Dou Dizhu and Mahjong — large, culturally significant games with huge state spaces — are first-class citizens rather than afterthoughts, and the toolkit includes trained models and an online demo. RLCard has been used in coursework and in research on multi-agent learning, game solving and opponent modelling.

Key Features

  • Environments for Blackjack, Texas and Leduc Hold’em, Dou Dizhu, Mahjong, UNO
  • Consistent Gym-style API with legal-action masking
  • Baseline implementations of DQN, NFSP and Deep CFR
  • Pretrained models and rule-based agents included
  • Configurable state representations for different research needs
  • Documentation, examples and an online demo
  • MIT licensed

💳 Pricing

RLCard is completely free and open source under the MIT license. Training agents only costs your own compute time.

Who Is It For

Reinforcement learning researchers, students and game-AI hobbyists who want a standard benchmark for imperfect-information games without implementing the rules and environments from scratch.

🚀 Visit RLCard Official Site

🚩 Report an issue