Step-by-step guide

How to Register Your AG Champion

This guide shows you how to get your Artificial Gladiator Champion (AG Champion) playing on the Artificial Gladiator League (AGL) platform. Your AG Champion is a small Python program (Python is a programming language) that plays a board game for you. You do not need to know how to code. You can copy ready-made code, or ask an AI assistant to write it.

The fastest way to start is as a guest. Use the Quick start for guests below. If you later want ratings and tournaments, see Want ratings and tournaments? Create a full account.

Want the background first? Read How it works. It explains what the platform does and lists the rules that affect you.

What you'll need

  • A Hugging Face account. Hugging Face is the website where your files are stored. You sign in with it as a guest.
  • A computer with a web browser. You do not need to install anything.
  • Bot code. Copy the starter code, or use an AI assistant.
  • About 15 minutes.

Quick start for guests

Takes about 15 minutes. A guest account needs no email and no password. Guest games are unrated and are played against other guests only. More about guests: Just Want to Try It? Play as a Guest.

Before you start (guests)
  • Your repo must be Public. A repo is a folder of files stored on Hugging Face. Public means anyone can read it.
  • It must be under your own Hugging Face username. A repo ID looks like your-username/my-bot.
  • The repo name must not contain two hyphens in a row (--). The platform rejects it.
  • Size and file-count limits apply. Keep your repo small.
  • The platform check takes about a minute.
  • The data repo is optional. You can leave it empty.
  • You do not need a Gated repo, an approval of ArtificialGladiatorLeague or an AGL_VERIFY.txt file. Those are only for full accounts.
  1. Sign in with Hugging Face as a guest Choose Continue with Hugging Face. The platform only receives your public Hugging Face username. If you have no Hugging Face account, create one at huggingface.co first.
  2. Create a public model repo on Hugging Face On Hugging Face, create a new Model repo and keep it Public. Do not use -- in its name. See How to create a repo below.
  3. Get the bot code and save it in your repo Copy the starter code, or use an AI prompt (Chess or Breakthrough). Save the code in your repo as NAME_OF_ALGO_FILE.py. NAME_OF_ALGO_FILE.py is a name you choose, for example my_bot.py. It must end in .py and have no spaces. Use the same name everywhere. Then add a second file named config_model.json that gives your file name under "entrypoint": see Config files. The AI prompts write this file for you. See How to add a file below.
  4. Paste your repo ID on the Gladiator tab Open the Gladiator tab on your Profile. Paste your repo ID (for example your-username/my-bot) in the model repo field for your game and save it. Leave the data repo empty.
  5. Wait about a minute for the check, then play The platform checks your code in a sandbox. A sandbox is a locked box on the platform's servers where your bot runs. When the check passes, go to the Lobby and play, or watch your bot play ShiRi, the platform's own AI opponent. If it fails, the Gladiator tab shows why: see Model check failed.
How to create a repo Generic guide

Screens on Hugging Face change from time to time. If a name below is different on your screen, look for the closest match.

  1. Sign in at huggingface.co.
  2. Click your profile picture, then choose New Model.
  3. Type a name. Do not use -- in it. Check that you are the owner and that the visibility is Public. Click the button that creates the repo.
  4. Your repo ID is your username, a slash and the name, for example your-username/my-bot.
How to add a file (and what a commit is) Generic guide
  1. Open your repo and click the Files tab (it may be called Files and versions).
  2. Click Add file, then choose to create a new file.
  3. Type the file name, for example NAME_OF_ALGO_FILE.py. Paste the code as the content. Do the same for config_model.json.
  4. Commit the file to the main branch. A commit saves your change in the repo. On Hugging Face it is the button at the bottom of the page. The main branch is the default version of your repo.

Next: Starter code or Build your bot with an AI assistant

Starter code (Chess)

This is a complete bot for Chess. It plays random legal moves, so it is not strong. It is a good first test to see that your setup works. You can improve it later.

NAME_OF_ALGO_FILE.py is a name you choose, for example my_bot.py. It must end in .py and have no spaces. Use the same name everywhere.

You tell the platform which file to run by writing its name in config_model.json under "entrypoint". See Config files. For Breakthrough, use the AI prompt, or see the Breakthrough starter under Move format in Step 3.

Starter code: a working bot that plays random legal moves. Save it as NAME_OF_ALGO_FILE.py
# NAME_OF_ALGO_FILE.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()

Build your bot with an AI assistant

You do not have to write the code yourself. These prompts work with any AI assistant.

  1. Choose a file name that ends in .py, for example my_bot.py. In each prompt, replace [YOUR FILE NAME] with that name before you send it. In the Fix it prompt, also replace each [PASTE HERE].
  2. Click Copy on the prompt for your game.
  3. Paste it into the AI assistant and send it.
  4. Save the code the assistant gives you in your repo with the file name you chose. Save the config_model.json file it gives you too.
  5. If the check fails, copy the message from the Gladiator tab and use the Fix it prompt.
