Feeling lucky, punk? Let's dance.
-- mistral-nemo:12b
Playable proof-of-concept for an LLM playing a game against you, and making colorful comments about its attempts at conquest.
There are many like it, but this one is mine.
Inspired by https://every.to/p/diplomacy.
The game is based on Bombardment, where you are on a 5x5 grid and
you and your opponent picked 4 positions known to you but hidden to
each other. You both lob missiles at each other blindly until one
player gets lucky enough to hit all four.
As a proof-of-concept, some of the input validation and output messages are unpolished, and it also reveals the LLMs positions to you so you can experiment with the LLM's reactions to winning or losing.
Requirements:
- Python, e.g. Python 3.12
- Ollama
- Install Ollama using their guide
- Download the default model use by the game:
ollama pull llama3-groq-tool-use:8b - Create python virtual environment -
virtualenv venv && source venv/bin/activate && pip install -r requirements.txt
python play_ollama.pyOr
python play_original.pySupports any Ollama model that can reliably produce structured
output (json) when requested to do so, and does not intermingle
thinking output.
Does not require tool support.
The models sometimes appeared to intentionally obscure their
platoons. Even though the prompt specifies an array of four
integers, the models would sometimes provide four strings of
integers (which are not equal in Python), or even withhold
their choices altogether by providing obfuscated values
such as platoons: ["secret_platoon_1", ..].
You got me this time, but I'll be back! Game's not over yet!
-- llama3-groq-tool-use:8b
Are you not entertained?