This is the implementation for the paper "PokéLLMon: A Human-Parity Agent for Pokémon battles with Large Language Models."
The documentation will be fully updated within 3 days.
python >= 3.8
openai >= 1.7.2
- Install Node.js v10+.
- Clone the Pokémon Showdown repository and set it up:
git clone https://github.com/smogon/pokemon-showdown.git
cd pokemon-showdown
npm install
cp config/config-example.js config/config.js
node pokemon-showdown start --no-security
Enter "http://localhost:8000/" in your browsers.
Get GPT-4 API from https://platform.openai.com/account/api-keys
Register in your account on https://play.pokemonshowdown.com/ and get your password.
from poke_env import AccountConfiguration
# No authentication required for the local server
my_account_config = AccountConfiguration("your_username", "your_password")
player = Player(account_configuration=my_account_config)
# Authentication required for the official showdown server
from poke_env import AccountConfiguration, ShowdownServerConfiguration
my_account_config = AccountConfiguration("your_username", "your_password")
player = Player(account_configuration=my_account_config, server_configuration=ShowdownServerConfiguration)
python vs_bot.py # fill in your username and password for PokeLLMon
First, log into your other account manually on the local server, choosing "[Gen 8] Random Battle".
python vs_local_player.py # fill in your username and password for PokeLLMon
Open and log in: https://play.pokemonshowdown.com/
python vs_ladder_player.py # fill in your username and password for PokeLLMon, no need to set up local server.
The environment is implemented based on Poke Env.