Chess prompt
I am a complete beginner. Please write a Chess bot for the Artificial Gladiator League (AGL) website.

FILE NAME
The file name is [YOUR FILE NAME] (for example my_bot.py). Return ONE complete file with exactly that name. Do not use any other file name.

THE CONTRACT
The file must define these two functions:
1. load(ctx) runs ONCE, when the bot starts. It returns "state". State can be any Python object, for example a dict.
   ctx.model_dir and ctx.data_dir are read-only folders (pathlib.Path). ctx.data_dir can be None.
2. get_move(state, fen, player) is called on EVERY move.
   - state is what load returned.
   - fen is the board position, written as FEN text.
   - player is "w" or "b". It is the side to move.
   - Return the move as a plain string. Never return a list, a dict or JSON.

MOVE FORMAT
Use UCI notation, for example e2e4. For a promotion add the piece letter, for example e7e8q. Do NOT use SAN such as Nf3.

LIMITS OF THE PLATFORM
The bot runs in a locked box (a sandbox) with these limits:
- No network. Do not use requests or urllib.
- Only these libraries exist: python-chess (import chess), numpy and torch (CPU only). Do not use any other third-party library.
- Files are read-only, except the folder /tmp.
- 512 MB of memory and 1 CPU.
- One move may take at most 30 seconds. Keep your search time under about 5 seconds per move.

RULES FOR THE CODE
- Load files and weights inside load(). Never load files inside get_move.
- Always return a legal move. If there are no legal moves, return "" (an empty string).
- Start with the simplest working version: pick a random legal move, and prefer captures when there are any.
- Add short comments that a beginner can read.

WHAT TO RETURN
1. The complete file [YOUR FILE NAME] in one block.
2. A small file named config_model.json with the fields "entrypoint" and "files". The value of "entrypoint" is [YOUR FILE NAME]. The value of "files" is a list that contains [YOUR FILE NAME].
3. Three plain sentences that explain how I can improve the bot later.

Breakthrough rules in short. The position is a FEN-like string (text that describes the board) with rank 8 first. A rank is a row of the board. W is a white piece, B is a black piece, and digits are empty squares. A piece moves one square forward: straight onto an empty square, or diagonally onto an empty square or an enemy piece. White moves toward rank 8, black toward rank 1, and a player who reaches the last rank wins.

Breakthrough prompt
I am a complete beginner. Please write a Breakthrough bot for the Artificial Gladiator League (AGL) website.

FILE NAME
The file name is [YOUR FILE NAME] (for example my_bot.py). Return ONE complete file with exactly that name. Do not use any other file name.

THE GAME
Breakthrough is played on an 8 by 8 board. Files are a to h, from left to right. Ranks are 1 to 8.
The position is a FEN-like string. Rank 8 comes first. W is a white piece, B is a black piece, digits are empty squares, and the side to move is at the end.
The start position is: BBBBBBBB/BBBBBBBB/8/8/8/8/WWWWWWWW/WWWWWWWW w
White moves toward rank 8. Black moves toward rank 1.
A piece moves one square forward. It can go straight, only onto an empty square. It can go diagonally, onto an empty square or onto an enemy piece.
A player wins by reaching the last rank.

THE CONTRACT
The file must define these two functions:
1. load(ctx) runs ONCE, when the bot starts. It returns "state". State can be any Python object, for example a dict.
   ctx.model_dir and ctx.data_dir are read-only folders (pathlib.Path). ctx.data_dir can be None.
2. get_move(state, fen, player) is called on EVERY move.
   - state is what load returned.
   - fen is the position, written as the FEN-like string described above.
   - player is "w" or "b". It is the side to move.
   - Return the move as a plain string. Never return a list, a dict or JSON.

MOVE FORMAT
Exactly 4 characters: the square you move from, then the square you move to. Examples: a2a3 and b2c3.

LIMITS OF THE PLATFORM
The bot runs in a locked box (a sandbox) with these limits:
- No network. Do not use requests or urllib.
- Only these libraries exist: python-chess, numpy and torch (CPU only). Do not use any other third-party library.
- Files are read-only, except the folder /tmp.
- 512 MB of memory and 1 CPU.
- One move may take at most 30 seconds. Keep your search time under about 5 seconds per move.

RULES FOR THE CODE
- Load files and weights inside load(). Never load files inside get_move.
- Always return a legal move. If there are no legal moves, return "" (an empty string).
- Start with the simplest working version: write a real legal-move generator for the rules above, and pick a random legal move. Use only the Python standard library for this first version.
- Add short comments that a beginner can read.

WHAT TO RETURN
1. The complete file [YOUR FILE NAME] in one block.
2. A small file named config_model.json with the fields "entrypoint" and "files". The value of "entrypoint" is [YOUR FILE NAME]. The value of "files" is a list that contains [YOUR FILE NAME].
3. Three plain sentences that explain how I can improve the bot later.
Fix it prompt
I am a complete beginner. My bot for the Artificial Gladiator League (AGL) website does not work. Please fix it.

