Wildcard—best unexpected use | Sponsored by vLLM
bota
An autonomous Dota 2 agent powered by GPT-OSS-20B and vLLM
Core trick
A local vLLM-served GPT-OSS-20B reads protobuf game state from a socket and emits actions through the Dota Lua bot API, with no fine-tuning.
Tags
Built with
gpt-oss-20bluapythonvllm
Description
Inspiration
In 2019 we flew from London to San Francisco for the
OpenAI Five Finals
, the first competition between professional Dota 2 players and the AI that OpenAI trained on Dota 2. Inspired by OpenAI's work we built bota: an autonomous Dota 2 agent powered by GPT-OSS-20B and vLLM.
What it does
Our bota agent plays Dota 2 in 1v1, which is a mode typically used for players to develop their skills on new heroes and to practice combat scenarios. Our agent plays the game similarly to a human being and displays the model reasoning in the in-game chat. The agent can move the hero, attack, use items as well as abilities.
How we built it
Our agent is written in Python and interacts with Dota 2 via 2 mechanisms: a socket to receive the observed game state and the LUA bot API to execute actions. We use the vLLM inference engine to run GPT-OSS-20B locally. The model is used without fine-tuning, in combination with a custom prompt to generate actions that the LUA bot API understands.
Be sure to check out our GitHub for more details and a deep dive into the code:
https://github.com/AmandineFlachs/bota
Challenges we ran into
We ran into multiple challenges to interact with Dota 2. First, the game needs to be run with a variety of custom - sometimes undocumented - arguments. Analyzing the game state serialized with Protocol Buffer sent on a socket was also challenging as a lot of things are undocumented and there is no reference implementation. Using the LUA bot API to send actions to the game is also constraining. Any mistakes meant you had to stop and restart the game, which is quite time-consuming, especially in such a competition where time is precious. We encountered a lot of bugs and edge cases in Dota 2 because implementing bots for this game is not very common. The public documentation for the bot API is outdated and new features implemented in the game are not supported by the bot API.
Accomplishments that we're proud of
We made it work even though Dota 2 was very reluctant to let our bot play the game. Scoping a project for a hackathon can be an art, and while there is still a lot of work to be done to cover all aspects of the game, the heroes, abilities and actions we choose to focus on for the hackathon have been successfully implemented.
What we learned
GPT-OSS-20B was very simple to steer to play the game the way we wanted and followed instructions well compared to other models we tried out of curiosity. It was very interesting to examine the reasoning traces generated by the model, as well as the mistakes the model sometimes makes.
What's next for bota
We would like to see if increasing the reasoning effort of the model would improve bota's performance. Unfortunately, as it is a synchronous system, when we tried with our RTX 5090 we encountered very slow inference time, which meant the agent was not reactive enough to play the game.
We would also like to expand Bota to more Dota 2 heroes and set up a livestream, similar to
ClaudePlaysPokemon
, where viewers can watch the agent’s reasoning unfold in real time and even interact with the game to guide its decisions.
README excerpt
## Project summary Bota is an autonomous Dota 2 agent that plays 1v1 Mid Lane, powered by GPT-OSS-20B and vLLM, and developed for the OpenAI Open Model Hackathon (https://openai.devpost.com/). Our agent is written in Python and interacts with Dota 2 via 2 mechanisms: a socket to receive the observed game state and the LUA bot API to execute actions. We use the vLLM inference engine to run GPT-OSS-20B locally. The model is used without fine-tuning, in combination with a custom prompt to generate actions that the LUA bot API understands. The agent can move the hero, attack, use items as well as abilities. [](https://youtu.be/XIzfuFHGIOI) ## Repository ```bash ├── assets │ ├── architecture.png │ ├── logo.png │ ├── screenshot.png │ └── video-thumbnail.png ├── bot_generic.lua ├── config.yaml ├── dota_sh.patch ├── dota_state.py ├── hero_selection.lua ├── LICENSE ├── protobuf │ └── Makefile ├── README.md ├── requirements.txt ├── run_agent.py ├── run_dota2.py └── utils.py ``` ## Prerequisites Bota has been developed on Ubuntu 22.04.4. - Install Steam and Dota 2 (the game is free to play). Run the following command as sudoer: ```bash apt-get install steam steamcmd ``` - You also need to install the Protocol Buffer compiler 30.2. Follow official instructions: https://protobuf.dev/installation/ - Install Python dependencies: ```bash python3 -m venv venv source venv/bin/activate pip install -r requirements.txt ``` - Generate dota