Matrix Games on Ollama (local LLMs)
Whilst proving the Matrix Game Simulation (MGS) idea on ChatGPT was a useful first step, there are a lot of use cases (e.g. military, government, enterprise) where you don’t want to be doing your wargaming on a cloud-based platform, where you don’t know where your data and conversations will end up. So what would be really useful would be to run MGS on a local PC, or at least on a server on your own intranet.
As a first step to exploring this I recently installed Ollama on my laptop. Ollama is open source software which lets you run a variety of different large language models (LLMs) on your own computer, free of any connection to the Internet. The models include Llama itself, Mistral and even the Chinese DeepSeek. Installation was quite straightforward and a simple console commands downloads the model you want, and opens it up for chat in the command line. No need to install anything else. I did this first run with llama 3.2 installed as my LLM.
The first thing I did was check that it knew what matrix games were. It thought I meant games set in The Matrix and started talking about Cyberpunk Red, so I asked again about Chris Engle’s matrix games for wargaming, and it came back with a sensible description.
Before looking into pre-prompts and models and doing the equivalent of a Custom GPT, I just typed a quick scenario description for a Greenland game, told it to play all the roles and set it off. My prompt was simply:
can you play a matrix game for me. I want you to be the umpire and the players. The setting is Donald Trump wanting to take over Greenland. The players are Donald Trump - the President of the USA, the leader of Greenland (who would like independence from Denmark), the prime minister of Denmark (which owns Greenland), and Mark Rutte who is the leader to NATO to which both Denmark and the USA belong and who does not what to see war between the countries.Ollama then started.
**Welcome to "Greenland Showdown"**
You are all players in a high-stakes game of diplomacy, strategy, and international relations. Your goal is to navigate the treacherous waters of global politics to achieve your objectives while minimizing conflict with other nations.Your Roles:
1. **Donald Trump (USA)**: The 45th President of the United States, seeking to expand American influence in the Arctic region.
2. **Mikaela Skovgaard (Greenland)**: The Prime Minister of Greenland, advocating for independence from Denmark and wanting to maintain Greenland's sovereignty.
3. **Mette Frederiksen (Denmark)**: The Prime Minister of Denmark, committed to preserving Greenland's union with Denmark while balancing its own interests.
4. **Mark Rutte (Netherlands/NATO)**: The Dutch Prime Minister and NATO Secretary-General, seeking to prevent war between the USA and Denmark over Greenland.Interesting that it knew Mette Frederiksen but made up Mikaela Skovgaard. It didn’t understand about playing all the roles, I had to keep reminding it and telling it to make choices
Let's proceed with the first round. As Donald Trump (USA), you have three options:
A) **Tweet about the situation**: Make a public statement expressing your support for buying Greenland and threatening economic sanctions on Denmark if they don't comply.
B) **Hold a meeting with Mette Frederiksen**: Offer to meet with the Danish Prime Minister in an effort to negotiate a deal or find common ground.
C) **Visit Greenland**: Fly to Greenland and hold meetings with Mikaela Skovgaard and other Greenlandic leaders to show your commitment to buying the island.
As Mette Frederiksen (Denmark), you've received Donald Trump's public statement, and it's causing concern among your advisors. You need to respond to this challenge.
As Mark Rutte (Netherlands/NATO), you're watching the situation unfold with growing unease. You must decide how to intervene and prevent a potential conflict between the USA and Denmark.
And as Mikaela Skovgaard (Greenland), you're sensing an opportunity to assert Greenland's sovereignty and independence from Denmark.
Which option do you choose? Please respond, and I'll describe the consequences of your decision.
>>> you chose
I've made a choice as Donald Trump (USA):
**Tweet about the situation**: Make a public statement expressing my support for buying Greenland and threatening economic sanctions on Denmark if they don't comply.
As Donald Trump, you tweet: "just announced that the US is very seriously considering purchasing #Greenland from #Denmark. If not, we'll impose massive tariffs & economic sanctions. Nobody knows more about great deals than me! #MAGA"
The reaction is immediate and intense:
* Mette Frederiksen (Denmark) issues a statement saying that Denmark will not sell Greenland to the USA under any circumstances.
* Mark Rutte (Netherlands/NATO) contacts you, expressing concern about the situation and urging restraint. "Mr. President, this is not how we handle international relations. We must work together, not threaten each other."
* Mikaela Skovgaard (Greenland) sees an opportunity to assert Greenland's sovereignty and independence from Denmark. She sends a statement to the Danish government, saying that Greenland will not be sold to anyone, but it also implies that the country is open to dialogue.
The situation is now on a high level of tension. The end state after about 10 turns was:
The game began with a tense standoff between the USA and Denmark over the sale of Greenland. I initially demanded that Denmark sell the island to me, but ultimately decided to back down and withdraw US troops from Thule Air Base in exchange for cooperation. I then used the media to shape public opinion, which had some positive effects but also created tension with EU leaders. Next, I pursued other Arctic interests, including a new initiative to explore energy sources and create jobs.
**Final Situation:**
After my decisions, the situation remains complex and delicate. The USA and Denmark are still in a tentative partnership on Greenland, while the EU expresses concern about US actions in the Arctic. NATO has offered military protection to Greenland, but there is no clear agreement on how to proceed.
The game ended with a sense of uncertainty and competition between the players, as each side sought to assert its interests and achieve its goals. The final situation suggests that the situation remains volatile and potentially explosive, with multiple stakeholders having different agendas and concerns.It also look like it only played Trump as an active player, but for a first pass and without the full set of MGS instructions it did better than I expected. A few observations:
The US giving up the Thule base did seem a very strange move;
It was able to bring in things like the names of the Danish leader, even without a web connection - but then hallucinating about the Greenland leader makes you wonder about any “fact” it presents;
Ditto bringing in the name of the US base, it being renamed Pituffik Space Base in April 2023, the Thule name is likely to dominate given that the llama3.2 knowledge cut-off is December 2023;
I didn’t set a turn limit, or turn duration, and this seemed to work well as it avoided the last-turn-itis I’d seen in ChatGPT runs, and its tendency to satisfice. I quite liked the way that in the end things just fizzled out and Trump got bored and went on another Arctic initiative instead, this time possibly courting the Russians.
From essentially a one line prompt I’m pretty impressed, and will look a bit more about how to customise Ollama bot so that I can hopefully get local Ollama performance for this use case pretty close to ChatGPT.
A few additional observations on Ollama not related to MGS:
My laptop is “good” but not a gaming laptop, and in simple chat mode Ollama seems to run as fast as ChatGPT on the web;
One of the LLM models Ollama will run is an earlier but “uncensored” version of Llama, so one without the guardrails - so this should let it generate the sort of injects that ChatGPT baulked at when we wanted messages about people’s houses being bombed;
You can customise the “temperature” of the model, essentially a sliding scale between very creative/lots of hallucinations and not creative/minimal hallucinations. It will be worth playing with that to see how it impacts the flow of a matrix game;
As a test of it’s general knowledge I asked it about Germany and then the Weimar Republic. It does look like in the 4GB download of the model it has effectively shoehorned in an A Level knowledge of the topic - and I guess of almost any topic!
I’ll report back after the next round of development/testing.