GAME: [PASTE HERE: Chess or Breakthrough]
FILE NAME: [YOUR FILE NAME] (for example my_bot.py)

THE ERROR MESSAGE (from the Gladiator tab or the Diagnostics tab):
[PASTE HERE]

MY CURRENT CODE:
[PASTE HERE]

WHAT I WANT YOU TO DO
1. First, explain the cause of the problem in plain language. Use short sentences and no jargon.
2. Then return the FULL fixed file with the name [YOUR FILE NAME]. Do not return only the lines that changed.
3. If config_model.json must change too, return the full fixed config_model.json. Its "entrypoint" must be [YOUR FILE NAME] and its "files" list must contain [YOUR FILE NAME].
4. End with one short sentence that tells me what to do next.

THE RULES THE FIXED CODE MUST FOLLOW
- The file defines load(ctx) and get_move(state, fen, player). load(ctx) runs ONCE and returns "state". get_move is called on EVERY move. player is "w" or "b". get_move returns a plain string. Never a list, a dict or JSON.
- Chess moves use UCI notation, for example e2e4, or e7e8q for a promotion. Not SAN such as Nf3.
- Breakthrough moves are exactly 4 characters: the square you move from, then the square you move to, for example a2a3 or b2c3.
- Breakthrough rules: the position is a FEN-like string with rank 8 first, W for white pieces, B for black pieces, digits for empty squares and the side to move at the end. The start position is BBBBBBBB/BBBBBBBB/8/8/8/8/WWWWWWWW/WWWWWWWW w. White moves toward rank 8, black toward rank 1. A piece moves one square forward: straight onto an empty square, or diagonally onto an empty square or an enemy piece. A player wins by reaching the last rank.
- Limits: no network (do not use requests or urllib). Only python-chess, numpy and torch (CPU only) exist. Files are read-only, except the folder /tmp. 512 MB of memory, 1 CPU. One move may take at most 30 seconds, so keep the search under about 5 seconds.
- Load files and weights inside load(). Never load files inside get_move.
- Always return a legal move. If there are no legal moves, return "" (an empty string).
- Keep short comments that a beginner can read.

Want ratings and tournaments? Create a full account

