How to register Your Artificial Gladiator
A step-by-step guide to joining your Artificial Gladiator Champion (AG Champion) to the Artificial Gladiator League (AGL) platform — from bringing to life your AG Champion to let him gladiate in games and tournaments.
Contents
- Quick start
- Start from a working example
- Step 1: Write your model (the load / get_move contract)
- Step 1b: The config files
- Step 2: Create your Hugging Face repositories
- Step 3: Prove ownership and SHA pinning
- Step 4: Register in the Gladiator tab
- Step 5: Run Diagnostics
- Step 6: Compete in games and tournaments
- Best practices
- Troubleshooting
- FAQ
Quick start
The shortest path from nothing to a working, registered model. Details for every step are further down this page.
- 1 Copy the example model. Open the example account linked below and duplicate one of its repos into your own Hugging Face account.
- 2 Make your copy Gated. In your repo's Settings, enable Access Requests. The platform rejects a public model repo.
-
3
Approve
ArtificialGladiatorLeague. In the Access settings of your repo, approve that account (on the Gladiator tab the yellow button Open Access Settings takes you there). - 4 Enter the repo. Open the Gladiator tab on your Profile, type or paste your model repo, and click the gold button Save and verify.
-
5
Add
AGL_VERIFY.txt. Put it at the root of your model repo (and of your data repo too, if you use one) with the code shown on the Gladiator tab, then click Verify Ownership. - 6 Run Diagnostics. Open the Diagnostics tab and click Run diagnostics. Fix what it reports and run it again until it says RESULT: your model works correctly.
Start from a working example
The easiest way to get a model that passes every platform check is to copy one that already does:
- Open https://huggingface.co/chaim-duchovny and open a repo.
- Use Duplicate this repo to copy it into your own account.
- Make your copy Gated (Settings, Access Requests).
- Edit the files to build your own Artificial Gladiator.
Write your model
Your AG Champion is Python code that receives a board position and returns a legal move string. The logic inside is entirely up to you — Monte Carlo Vector Search (MCVS), random play, minimax, MCTS, a neural network, or anything else. Your code is downloaded to the platform and executed inside an isolated Docker sandbox on the platform's own servers — no external hosting or always-on server required on your end.
The contract: load(ctx) and get_move(state, fen, player)
Your entry-point module must define both functions. There is no other interface.
state = load(ctx)is called once when your model is loaded. Open your weights, opening books and other files here and return whatever you want to keep; it is passed back to you asstate.ctx.model_dirandctx.data_dirare real, read-only folders (pathlib.Path) holding your model repo files and your data repo files.ctx.data_dirisNonewhen no data files are available. The platform never opens your data files for you; read them yourself insideload().move = get_move(state, fen, player)is called for every move.fenis the position,playeris"w"or"b"(the side to move). Return the move as a plain string.
# chess_mcvs.py - at the root of your model repo
import random
import chess
def load(ctx):
# Called once. ctx.data_dir is None if no data files are available.
state = {"opening_book": None}
if ctx.data_dir is not None:
book = ctx.data_dir / "opening_book.txt"
if book.exists():
state["opening_book"] = book.read_text(encoding="utf-8").splitlines()
return state
def get_move(state, fen, player):
# Return one legal move in UCI notation, for example "e2e4".
board = chess.Board(fen)
legal = list(board.legal_moves)
if not legal:
return ""
# ---- replace this with your real model ----
return random.choice(legal).uci()
By default the platform imports <game>_mcvs.py (chess_mcvs.py for Chess, breakthrough_mcvs.py for Breakthrough). Use entrypoint in config_model.json to name a different file.
Move format
- Chess: UCI notation, for example
e2e4, ore7e8qfor a promotion. Not SAN such asNf3. - Breakthrough: exactly four characters, the square you move from followed by the square you move to, for example
a2a3orb2c3. The position is a FEN-like string with rank 8 first,Wfor white pieces,Bfor black pieces, digits for empty squares and the side to move at the end; the start position isBBBBBBBB/BBBBBBBB/8/8/8/8/WWWWWWWW/WWWWWWWW w. A piece moves one square forward, straight (only onto an empty square) or diagonally (onto an empty square or an enemy piece). White moves toward rank 8, black toward rank 1.
# breakthrough_mcvs.py - minimal skeleton
def load(ctx):
return {}
def get_move(state, fen, player):
# fen example: "BBBBBBBB/BBBBBBBB/8/8/8/8/WWWWWWWW/WWWWWWWW w"
# Return "from-square" + "to-square", for example "a2a3".
return "a2a3"- -No web server, Space, or hosted endpoint to run. Your model repo stays Gated; the platform only needs the read access you approve.
- -The sandbox has no network access, a read-only filesystem (only a small temporary folder,
/tmp, is writable) and strict CPU, memory and time limits. Calls such asrequestsorurllibwill fail. - -The sandbox image is fixed and nothing is installed at match time. The project's sandbox image definition installs
numpy,python-chessandtorch(CPU only); do not depend on other third-party packages. - -Save your files as UTF-8. The platform also tolerates common Windows encodings (cp1255, cp1252) and reports a warning when it has to fall back.
The config files
Two small JSON files describe your repos. Add both: the sandbox only needs config_model.json fields it recognises, but the Repo File Status panel on the Gladiator tab and the Diagnostics tab also read files from config_model.json (model repo) and config_data.json (data repo) and report a problem when they cannot be read.
config_model.json (root of the model repo)
{
"schema_version": 1,
"entrypoint": "chess_mcvs.py",
"data_files": ["opening_book.txt"],
"requirements": ["numpy", "python-chess"],
"files": ["chess_mcvs.py"]
}schema_version(integer, optional): manifest format version. Use1.entrypoint(string, optional): the.pyfile to import. Default:<game>_mcvs.py. If that file does not exist either, every.pyfile in the repo is imported.modules(list of strings, optional): an older alternative toentrypoint. Every listed file is imported and the last one wins.data_files(list of strings, optional): files your model expects to find in your data repo. The model check fails if one of them is missing.requirements(list of strings, optional): informational only. Nothing is installed.files(list of strings): the files that must exist in the model repo. Used by the Repo File Status panel and by Diagnostics; the sandbox does not use it.
The file must be valid JSON (no comments, no trailing commas). A listed entrypoint or modules file that does not exist is reported as a problem.
config_data.json (root of the data repo)
{
"files": ["opening_book.txt"]
}
files lists every file that must exist in the data repo. It is read from the main branch and is used by the Repo File Status panel and by Diagnostics. Keep it consistent with data_files in config_model.json.
Create Your Hugging Face Repositories
You need a model repo, and optionally a data repo. Each has its own visibility requirement, explained below.
Repo 1 — Model Repository (HF Model repo, required)
Contains your Artificial Gladiator code and config_model.json. Put the files on the main branch.
Also required: approve the platform's Hugging Face account ArtificialGladiatorLeague in the repo's Access settings (the yellow button Open Access Settings on the Gladiator tab opens that page). The platform uses that account to read your repo for the ownership check and to download it. Without the approval, saving, ownership checks and inference all fail.
Repo 2 — Data Repository (HF Dataset repo, optional)
Needed if your Artificial Gladiator uses runtime data files — opening books, precomputed tables, trained weights, etc. The platform copies it next to your model and your code reads it from ctx.data_dir.
If you leave the data repo field empty, the platform looks for your-username/<game>-data (for example your-username/chess-data) when it checks your files. On the Gladiator tab the Chess data repo field is pre-filled that way when your model repo has an owner; you can edit it.
Prove Ownership & SHA Pinning
Before your AG can gladiate, you must prove you own the repositories. The platform also pins the commit SHA to detect any changes during tournaments.
Ownership Verification
- 1 Save your repo on the Gladiator tab of your Profile. The platform generates a unique 32-character verification code and shows it there (with Copy file name and Copy code buttons).
-
2
Create a file named
AGL_VERIFY.txtat the root of your model repo (mainbranch) containing exactly the verification code. If you also set a data repo, add the same file with the same code to the root of the data repo. Surrounding whitespace or a trailing newline is ignored. - 3 Click Verify Ownership (shown as Re-check Ownership once verified). The platform account reads the file from each repo. When the model repo and the data repo (if set) both match, you are verified. The platform then immediately runs the model check and, if it passes, pins the commit as your approved version.
SHA Pinning (ongoing)
- -At tournament registration — the exact commit SHA of your model repo is recorded.
- -Before and during tournament games — the SHA is checked again. Any commit since registration triggers automatic disqualification.
Register Your AG Champion in the Platform
Open the Gladiator tab on your Profile. Each game (Chess, Breakthrough) has its own card with numbered steps (Enter repo, Approve platform account, Add AGL_VERIFY.txt, Verify), and a line at the top of the tab tells you the next step.
- -Hugging Face Model Repo —
username/my-AG. You may paste a full huggingface.co link; it is converted tousername/my-AG. A Space URL (*.hf.spaceorhuggingface.co/spaces/...) is rejected. - -Hugging Face Data Repo —
username/my-AG-data. Leave blank if you do not use one.
- -Save and verify (gold): saves the repo and, if saving succeeded, immediately runs the same ownership check as Verify Ownership.
- -Connect Repo / Update Repo & Re-issue Code: saves the repo and issues a verification code (unless the repo is unchanged and already verified).
- -Verify Ownership / Re-check Ownership: checks
AGL_VERIFY.txtand runs the model check.
Run Diagnostics
The Diagnostics tab on your Profile checks a registered model from start to finish and tells you in plain language what to fix. Pick the game, click Run diagnostics and read the report. It can take a few minutes, because the last step runs your model in the sandbox.
- Registration — a model repo is registered for this game.
- Model repo access — the repo exists, is Gated, and the platform account has access.
- Ownership proof — the model repo (and the data repo, if set) are ownership-verified.
- Repository files — the files listed in
config_model.jsonandconfig_data.jsonare present. - Version and integrity — approved and current SHAs, the repo-change cooldown and your rated-games count.
- Stored contract result — whether the model check last stored active, pending or failed.
- Live contract test — runs your
load()andget_move()in the sandbox on three sample positions and checks that every move is legal.
Compete in Games & Tournaments
Head to the Lobby, challenge another player. Your AG Champion plays automatically in real time. Results update your Elo.
Browse open tournaments, register, play 30 rated games to qualify, mark yourself Ready. The system schedules and runs all matches automatically.
get_move runs in the sandbox
>
Move validated
>
Game state updated
- Your model stays loaded in a sandbox container between moves, so
load()runs once and each move only pays forget_move(). Opening the Lobby or a game page starts it ahead of time. - Each move has a time limit set by the server (30 seconds by default). If your model exceeds it, returns nothing, raises an error or returns an illegal move, the platform plays a random legal move for you (captures preferred) instead.
- Exception: if your model's last model check failed, no random move is played and you forfeit the game.
- The time your model spends thinking also counts against your game clock.
See How it works for the full picture.
Best Practices
Load models, weights and opening books inside load(ctx), which runs once. Never read files inside get_move — that time is spent on every move and counts against your clock and the move timeout.
The platform enforces a per-move timeout (30 seconds by default). Budget your search depth or inference time well under it. A model that is too slow gets random moves played for it.
The sandbox has fixed CPU and memory limits (1 CPU and 512 MB by default) and no network access. Keep your dependencies minimal and avoid anything that expects internet connectivity.
Nothing is pip-installed at match time. Use only what the sandbox image provides (numpy, python-chess, torch CPU). If you like, note the versions you tested with in your repo's requirements.txt for your own reference.
Always return a legal move as a plain string. Chess uses UCI notation (e.g. e2e4) and Breakthrough uses four characters, from-square then to-square (e.g. a2a3). Anything else is treated as no move.
Run Diagnostics, then play several quick matches in the Lobby to confirm your AG Champion responds correctly at game speed before entering a tournament. The 30-game qualification window is the ideal calibration period.
Troubleshooting
- A move that takes longer than the server's move timeout (30 seconds by default) is cancelled, the sandbox container is restarted, and a random legal move is played for that turn. Reduce search depth, use a lighter model, or pre-compute in
load(). - Your code raised an exception, returned nothing or returned an illegal move: the platform plays a random legal move instead. Run Diagnostics to see the exact error.
- If your model's last model check failed, no random move is played and you forfeit the game. Fix the problem and click Verify Ownership again.
- Ensure
AGL_VERIFY.txtis at the root of your model repo on themainbranch — not inside a subfolder. - If you set a data repo, it needs its own
AGL_VERIFY.txtwith the same code. - The file must contain exactly the code shown on the Gladiator tab. If you re-saved a changed repo, a new code was issued: use the new one.
- The model repo must be Gated and you must have approved ArtificialGladiatorLeague in its Access settings. The data repo must be Public.
- Log out and log in again, then run Diagnostics again. Logging in lands you on the Lobby, which loads your model and downloads your data repo files to the server in the background. Give it a minute before you re-run.
- If it keeps saying the same thing, check the Repo File Status panel on the Gladiator tab for missing files.
- This is a platform issue, not a problem with your model. Try again later.
- The Gladiator tab shows the reason. Typical causes: a syntax error, a missing
load(ctx), invalidconfig_model.json, a file listed indata_filesthat is missing from the data repo, or a move that is not legal for one of the three sample positions. - Fix the repo, then click Verify Ownership (or Save and verify) again.
- Enter the repo as
username/repo-name. A huggingface.co model or dataset link is converted automatically; a Space URL is rejected. - A public model repo is rejected: set it to Gated first. The data repo is the opposite: it must be Public.
- You pushed a commit to your AG Champion repo after registering for the tournament.
- Even trivial changes (README edits, whitespace) produce a new SHA. Freeze the repo once registered.
- Confirm your move string matches the expected format for the game — UCI for Chess (e.g.
e2e4) or four characters from-square then to-square for Breakthrough (e.g.a2a3). - Make sure you return a plain string — not a list, not a JSON object, not
{"move": "..."}.
- Confirm your data repo is Public on Hugging Face.
- Check that filenames in
config_data.jsonand indata_filesofconfig_model.jsonmatch exactly (case-sensitive) the filenames in your repo, and that yourload()reads them fromctx.data_dir.
Frequently Asked Questions
Can I use PyTorch or other libraries?
Only what the sandbox image contains. The project's sandbox image installs numpy, python-chess and torch (CPU). The sandbox has no network access, so packages can't be installed at match time; develop and test locally against the same libraries.
What game types are supported?
Currently Chess and Breakthrough. Each game is registered independently, so you can enter different AG Champions for each.
Do I need a Hugging Face account?
Yes — to create your model repo (and optional data repo). The platform does not ask you for an API token. It reads your Gated model repo with its own account, ArtificialGladiatorLeague, which you approve in the repo's Access settings.
Can I update my AG Champion between games (outside tournaments)?
Yes, you can update your AG Champion or change your repository links outside of tournaments. However, changing your model repo ID resets your rated games counter. You will need to play another 30 rated games before you can enter tournaments again.
Does my AG Champion's model repo have to be Gated?
Yes. When you save the repo the platform rejects a public model repo. Gating also protects your code from being copied by other visitors. You must approve the ArtificialGladiatorLeague Hugging Face account so the platform can verify and download it; without this, saving, ownership verification and inference fail.
Why must the data repo be Public?
The platform checks it anonymously, without a token, when you save it, and rejects a data repo that is not public.
Why do I need 30 rated games before entering tournaments?
It establishes a meaningful Elo rating and confirms your AG Champion is stable and reliably responsive before entering structured competition.
How strict is the per-move time limit?
Each move has a server-side limit (30 seconds by default). Exceeding it does not forfeit the game: a random legal move is played for that turn (unless your model's last model check failed, which forfeits). Your thinking time is also deducted from your game clock. Always keep get_move fast.
What is "AI thinking time" and is it guaranteed?
"Thinking time" (configured when creating or joining a game) is a target pace for AI moves, not a hard guarantee. Actual move latency depends on your model's inference speed inside the Docker sandbox — heavier models or deep searches take longer. If a move arrives faster than the target, the platform waits to reach the target before showing it; if the model responds slower, the move is still accepted and used. Both the game creator and the joining player each set their own thinking-time target independently for their own AI.
What ranking titles are used on the AGL platform?
AGL titles are based on the FIDE Elo scale. Your AG Champion earns a title automatically as its Elo rating climbs — separately for Chess and Breakthrough.
| Title | Elo range |
|---|---|
| Super GM | 2700+ |
| Grandmaster | 2500–2699 |
| Intl. Master | 2400–2499 |
| FIDE Master | 2300–2399 |
| Cand. Master | 2200–2299 |
| Expert | 2000–2199 |
| Class A | 1800–1999 |
| Class B | 1600–1799 |
| Class C | 1400–1599 |
| Class D | 1200–1399 |
| Beginner | < 1200 |
Ready to Gladiate?