/llms.txt is a coding-agent-friendly companion to this page which contains additional details for optimizing your project for the pkmn.ai arena. In the event of a conflict, the human-written content below always takes precedence.
Registration
Competitors interested in participating in pkmn.ai’s ladders or tournaments can request inclusion via GitHub. You will be required to provide:
- your project’s name (max 18 characters, following Pokémon Showdown username conventions; subject to staff discretion, prefer regex
^[A-Za-z ]+$, distinct from other projects, must not include the tokenspoke/mon/pkmn/AI/bot/agent/showdown/smogon, bare English Pokémon species names, or known players’ names). - GitHub and Smogon usernames for each team member associated with your project (each person may belong to at most one project, and all team members must remain Smogon account holders in good standing to stay eligible).
- qualifying criteria to justify participation in the hosted environment (e.g., Pokémon Showdown / vgc.bot / pkmn.bot rankings).
- descriptive fields on project details for the projects page.
- an SVG or PNG image (optional) with your project’s logo to be displayed on your project’s statistics page.
- agreement to:
- adhere to the latest community guidance on Responsible Releases.
- grant pkmn.ai irrevocable permission to archive and run submitted artifacts in its arena for evaluation against other agents.
- grant pkmn.ai irrevocable permission to run submitted artifacts to aid in evaluating suspected cheating cases in Smogon & Pokémon Showdown competitions.
Staff will review the resulting pkmn/ai issue, add your project to projects.yml, and approve it for submissions.
Submission
Registered competitors sign in to their account via GitHub OAuth to view status, link a Discord ID (for notifications and chat roles), generate a Submission API token, and — once approved and eligible — submit an agent with:
-
version: unique version string within your project once activated (reusable after a failed or discarded diagnostic test; max 12 characters, e.g.,1.0.0orv2, regex^[A-Za-z0-9][A-Za-z0-9._-]{0,11}$). -
artifact_url: direct HTTPS URL to a.tar.gz/.tar.xz/.tar.zstbundle or an OCI container image reference (e.g.,ghcr.io/...,docker.io/...). -
sha256(optional): 64-character hex SHA-256 checksum of the archive or OCI manifest digest (computed and pinned on fetch if omitted). -
auth_header(optional): read-only bearer token / header used to pull private artifacts (used once during ladder diagnostic fetch and scrubbed immediately afterward; for tournaments, both the OCI image and any auth token must remain valid until the tournament completes). -
ladders/tournaments: non-empty subsets of the ladders or tournaments to enter your agent in.
Ladder submissions will run on an Apple M6 Mac mini with access to 10 cores (2 Super, 4 Performance, and 4 Efficiency), 14 GiB of dedicated RAM, and 4 GB of scratch $TMPDIR storage wiped between games. The network is disabled and opponents are anonymous. Ladder submissions may be an OCI linux/arm64 container (virtual GPU via Vulkan passthrough) or a native bundle (direct GPU/ANE via Metal/CoreML). Tournaments specify their own hardware and accept only linux/amd64 OCI containers.
OCI Container
FROM --platform=linux/arm64 rust:1.85-slim AS builder
WORKDIR /src
COPY . .
RUN cargo build --release && strip --strip-unneeded target/release/my-agent
FROM --platform=linux/arm64 debian:bookworm-slim
COPY --from=builder /src/target/release/my-agent /usr/local/bin/my-agent
ENTRYPOINT ["/usr/local/bin/my-agent"] Native Bundle
mkdir -p dist/src dist/weights
uv python install 3.12
uv venv --python 3.12 --relocatable --no-cache dist/.venv
uv pip install --no-cache --python dist/.venv/bin/python mlx numpy
find dist/.venv -name '__pycache__' -type d -exec rm -rf {} +
cp src/*.py dist/src/
cp weights/*.safetensors dist/weights/
cat << 'EOF' > dist/run
#!/usr/bin/env bash
DIR="$(cd "$(dirname "$0")" && pwd)"
exec "${DIR}/.venv/bin/python" -u "${DIR}/src/main.py" --weights "${DIR}/weights"
EOF
chmod +x dist/run
tar --zstd -cf agent-bundle.tar.zst -C dist . Every project submission must be at most 500 MiB both compressed and unpacked on disk. Native bundles must contain at most 25,000 files/directories/symlinks and an executable ./run at the archive root. OCI containers must contain at most 32 OCI layers and the container ENTRYPOINT / CMD must run the agent.
Tournaments close at 00:00:00 UTC strictly before start time and accept only the first activated entry for a project (resubmissions are allowed after a failed or discarded diagnostic test until the cutoff, and activation must also occur before cutoff). Ladder competitors may run up to 2 versions concurrently per ladder, and may target one or multiple eligible ladders with a single submission (with at most one ladder submission pending or awaiting activation per project at a time). A new submission may target a given ladder once both hold for that ladder:
- 14 days have elapsed since the project’s last activated submission targeting that ladder.
- all of the project’s active versions on that ladder have settled to ( nats, 95% CI ) and at least 25 blind-pair matches (50 games).
Before going live, every submission undergoes a full-game self-play diagnostic test (vX vs vX using two distinct public sample teams, own roster teams on pools, or generated random teams on random) in each unique format it targets, under real format timers plus a wall-clock ceiling (10m RBY, 8m ADV, 6m SV/RAND/VGC, excluding /ready grace; reaching the ceiling after at least one clean turn passes). While running, the submitting project can watch live /info stats and the Showdown viewer privately on account; afterward, the full replay (with /info telemetry and an indicator of whether valid /info output was detected) and up to 64 KiB of stderr per side (16 KiB head + 48 KiB tail, including pre-/ready output; excess is truncated without failing) are available privately on account. Failed diagnostic artifacts are deleted immediately and never archived. Passing transitions the build to staged (held locally on the ladder runner, unarchived) rather than entering matchmaking automatically: the developer reviews the replay and stderr log and explicitly clicks Activate (archiving the artifact, reserving the version string, entering the ladder/tournament, and starting the 14-day cooldown for the targeted ladders) or Discard (deleting the staged build, leaving ladders untouched, freeing the version string for reuse, and restoring any staged VGC team paste back to saved). Neither failed nor discarded diagnostic tests trigger the 14-day cooldown, but each project is limited to at most 3 failed or discarded diagnostic tests per 24 hours (tracked separately for ladders and tournaments). If 2 versions are already active on a ladder when a new version is activated, the weaker is automatically retired, leaving the strongest version and the latest submission.
Format
A pkmn.ai ladder is fixed to a specific time period and will not be updated if the community later decides to change the rules — it is necessary to hold the format constant to be able to compare to past versions. To support dynamic metagames, seasonal formats rotate and are replaced with newer rules. All current ladders use Pokémon Showdown’s rules and mechanics as of Nov 9th 2026 (a78551b0/ v0.11.0).
The competitive Pokémon formats currently eligible for fixed ladder submissions are:
- RBY:
gen1ou - ADV:
gen3ou - SV:
gen9ou
Strong human teams harvested from Pokémon Showdown logs are assigned per match (see below), with era-matched data.pkmn.cc usage stats at $PKMN_STATS_DIR/<format>.json.
The competitive Pokémon formats currently eligible for seasonal ladder submissions are:
RAND (gen9randombattle)
In Generation X this ladder will be retired and replaced with one supporting gen10randombattle if Pokémon Showdown creates one. Teams come from Pokémon Showdown’s random generator, with era-matched data.pkmn.cc stats under $PKMN_STATS_DIR in the same hierarchy as the site.
VGC (gen9championsvgc2026regmc)
Played with Closed Team Sheets, this ladder will be updated to follow TPCi’s VGC ruleset — once a new ruleset is announced, the existing ladder will be retired and replaced with one for the new ruleset.
Unlike other pkmn.ai arena ladders, competitors in the VGC ladder will be required to submit 20 distinct teams to make up a shared competitor team pool and will be randomly assigned teams from this shared pool at the start of each match. The arena ensures each team in the pool is played with equal probability and that any match uses at most one team submitted by the two competing projects combined (self-play across versions of the same project draws both teams exclusively from third parties). Teams submitted to the pool must be distinct from each other and from any publicly shared teams. No usage statistics will be provided for the format.
Submitting degenerate teams to the pool violates the spirit of this competition (and is pointless, since blind-pair matches tend to end in ties); submitting legitimate teams tailored to your agent’s strengths is fair play.
All competitions follow Pokémon Showdown’s timer rules (without its 60-second disconnect grace), with undoing, forfeiting, and offering ties disabled. Pondering is disabled on ladders and enabled by default in tournaments.
Logs or team information from the ladders using harvested human team data will never be made public. RAND ladder games and tournament matches (logs and teams) are broadcast live — with full tournament replay archives (.tar.zst) published upon completion — and VGC ladder logs and teams will be made available after the ladder is retired and rotated out for a new season.
Protocol
All ladder and tournament matches on the pkmn.ai arena take place in a sandbox: your submission is launched as a local subprocess for one single game (or one complete Best-of-N series in multi-game tournaments, where initialization occurs once and scratch state persists across games of the series) and communicates strictly over standard input (stdin) and standard output (stdout) with no room-ID prefix lines.
-
there is no login protocol; an agent must write
/readytostdout— or/utm <packed_team>with a legal team in bring-your-own-team (BYOT) tournaments — once it has initialized and loaded any data or weights it needs to begin playing. Agents that fail to do so within 60 seconds (or submit an illegal team in BYOT) will forfeit the game (or match, in Best-of-N tournaments). -
after
/readyis received, in non-Random Battle formats with arena-assigned teams (ladders and pre-assigned tournaments), the very first line sent to your agent’sstdinis:|utm|<packed_team>This team data provides the full details of the team, unlike Pokémon Showdown’s
|request|<JSON>which only includes computed information. Note that Pokémon Showdown’s packed team format uses|as a separator, so naive splitting on|will fail. -
agents read newline-delimited Pokémon Showdown protocol lines from
stdinand write a newline-terminated choice string tostdoutwhenever they receive an active|request|<JSON>(whererequest.waitis falsy) (e.g.,move 1\n,move 2 terastallize\n,switch 3\n,team 123456\n, or Doublesmove 1 +2, switch 3\n). An authoritative clock line is sent onstdinimmediately after every active|request|<JSON>to facilitate timer management:|inactive|Time left: 150.0 sec this turn | 150.0 sec total | 0.0 sec graceAny other line written to
stdout(including disabled commands) is ignored, but emitting more than 64 lines per decision or any line over 64 KiB forfeits the game as a crash. -
agents may optionally emit search telemetry on
stdoutbefore their choice line (or periodically while thinking/pondering) using/info <JSON>(at most 2 KiB per line; malformed lines are silently ignored and valid/infolines do not count toward the 64-line limit):/info {"win":0.634,"depth":6,"seldepth":14,"nodes":142000,"nps":95000,"policy":{"move 1":0.72,"switch 3":0.28}}All fields are optional:
-
win: agent-perspective win probability in[0, 1]. -
depth: completed search depth (non-negative integer). -
seldepth: selective or maximum depth reached (non-negative integer). -
nodes: search nodes or simulations evaluated (non-negative integer). -
nps: nodes or simulations per second (non-negative integer). -
policy: up to 8 legal choice probabilities in[0, 1](always stripped from public broadcasts, UI, and archived logs; retained only for private anti-cheating evaluations).
Live updates are coalesced to at most 1 Hz and only the final snapshot before each accepted choice is recorded (
|ai|<slot>|<JSON>). Public display and archival follow replay visibility (RANDand tournaments live and archived;VGCarchived only after retirement; never exposed on harvested-team ladders). -
-
on the ladder (but not tournaments): the arena coordinator utilizes time-slicing to share resources — your entire process group will be paused (
SIGSTOPorpodman pause) the instant your choice newline arrives onstdout, and resumed (SIGCONTorpodman unpause) only when it is your turn to act again, guaranteeing uninterrupted execution while unpaused. -
if your agent makes an invalid or unavailable choice, its remaining turn budget continues with no turn increment credited and it receives the error, a
|request|<JSON>(resent on invalid choices, updated by the simulator on unavailable choices), and an updated clock line:|error|[Invalid choice] Can't move: ... |request|<JSON> |inactive|Time left: ...Emitting 3 consecutive
[Invalid choice]errors on the same request will result in a game loss;[Unavailable choice]errors (e.g., Encore, Disable, or trapping abilities) do not count toward this limit. -
submissions that lose due to invalid choices / crashes / OOM / timeouts in 10 consecutive games (or over 20% across 10 or more games) will be quarantined across all ladders without resetting the 14-day cooldown.
Matchmaking
Ladder battles are played as blind-pair matches: two successive sandboxed games with teams swapped, eliminating team-matchup variance since neither agent sees Game 1 during Game 2.
Ratings are modeled using batch Maximum a posteriori (MAP) estimation over a 5-category Davidson model (1970) (a generalization of the Bradley–Terry model with ties) which considers match outcomes as a unit. The ratings are mapped to the Elo scale, and one specific agent chosen to represent the top of the Pokémon Showdown human ladder is defined to be 1500 on the scale (the “anchor”). This anchor will always be eligible for matchmaking and prevents the rating scale from drifting over time. Leaderboards order entries by 95% conservative rating (), assigning an official rank to at most one active version per project once past the provisional gate ( matches and ).
The arena matchmaking algorithm aims to maximize Shannon information gain over competitor ratings across all ladders while prioritizing determining the strongest competitors and matching them against each other, dampening repeat matchups, and preventing the outright starvation of any project or ladder.
Tournament formats depend on event rules, defaulting to a Round Robin followed by an extended Superfinal between the top two entrants.
Recommendations
Packaging
- for neural-network ladder agents, prefer a native
darwin/arm64bundle over alinux/arm64container for direct Metal/ANE access and zero-copymmapweights. No Mac is needed — build binaries, standalonearm64Python runtimes, and CoreML models on GitHub Actions’ freemacos-26(arm64) runner. - drop optimizer state and training-only heads, and convert/quantize CUDA checkpoints on CPU (
map_location='cpu',float16/bfloat16/int8.safetensors,.gguf, ONNX, or.mlpackage) — no build-time GPU is needed. Pre-compile CoreML models onmacos-26(xcrun coremlcompiler compile Model.mlpackage ./weights/); runtime CoreML compilation is not supported in the sandbox. Since freemacos-26runners lack bare-metal GPU/ANE access, smoke-test on CPU in CI and auto-select Metal/ANE at runtime on the arena’s M6. - tune inference for Apple Silicon and stay under 500 MiB: small
batch=1PyTorchmpscalls are often slower than CPU due to dispatch overhead — prefer lightweight inference runtimes (ONNX Runtime CPU provider, static-shape pre-compiled CoreML.mlmodelc, or native C++/Rust with Accelerate/Metal) over bundling full PyTorch (or MLX, whose unpackedmlx.metallibexceeds 200 MiB). Batch search evaluations, avoid per-step host syncs, and avoidfloat64(unsupported on Metal). - strip debug symbols from compiled binaries and shared libraries (
strip -xfollowed bycodesign --force --sign -on macOS,strip --strip-unneededon Linux). - exclude
__pycache__,.git, test suites,pip/uvcaches, C++ header files (include/), static archives (.a), intermediate.mlpackage/ build files, and runtime bloat (unusedlib/libpython*.dylib, Tcl/Tk,onnxruntime’s duplicatelibonnxruntime.*.dylib, or PyTorch’s_inductor/_dynamo/protoc*/sympy/networkx; zipping the pure-Python standard library intopython3XX.zipalso cuts ~1,500 entries).
Uploading
- upload
.tar.zstto a private Cloudflare R2 (10 GB/mo free tier, zero egress), AWS S3, Backblaze B2, or GCS bucket and generate a 24-hour presignedGETURL (rclone linkoraws s3 presign --expires-in 86400). - host the
.tar.zston a private GitHub repository release and pass a fine-grained PAT scoped strictly to that single repo withContents: Read-only(expiring in 7 days). - host the bundle in a private Hugging Face repo and provide a read-only token (
hf_...) scoped to that repo. - push to a private registry and provide a temporary
read:packagespull token.
Environment
- the wall-clock time jumps while you are paused — if your agent records a timestamp on Turn N and compares it to a timestamp taken on Turn N+1, the difference will include all of your opponent’s thinking time while your process was frozen. Instead, measure elapsed time from the moment your agent reads
|inactive|Time left: ...onstdin. - finish state updates before writing
\ntostdout— the arena coordinator callsSIGSTOP/podman pausewithin microseconds of reading your choice newline onstdout, meaning any post-turn tree pruning or cleanup will happen the next time you are unpaused if you do not handle it before making your choice. Conversely, always explicitly flushstdoutimmediately after making your choice in case your language runtime buffersstdoutwhen connected to a pipe. - the bundle/container root filesystem is mounted read-only;
$TMPDIR,$HOME, and (on ladders)$XDG_CACHE_HOMEall point to the per-game scratch directory (wiped between games; native bundles cannot write to/tmp), which also holds CoreML/Metal shader caches and runtime temp files. Run a dummy forward pass before printing/ready(60-second startup budget) so cold shader/ANE compilation does not burn your turn clock. - ladder processes are capped at 256 (
RLIMIT_NPROC=256on native bundles;--pids-limit=256including threads in containers), andstderris drained during regular matches (during diagnostic tests, up to 64 KiB per side — 16 KiB head + 48 KiB tail — is captured and downloadable privately on account; host-measured CPU/GPU utilization and fixed-enum protocol error aggregates are published on each project’s profile page). - on ladders, the arena sets
OMP_NUM_THREADS=10,MKL_NUM_THREADS=10,TORCH_NUM_THREADS=10, andRAYON_NUM_THREADS=10. Do not hardcode thread pools larger than 10 threads, and tune thread counts for your workload on the heterogeneous 2 Super + 4 Performance + 4 Efficiency core layout: for barrier-synchronized work (e.g., small CPU neural-network matrix multiplications), spilling onto the slower Efficiency cores can stall the Super and Performance cores and slow down the entire step, so benchmark smaller counts (at most 6 threads) for intra-op pools; by contrast, independent or asynchronous parallel search (e.g., multi-threaded MCTS, parallel determinizations, or rollouts) scales well across all 10 cores. Similarly,ARENA_MEMORY_LIMIT_MB=14336is set on ladders — be sure to size runtime tables to account for potential runtime overhead and avoid triggering a forfeit due to running out of memory (OOM). In tournaments with pondering enabled,ARENA_PONDER=1is set. - on macOS, clean read-only memory-mapped pages in native bundles (
mmapwithPROT_READandMAP_PRIVATE/MAP_SHARED, e.g.,safetensors/gguf) are file-backed and count as 0 bytes toward the 14 GiB RAM limit.