A full account gives you rated games, an Elo rating (a number for your bot's strength) and tournaments. It needs more setup than a guest account: a Gated model repo (only accounts you approve can read it) and a verification file. For tournaments you also need 30 rated games first.

Read these rules first: Repo access, Tournament qualification (30 rated games) and Version pinning.

Words you will meet
  • Repo: a folder of files stored on Hugging Face.
  • Commit: a saved change in a repo.
  • Gated: a repo that only accounts you approve can read.
  • SHA: the unique ID of a commit.
  • Sandbox: the locked box on the platform's servers where your bot runs.
  • FEN: a line of text that describes a board position.
  • UCI: the way Chess moves are written, for example e2e4.
  • Entry-point file: the Python file the platform runs to start your bot.

The 7 steps at a glance

This is the shortest path from nothing to a working, registered AG Champion with a full account. The steps below use the same numbers and the same order. Do them one after the other.

  1. Create your accountFill in the registration form and activate your account by email.
  2. Create your Hugging Face reposStart from the working example, make your model repo Gated, and approve ArtificialGladiatorLeague.
  3. Write your AG ChampionEdit the example code. Add config_model.json with "entrypoint" set to your file name.
  4. Register your reposOpen the Gladiator tab on your Profile, enter your model repo, and click the gold button Save and verify.
  5. Prove you own your reposAdd AGL_VERIFY.txt with the code shown on the Gladiator tab, then click Verify Ownership.
  6. Run DiagnosticsOpen the Diagnostics tab and click Run diagnostics. Fix what it reports and run it again until it says RESULT: your model works correctly.
  7. Play and competePlay rated games in the Lobby and enter tournaments. The Lobby is labelled "Hatzar Grutaot" in the menu. This is Hebrew (חצר גרוטאות) and means "Scrapyard". The name was coined by Malka Haas.

Next step: Step 1: Create your account

Step 1: Create your account

Important

Your country of residence, username and AG name are locked once chosen. Check them before you click Create Account. Details: Your account.

What to do
  1. Enter a Username, a Password (more than 8 characters), the same password again in Confirm Password, and your Email.
  2. Enter your AG (Artificial Gladiator) Name. This is the display name of your AG Champion.
  3. Choose your Country of residence. Tick the confirmation boxes and the box that accepts the Terms of Service and Privacy Policy.
  4. Click Create Account.
Where
The registration page.
How you know it worked
A Check your email page appears. Click the activation link in the email to activate your account.
If it fails
The email does not arrive: The activation email did not arrive.

Next step: Step 2: Create your Hugging Face repos

Step 2: Create your Hugging Face repos

A repo is a folder of files stored on Hugging Face. You need a model repo, and optionally a data repo. What each one holds is explained in Your two repos.
Guest accounts use Public repos instead; the Gated requirements below apply to registered accounts.

Important

The model repo must be Gated (only accounts you approve can read it), and you must approve the platform's Hugging Face account ArtificialGladiatorLeague in the repo's Access settings. Without both, saving your repo fails. Why: Repo access.

Important

The data repo must be Public (anyone can read it). A private or gated data repo is rejected when you save it. Why: Repo access.

What to do
  1. Create your model repo. The easiest way is to start from the starter code: see Start from a working example below.
  2. Make the model repo Gated: open the repo's Settings and enable Access Requests.
  3. Approve ArtificialGladiatorLeague in the repo's Access settings. Do this before Step 4, because saving your repo fails until you have approved it. The yellow button Open Access Settings on the Gladiator tab opens that page as soon as you have typed your repo ID there.
  4. Optional: if your AG Champion reads data files, create a data repo and make it Public.
Where
On Hugging Face, in your own account: the repo's Settings page.
How you know it worked
Your model repo exists in your Hugging Face account and is set to Gated. The platform checks this when you save the repo in Step 4.
If it fails
My repo is rejected

If you get stuck

  1. Check that the model repo is in your own Hugging Face account.
  2. Open the repo's Settings and check that Access Requests is on.
  3. Open the repo's Access settings and check that ArtificialGladiatorLeague is approved.
  4. Check that you typed the repo as username/repo-name. A Space URL is rejected.
  5. Still rejected? Read the message on the Gladiator tab, then open My repo is rejected.
Screenshot to be added: the repo Settings page with Access Requests turned on and ArtificialGladiatorLeague approved.
How to do this on Hugging Face Generic guide

Screens on Hugging Face change from time to time. If a name below is different on your screen, look for the closest match.

Create a repo

  1. Sign in at huggingface.co.
  2. Click your profile picture, then choose New Model. For a data repo, choose New Dataset instead.
  3. Type a name and check that you are the owner. Keep the visibility on Public: Access Requests (below) is what makes a repo Gated. Click the button that creates the repo.

Turn on Access Requests

  1. Open your repo and click its Settings tab.
  2. Find the section about gated access and turn on Access Requests.

Approve a user

  1. In the repo's Settings, open the access requests list (the Access settings).
  2. Find ArtificialGladiatorLeague among the requests and accept it. If it is not listed, use the option to grant access to a user by name.

Start from a working example

Tip

The easiest start is the starter code. It is a complete bot that plays random legal moves.

  1. Create a new model repo in your own Hugging Face account (see How to do this on Hugging Face above).
  2. In the repo, click Add file and create a new file named NAME_OF_ALGO_FILE.py (a name you choose, for example my_bot.py).
  3. Paste the starter code into it and commit. A commit saves your change in the repo.
  4. Add a second file named config_model.json that gives your file name under "entrypoint" (see Config files).
  5. Make your repo Gated (Settings, Access Requests).

You edit the code in Step 3. To read more example code, you can open the repos at https://huggingface.co/chaim-duchovny.

Suggested file layout if you create the repos yourself Optional

Model repo (a Hugging Face Model repo, required)

It contains your AG Champion code and config_model.json (see Config files). Put the files on the main branch.

your-username/my-bot/
    |-- config_model.json    (names your code file under "entrypoint")
    |-- NAME_OF_ALGO_FILE.py (your AI code: load / get_move)
    |-- utils.py             (optional helper modules)
    |-- requirements.txt     (optional, for your own reference; not installed by the platform)
    `-- AGL_VERIFY.txt       (added in Step 5)

Data repo (a Hugging Face Dataset repo, optional)

You need it if your AG Champion uses runtime data files such as opening books, precomputed tables or trained weights. The platform copies it next to your AG Champion and your code reads it from ctx.data_dir.

your-username/my-bot-data/
    |-- config_data.json     (optional, see Config files)
    |-- opening_book.txt     (any data files your load() reads)
    `-- AGL_VERIFY.txt       (added in Step 5)

Next step: Step 3: Write your AG Champion

Step 3: Write your AG Champion

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. You can also build it with an AI assistant. The platform downloads your code and runs it in a sandbox (a locked box on its own servers), so you need no external hosting or always-on server.

Tip

Any algorithm is welcome. Monte Carlo Vector Search (MCVS), Minimax, alpha-beta pruning, MCTS, policy networks, value networks, reinforcement learning, opening books, endgame tablebases, hybrid approaches: if it returns a legal move string within the time limit, it qualifies.

Note

Your code runs with no network, read-only files, a fixed set of libraries and a move time limit. Check Sandbox limits before you write code. For example, calls such as requests or urllib fail.

What to do
  1. In your model repo, edit the entry-point file so that it defines load(ctx) and get_move(state, fen, player) (see below). Choose a file name, written here as NAME_OF_ALGO_FILE.py. It is a name you choose, for example my_bot.py. It must end in .py and have no spaces. Use the same name everywhere.
  2. Add config_model.json and write your file name in it under "entrypoint". See Config files in the Advanced section.
  3. 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.
Where
In your model repo on Hugging Face, on the main branch.
How you know it worked
Steps 5 and 6 show the result. The platform runs the model check on your code when you verify ownership, and Diagnostics repeats it.
If it fails
Model check failed, Invalid move returned, Data files not loading

The contract: load(ctx) and get_move(state, fen, player)

Your entry-point file must define both functions. There is no other interface. A working Chess example is in the starter code.

  • state = load(ctx) is called once when your AG Champion is loaded. Open your weights, opening books and other files here and return whatever you want to keep. It is passed back to you as state.
  • ctx.model_dir and ctx.data_dir are real, read-only folders (pathlib.Path) that hold your model repo files and your data repo files. ctx.data_dir is None when no data files are available. The platform never opens your data files for you. Read them yourself inside load().
  • move = get_move(state, fen, player) is called for every move. fen is the position, written as FEN text. player is "w" or "b" (the side to move). Return the move as a plain string.

You tell the platform which file to run by writing its name in config_model.json under "entrypoint". See Config files.

Move format

What your get_move must return
GameFormatExamples
Chess UCI notation. Not SAN such as Nf3. e2e4, or e7e8q for a promotion
Breakthrough Exactly four characters: the square you move from followed by the square you move to. a2a3, b2c3
Breakthrough: position format, movement rules and starter code Reference

The position is a FEN-like string with rank 8 first (a rank is a row of the board), W for white pieces, B for black pieces, digits for empty squares and the side to move at the end. The start position is BBBBBBBB/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. A player who reaches the last rank wins.

Breakthrough starter: a working bot that plays random legal moves. Save it as NAME_OF_ALGO_FILE.py
# NAME_OF_ALGO_FILE.py
# Breakthrough starter bot. It plays a random legal move.
import random

FILES = "abcdefgh"  # file a is the left column, file h is the right column


def parse_board(fen):
    # Turn the position text into a dict: {(file_number, rank): piece}.
    # file_number is 0 for a, 1 for b, ... 7 for h. rank is 1 to 8.
    board = {}
    rows = fen.split()[0].split("/")  # the first row of the text is rank 8
    for row_index, row in enumerate(rows):
        rank = 8 - row_index
        file_number = 0
        for ch in row:
            if ch.isdigit():
                file_number += int(ch)  # a digit means that many empty squares
            else:
                board[(file_number, rank)] = ch  # "W" or "B"
                file_number += 1
    return board


def legal_moves(board, player):
    me = "W" if player == "w" else "B"
    step = 1 if me == "W" else -1  # white moves up (toward rank 8), black moves down
    moves = []
    for (f, r), piece in board.items():
        if piece != me:
            continue
        nr = r + step  # the rank one square forward
        if nr < 1 or nr > 8:
            continue
        # Straight forward: only onto an empty square.
        if (f, nr) not in board:
            moves.append(FILES[f] + str(r) + FILES[f] + str(nr))
        # Diagonally forward: onto an empty square or an enemy piece.
        for nf in (f - 1, f + 1):
            if 0 <= nf <= 7 and board.get((nf, nr)) != me:
                moves.append(FILES[f] + str(r) + FILES[nf] + str(nr))
    return moves


def load(ctx):
    return {}  # nothing to load in this simple bot


def get_move(state, fen, player):
    # Return "from-square" + "to-square", for example "a2a3".
    moves = legal_moves(parse_board(fen), player)
    if not moves:
        return ""
    return random.choice(moves)  # replace this with your real model

This starter plays random legal moves, so it is a test, not a strong bot.

Tip

There is no web server, Space or hosted endpoint to run. Your model repo stays Gated, and the platform only needs the read access you approve.

Next step: Step 4: Register your repos

Step 4: Register your repos

On the Gladiator tab, each game (Chess, Breakthrough) has its own card with numbered steps (Enter repo, Approve platform account, Add AGL_VERIFY.txt, Verify). A line at the top of the tab tells you the next step.

Note

If you change your model repo ID later, your rated-games counter resets. See Tournament qualification.

What to do
  1. In Hugging Face Model Repo, type or paste your model repo as username/my-AG. You may paste a full huggingface.co link: it is converted to username/my-AG. A Space URL (*.hf.space or huggingface.co/spaces/...) is rejected.
  2. In Hugging Face Data Repo, enter username/my-AG-data. Leave it blank if you do not use a data repo. For Chess, the field is filled in for you with owner/chess-data as soon as you type your model repo. If you do not have that repo, delete the text. Otherwise saving fails because the repo is not found.
  3. Click the gold button Save and verify.
Where
The Gladiator tab on your Profile, in the card for your game.
How you know it worked
The platform shows a unique 32-character verification code on the Gladiator tab, with the buttons Copy file name and Copy code. You need this code in Step 5. If you clicked Save and verify, a red message that AGL_VERIFY.txt was not found in your repo also appears. That is expected at this point, because you add the file in Step 5.
If it fails
My repo is rejected
What the buttons on the Gladiator tab do Reference
Buttons on the Gladiator tab
ButtonWhat it does
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 CodeSaves the repo and issues a verification code (unless the repo is unchanged and already verified).
Verify Ownership / Re-check OwnershipChecks AGL_VERIFY.txt and runs the model check.

Next step: Step 5: Prove you own your repos

Step 5: Prove you own your repos

Before your AG Champion can play, you must prove that you own the repos. You do this with a small file that contains the verification code the platform gave you in Step 4.

Important

Put AGL_VERIFY.txt at the root of the repo on the main branch, not inside a subfolder.

Important

If you have pushed a new commit to your model repo since your AG Champion was approved, clicking Re-check Ownership approves the new commit and your rated-games count goes back to 0. If nothing has changed, clicking it again is safe. See Tournament qualification.

What to do
  1. On Hugging Face, create a file named AGL_VERIFY.txt at the root of your model repo (main branch). It must contain exactly the verification code. Surrounding whitespace or a trailing newline is ignored.
  2. If you also set a data repo, add the same file with the same code to the root of the data repo.
  3. On the Gladiator tab, click Verify Ownership. It is shown as Re-check Ownership once you are verified.
Where
The file goes into your repo on Hugging Face. The buttons Copy file name and Copy code on the Gladiator tab give you the file name and the code. The Verify Ownership button is on the same tab.
How you know it worked

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. If it passes, the platform pins the commit as your approved version. To pin means to record its SHA, the unique ID of that commit.

If it fails
Ownership verification failed, Model check failed
How to add a file on Hugging Face Generic guide
  1. Open your repo and click the Files tab (it may be called Files and versions).
  2. Click Add file, then choose to create a new file.
  3. Type AGL_VERIFY.txt as the file name and paste the verification code as the content.
  4. Commit the file to the main branch.

Next step: Step 6: Run Diagnostics

Step 6: Run Diagnostics

The Diagnostics tab on your Profile checks a registered AG Champion from start to finish and tells you in plain language what to fix. It can take a few minutes, because the last check runs your AG Champion in the sandbox.

Tip

Diagnostics is read-only. It never changes your AG Champion, your repos or your verification state, so you can run it as often as you like.

What to do
  1. Open the Diagnostics tab.
  2. Pick the game.
  3. Click Run diagnostics.
  4. Read the report and fix what it reports. Run it again.
Where
The Diagnostics tab on your Profile.
How you know it worked
The report ends with RESULT: your model works correctly.
If it fails
Diagnostics says the model or data files are not on the server yet, Diagnostics says the sandbox is unavailable, Model check failed
The 7 checks Diagnostics runs Reference
  1. Registration: a model repo is registered for this game.
  2. Model repo access: the repo exists, is Gated, and the platform account has access.
  3. Ownership proof: the model repo (and the data repo, if set) are ownership-verified.
  4. Repository files: the files listed in config_model.json and config_data.json are present.
  5. Version and integrity: approved and current SHAs, the repo-change cooldown and your rated-games count (shown as Rated games since last revalidation: x / 30).
  6. Stored contract result: whether the model check last stored active, pending or failed.
  7. Live contract test: runs your load() and get_move() in the sandbox on three sample positions and checks that every move is legal.

Next step: Step 7: Play and compete

Step 7: Play and compete

Warning

After you join a tournament, do not push any change to your AG Champion repo. A new commit disqualifies you automatically. A commit is a saved change, and every commit has its own SHA (a unique ID). Details: Version pinning.

What to do
  • Quick match: go to the Lobby and challenge another player. Your AG Champion plays automatically in real time.
  • Practice against ShiRi: let your AG Champion play the platform's AI opponent, with no rating risk. See Try your AG Champion against ShiRi.
  • Tournament: first play 30 rated games in the Lobby. Then open a tournament and click Register or Join. When the tournament asks players to ready up, mark yourself Ready. The platform schedules and runs all matches automatically. The qualification rule is explained in Tournament qualification.
Where
The Lobby for quick matches. The Lobby is labelled "Hatzar Grutaot" in the menu. This is Hebrew (חצר גרוטאות) and means "Scrapyard". The name was coined by Malka Haas. Use the tournaments page for tournaments. For how tournaments run, see How tournaments work.
How you know it worked
Your AG Champion plays its moves on its own. Results of rated games update your Elo. For how each move is generated, see During a game.
If it fails
I cannot join a tournament, Move timed out, or random moves are played for my AG Champion, Disqualified: SHA mismatch

Try your AG Champion against ShiRi

ShiRi is an AI opponent built into the platform. It is the fastest way to see your AG Champion play: you do not need another player, and nothing is rated. Your AG Champion plays ShiRi and you only watch. You do not move any pieces. More about ShiRi: Playing against ShiRi.

What to do
  1. Open Playing against ShiRi in the "Hatzar Grutaot" menu, or click Play against ShiRi on the home page.
  2. Choose the game (Chess or Breakthrough), the colour ShiRi plays (White, Black or Random), the time control (minutes per side and increment, as in Create Lobby Game), and the time per move for your AI and for ShiRi (3, 5, 8, 12 or 15 seconds each).
  3. Click Start Game. Click Stop to end the game early.
Before you start
You need your own AG Champion for the game you choose, with its repo saved on your Profile and its model check passed. As a guest, wait until the Gladiator tab says your model is ready. Until then the page shows "Preparing your model..." and the game does not start. Full accounts must also have proved ownership.
Where
Playing against ShiRi. You must be logged in.
How you know it worked
The board shows your AG Champion's name on one side and ShiRi on the other, and the moves appear one after another. When the game ends, the page shows the result and the reason. The game is not saved and does not change your Elo.
If it fails
  • "You don't have a ... model of your own yet": register your repo first (see Step 4 or the guest quick start).
  • Your AG Champion forfeits: in a ShiRi game no random move is played for you. If your code returns no move, an illegal move, or is too slow, it forfeits, and the page tells you which. Fix it using Move timed out and Model check failed.
  • Your AG Champion loses on time: each side has a clock (the minutes per side you chose, plus the increment after every move), and only one clock runs at a time. Yours runs from the moment ShiRi moves until your AG Champion moves, including the wait that the "your AI thinking" setting adds. Choose more minutes, or a shorter AI thinking time, if your clock runs low.
  • "Cancelled because of a platform problem": this is not your fault. No result is recorded. Try again later.

Next: Advanced

Advanced

Tip

Every bot needs a config_model.json file with "entrypoint". It tells the platform which file to run. The other fields in it, and config_data.json, are optional. A beginner only needs the short example below.

Config files

Two small JSON files describe your repos: config_model.json for your model repo, and config_data.json for your data repo if you use one. You tell the platform which file to run by writing its name in config_model.json under "entrypoint". NAME_OF_ALGO_FILE.py in the example below stands for the file name you chose: replace it with your own name, and use the same name everywhere. The Repo File Status panel on the Gladiator tab and the Diagnostics tab also read files from config_model.json (model repo) and, if you use a data repo, from config_data.json (data repo). They report a problem when a file cannot be read or lists no files.

Important

Each file must be valid JSON: no comments and no trailing commas. A listed entrypoint or modules file that does not exist is reported as a problem.

config_model.json (root of the model repo)

config_model.json
{
  "schema_version": 1,
  "entrypoint": "NAME_OF_ALGO_FILE.py",
  "data_files": ["opening_book.txt"],
  "requirements": ["numpy", "python-chess"],
  "files": ["NAME_OF_ALGO_FILE.py"]
}
Fields of config_model.json
FieldTypeNeeded?What it does
schema_versionintegerOptionalManifest format version. Use 1.
entrypointstringRequiredThe name of the .py file the platform runs, for example NAME_OF_ALGO_FILE.py. This is how you tell the platform which file to run.
moduleslist of stringsOptionalAn older alternative to entrypoint. Every listed file is imported and the last one wins.
data_fileslist of stringsOptionalFiles your AG Champion expects to find in your data repo. The model check fails if one of them is missing.
requirementslist of stringsOptionalInformational only. Nothing is installed.
fileslist of stringsRecommendedThe files that must exist in the model repo. Used by the Repo File Status panel and by Diagnostics, which report a problem if the list is missing or empty. The sandbox does not use it.

config_data.json (root of the data repo, only if you use one)

config_data.json
{
  "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, which report a problem if the file is missing or lists no files. Keep it consistent with data_files in config_model.json.

Optional: test on your own computer Advanced

You do not need this. The platform's model check and Diagnostics test your bot for you. Use this only if you want to try your code before you upload it.

  1. Install Python from python.org.
  2. Open a terminal (a window where you type commands) and run pip install python-chess numpy.
  3. Put your file NAME_OF_ALGO_FILE.py in a folder. In the same folder, create a file named test_bot.py with the code below.
  4. In the import line, write your file name without .py. For example, write my_bot for my_bot.py.
  5. In the terminal, go to that folder and run python test_bot.py. It prints one move.
test_bot.py
# test_bot.py - put it in the same folder as NAME_OF_ALGO_FILE.py
        from pathlib import Path
        from types import SimpleNamespace

        import NAME_OF_ALGO_FILE as bot  # your file name, without .py

        # A simple stand-in for what the platform gives to load().
        ctx = SimpleNamespace(model_dir=Path("."), data_dir=None)
        state = bot.load(ctx)

        # Chess sample position (the start position).
        # For Breakthrough use: "BBBBBBBB/BBBBBBBB/8/8/8/8/WWWWWWWW/WWWWWWWW w"
        fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
        print(bot.get_move(state, fen, "w"))

Best practices

  • Load everything in load(). 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.
  • Stay well under the move time limit. Budget your search depth or inference time below the limit in Sandbox limits. If your AG Champion is too slow, random moves are played for it (see When a move fails).
  • Keep it lightweight. Keep your dependencies minimal and avoid anything that expects internet connectivity. If you like, note the versions you tested with in your repo's requirements.txt for your own reference.
  • Return a plain string in the right format. Always return a legal move as a plain string, in the format shown under Move format. Anything else is treated as no move.
  • Test before tournaments. Run Diagnostics, then play several quick matches in the Lobby to confirm your AG Champion responds correctly at game speed before you enter a tournament. The 30-game qualification window is the ideal calibration period.

Troubleshooting

Find the symptom, open it, and follow the fix. The steps above link here when something goes wrong.

The activation email did not arrive
  • Check your spam or junk folder. The email comes from agladiator.com.
  • Wait a few minutes. Delivery can take up to 10 minutes.
  • Still nothing? Contact support.
  • Your username is reserved while you wait, so you do not need to register again.
My repo is rejected (Repo ID rejected)
  • Enter the repo as username/repo-name. A huggingface.co model or dataset link is converted automatically. A Space URL is rejected.
  • Guests: your repo must be Public and under your own Hugging Face username. A repo ID that contains -- is rejected. Size and file-count limits apply.
  • For a full account, a public model repo is rejected: set it to Gated first. The data repo is the opposite: it must be Public. See Repo access.
Model check failed
  • The Gladiator tab shows the reason. Typical causes: a syntax error, a missing load(ctx), an "entrypoint" in config_model.json that does not match your file name, invalid config_model.json, a file listed in data_files that 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.
  • You tell the platform which file to run by writing its name in config_model.json under "entrypoint". Check that the name is spelled exactly like your file.
  • Not sure how to fix it? Use the Fix it prompt with an AI assistant.
Invalid move returned
  • Confirm that your move string matches the expected format for the game. See Move format: UCI for Chess (for example e2e4) or four characters, from-square then to-square, for Breakthrough (for example a2a3).
  • Make sure you return a plain string: not a list, not a JSON object, not {"move": "..."}.
Data files not loading
  • Confirm that your data repo is Public on Hugging Face.
  • Check that the filenames in config_data.json and in data_files of config_model.json match exactly (case-sensitive) the filenames in your repo, and that your load() reads them from ctx.data_dir.
Ownership verification failed
  • Make sure AGL_VERIFY.txt is at the root of your model repo on the main branch, not inside a subfolder.
  • If you set a data repo, it needs its own AGL_VERIFY.txt with 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. See Repo access.
Diagnostics says the model or data files are not on the server yet
  • Log out and log in again, then run Diagnostics again. Logging in lands you on the Lobby, which loads your AG Champion 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.
Diagnostics says the sandbox is unavailable
  • This is a platform issue, not a problem with your AG Champion. Try again later.
I cannot join a tournament
  • The tournament page shows how many qualifying games you still need (for example "N games to go"). Play more rated games in the Lobby. Games played inside tournaments do not count, and neither do guest games.
  • If you see "Integrity check failed: your Hugging Face repository changed since it was approved", a new commit was found in your repo. Click Re-check Ownership on the Gladiator tab, then play your qualifying games again. See Version pinning.
  • If the page asks you to verify ownership, finish Step 5 first.
Move timed out, or random moves are played for my AG Champion
  • A move that takes longer than the server's move timeout (30 seconds) 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().
  • If 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 AG Champion's last model check failed, no random move is played and you forfeit the game. Fix the problem and click Verify Ownership again.
  • The full behaviour is described in When a move fails. If the platform's sandbox itself is unavailable, the game is cancelled instead and nobody loses: see When the sandbox is unavailable.
Disqualified: SHA mismatch
  • You pushed a commit to your AG Champion repo after registering for the tournament. See Version pinning.
  • Even trivial changes (README edits, whitespace) produce a new SHA. Freeze the repo once registered.

Frequently asked questions

Can I use PyTorch or other libraries?

Only the libraries the sandbox image contains. They are listed under Sandbox limits. The sandbox has no network access, so packages cannot be installed at match time. Testing on your own computer is optional and for advanced users. Beginners can skip it and use the platform's model check and Diagnostics instead. If you do test locally, use the same libraries: see Optional: test on your own computer.

Do I need a Hugging Face account?

Yes, to create your model repo (and the optional data repo). The platform does not ask you for an API token. See Repo access.

Which of my repos must be Gated, and which must be Public?

See the table in Your two repos. The consequences are explained in Repo access.

Can I update my AG Champion between games (outside tournaments)?

Yes, you can update your AG Champion or change your repo links outside of tournaments. Changing your model repo ID resets your rated-games counter, and so does a new commit in your repo. See Tournament qualification and Version pinning.

Can I play against ShiRi myself?

No. In a ShiRi game your AG Champion plays and you only watch. Does it change my Elo? No: ShiRi games are unrated and are not saved. See Try your AG Champion against ShiRi.

More answers about games, time limits and thinking time are in the FAQ on How it works.