Skip to main content

LLM Skirmish, an adversarial in-context learning benchmark

Project description

Skirmish

Python bindings for LLM Skirmish. Run matches between strategies and collect results.

Requirements

npm install -g @llmskirmish/skirmish
pip install skirmish

Usage

from skirmish import run_match, Winner, EndReason

# Run a match between two strategy scripts
result = run_match("example_1.js", "example_2.js")

print(f"Winner: {result.winner}")      # Winner.PLAYER1, PLAYER2, DRAW, or ERROR
print(f"Reason: {result.reason}")      # EndReason.ELIMINATION, TIMEOUT, or ERROR
print(f"Ticks: {result.ticks}")        # Number of game ticks
print(f"Scores: {result.scores}")      # Scores(player1=..., player2=...)

# Optional parameters
result = run_match(
    p1="example_1.js",
    p2="example_2.js",
    map_name="swamp",      # Map to play on (default: "swamp")
    max_ticks=2000,        # Max game length (default: 2000)
    timeout=120.0,         # Process timeout in seconds (default: 120)
)

# Error handling - errors return a result, not an exception
if result.winner == Winner.ERROR:
    print(f"Match failed: {result.error}")

License

MIT

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

skirmish-0.1.2.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

skirmish-0.1.2-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file skirmish-0.1.2.tar.gz.

File metadata

  • Download URL: skirmish-0.1.2.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for skirmish-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1dc469275f67c50e0a264d2e5017376377785947737ed7974182731e50c3b408
MD5 2c9b395ef176fbe704efa9e7421141c9
BLAKE2b-256 664d89702408d3dcebdee764e654a72a3d67ee2bdff6ce30afac20f275cb8a44

See more details on using hashes here.

File details

Details for the file skirmish-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: skirmish-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for skirmish-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 815084b6e84f04e48ed8e0f87a449862065d5e043d57a3c3e697190643dcd529
MD5 fe72b290ea3d6e59eddf39f54996367d
BLAKE2b-256 af0419e2ac82c419932c2ab21872cf539fa561cb6f6e03eea9394fd25f50ad42

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