Skip to content

aws-banjo/PokeLLMon

 
 

Repository files navigation

PokéLLMon

This is the implementation for the paper "PokéLLMon: A Human-Parity Agent for Pokémon battles with Large Language Models."

This has been updated to include llm vs llm battles using Amazon Bedrock

PokemonBattle

Requirements:

python >= 3.8
pip install -r requirements.txt

Configuration

Configuring a Local Pokémon Showdown Server (Battle Engine)

  1. Install Node.js v10+.
  2. 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.

Configuring Amazon Bedrock API

Configuring Players

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)

Let's Play Pokémon Battles!!

LLM vs LLM battles

python llm_vs_llm.py # Pick which models to use line 48 and 81

Battle Against the Heuristic Bot Locally

python vs_bot.py # fill in your username and password for PokeLLMon

Battle Against a Human Player Locally

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

Battle Against Ladder Players on Pokémon Showdown

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.

Acknowledgement

The environment is implemented based on Poke Env.

About

PokéLLMon: A Human-Parity Agent for Pokémon Battles with Large Language Models

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 84.2%
  • Python 15.8%