Skip to main content

MiniRTS LLM Benchmark

Project description

MiniRTS LLM Benchmark

Deterministic 11x11 grid RTS benchmark for LLMs.
No OCR, no UI automation, fast and reproducible.
Strict 30 action cap.

Install

pip install mirts-bench

Run

polybench run --difficulty hard --opponents 7 --games 1

LLM command (stdin prompt → stdout JSON):

polybench run --difficulty hard --opponents 7 --games 1 --llm-cmd "python examples\\echo_llm.py"

OpenAI-compatible HTTP endpoint:

polybench run --difficulty hard --opponents 7 --games 1 --llm-host http://localhost:8000 --llm-model your-model --llm-api-key YOUR_KEY

Env alternative:

$env:POLYBENCH_LLM_HOST = "http://localhost:8000"
$env:POLYBENCH_LLM_MODEL = "your-model"
$env:POLYBENCH_LLM_API_KEY = "YOUR_KEY"
polybench run --difficulty hard --opponents 7 --games 1

Kaggle (local, no ngrok)

Run inside a Kaggle notebook with kaggle-benchmarks available.

!pip -q install kaggle-benchmarks mirts-bench

!polybench run --difficulty hard --opponents 7 --games 1 --llm-provider kaggle --llm-model google/gemini-2.5-flash

If --llm-model is omitted, the default Kaggle LLM is used.

Python API

import polybench

cfg = polybench.RunConfig(
    difficulty="easy",
    opponents=1,
    games=1,
    llm_host="http://localhost:8000",
    llm_model="your-model",
    llm_api_key="YOUR_KEY",
)
polybench.run_benchmark(cfg)

How it works

  • Generates a deterministic 11x11 grid with cities, resources, and blockers.
  • Builds a prompt from the current state.
  • LLM returns a JSON action.
  • The engine applies the action and advances the turn.
  • Stops after 30 actions and scores the result.

Action schema

Allowed action types:

  • end_turn
  • move
  • attack
  • train
  • build
  • research

Unit and city identifiers are grid coordinates:

{ "type": "move", "unit_id": { "x": 3, "y": 5 }, "to": { "x": 4, "y": 5 } }

Output

Each run writes:

  • runs/<timestamp>_<difficulty>_<opponents>/game_###/turn_###_prompt.txt
  • runs/<timestamp>_<difficulty>_<opponents>/game_###/turn_###_response.txt
  • runs/<timestamp>_<difficulty>_<opponents>/game_###/turn_###_action.json
  • runs/<timestamp>_<difficulty>_<opponents>/summary.json

Options

polybench run supports:

  • --difficulty easy | normal | hard | crazy
  • --opponents 1 | 7 | 15
  • --games (default 1)
  • --llm-cmd external command that reads prompt on stdin and returns JSON on stdout
  • --llm-provider openai | kaggle
  • --llm-host HTTP base URL (OpenAI-compatible /v1/chat/completions)
  • --llm-model model name for HTTP LLM
  • --llm-api-key API key for HTTP LLM (or set POLYBENCH_LLM_API_KEY)
  • --k-factor ELO K (default 32)
  • --opponent-elo (default 1000)
  • --start-elo (default 1000)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mirts_bench-0.4.0.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mirts_bench-0.4.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file mirts_bench-0.4.0.tar.gz.

File metadata

  • Download URL: mirts_bench-0.4.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mirts_bench-0.4.0.tar.gz
Algorithm Hash digest
SHA256 9729325759a9c19bd3797674471923b0c2c994c04ddaa83e021f46073015bce6
MD5 542a84701e1ebd4241f0ce22df7adbd1
BLAKE2b-256 e3e5f102d423084f9eead9ff86e4d2688dda207c6f12a49245c755e3926a951f

See more details on using hashes here.

File details

Details for the file mirts_bench-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mirts_bench-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mirts_bench-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b3e7b1b44016ccab2c855bbe81bf9158306828496a78fc5dabb247baa88fd1a2
MD5 372079fc69471f7e255fba9154c5b6bc
BLAKE2b-256 5134aec028cd9b245043c287e7d8a95309f616c013d389e3aeb09a3b74a54338

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page