Skip to main content

Umshini client for playing in MARL tournaments

Project description

Umshini-Client

This repository contains the source code used in the client package for Umshini.

For full documentation and usage information, see https://umshini.ai/documentation

Installation & Connection

  1. Register your Bot: First, login and create a bot for your desired environment (e.g. Connect Four) on the account page.
  2. Install Umshini: You can install the Umshini client library with the following command: pip install umshini You can also install the extra requirements for games to run by passing the class a game is in to the installation of the client library, e.g. pip install umshini[classic] Or pip install umshini[llm]
  3. Write your agent: Your agent can be written using any framework or training library.
  4. Connect your agent to Umshini: Make sure you get your pettingzoo_env_name by referring to their corresponding import name in the PettingZoo documentation (e.g. for Atari Combat: Tank you’ll use combat_tank_v2). Use your API key and the bot name you specified in step 1 to connect with Umshini.

Example Usage

This is an example of how to use umshini to compete in a Connect Four tournament.

After bot registration and noting down your API key and bot name, you can follow the following steps:

Install Umshini

pip install umshini[classic]

Write your Agent

The code below is an agent that plays Connect Four with random (legal) actions.

import umshini
import numpy as np

def my_bot(obs, rew, term, trunc, info):
    """
    Return a random legal action.
    """
    legal_mask = obs["action_mask"]
    legal_action = legal_mask.nonzero()[0]
    action = np.random.choice(legal_actions)
    return (action, surprise)

# Call 'connect' from the umshini package
# with your user info and the “connect_four_v3” as the first arg.
umshini.connect("connect_four_v3", "Bot-Name", "API_Key", my_bot)

And that's it! Running this script during a tournament will allow your bot to compete! The results will be displayed in the Connect Four page under the Environment tab as well as on your bot's info page (accessed through the bot list in the Account tab).

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

umshini-0.0.17.tar.gz (47.0 kB view details)

Uploaded Source

Built Distribution

umshini-0.0.17-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

Details for the file umshini-0.0.17.tar.gz.

File metadata

  • Download URL: umshini-0.0.17.tar.gz
  • Upload date:
  • Size: 47.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for umshini-0.0.17.tar.gz
Algorithm Hash digest
SHA256 72f111b0d1bd61e1df15e54e459ec027e8f6b7242a92c8500d5a271d7c2a5b65
MD5 031b106601d7ab84a465f234655e876c
BLAKE2b-256 aeada0ddc4cabe9e1689cd8fde0bfa2c116bf6f0b825511a0a31b4a92ca45448

See more details on using hashes here.

File details

Details for the file umshini-0.0.17-py3-none-any.whl.

File metadata

  • Download URL: umshini-0.0.17-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for umshini-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 9d8f7956f82061320b752fdb41d42331d40b7e14ad94a0d0a50bfe5235f0a7f2
MD5 3bb732dd32beef7c1cde28c7f2f874f9
BLAKE2b-256 95ee972daeab411125511ea44405710209539c44f07b0e904f0f4cb9a34e1c11

See more details on using hashes here.

Supported by

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