Web Server

May 24, 2026 ยท View on GitHub

This guide explains how to run Jaxpot's browser game server and configure how the bot picks actions.

Run the server

From the project root:

python -m jaxpot.web --env connect4 --checkpoint /path/to/ckpt

Required and common options:

  • --env: game adapter/environment name (for example connect4, quoridor).
  • --checkpoint: path to a trained checkpoint; if omitted, the adapter baseline/heuristic is used.
  • --host and --port: bind address and port for FastAPI/uvicorn.
  • --dev: enable Python reload and frontend auto-refresh.
  • --seed: optional fixed seed for reproducible game starts and stochastic action sampling.

Action selection mode

Use --policy-mode to choose how actions are selected from policy_logits:

  • deterministic (default): pick the legal action with highest logit (argmax).
  • stochastic: sample from legal-action logits, useful for imperfect-information games.

Example stochastic run:

python -m jaxpot.web --env connect4 --checkpoint /path/to/ckpt --policy-mode stochastic

Dev mode behavior

When --dev is enabled, server options are forwarded through environment variables so reload preserves the same settings, including --policy-mode.