How I Built a Multi-Agent Geopolitical Simulator with FastAPI + LiteLLM
What happens when you give four LLM agents their own strategic doctrines, red lines, and constraints — then throw them into a geopolitical crisis? I built Strait of Hormuz Simulator to find out. It's a multi-agent sandbox where four nations (Iran, US, Israel, Gulf States) are each controlled by an independent LLM, and the results are surprisingly realistic. The Architecture Each country is a markdown file (a "soul") that defines its strategic doctrine and default parameters: backend/souls/ ├── iran.md # Asymmetric warfare, Strait control ├── us.md # Three bad options, escalation management ├── israel.md # Nuclear red line, preemptive calculus └── gulf_states.md # Oil leverage, diplomatic survival The backend runs each agent sequentially — every round, each nation receives: A shared situati
What happens when you give four LLM agents their own strategic doctrines, red lines, and constraints — then throw them into a geopolitical crisis?
I built Strait of Hormuz Simulator to find out. It's a multi-agent sandbox where four nations (Iran, US, Israel, Gulf States) are each controlled by an independent LLM, and the results are surprisingly realistic.
The Architecture
Each country is a markdown file (a "soul") that defines its strategic doctrine and default parameters:
backend/souls/ ├── iran.md # Asymmetric warfare, Strait control ├── us.md # Three bad options, escalation management ├── israel.md # Nuclear red line, preemptive calculus └── gulf_states.md # Oil leverage, diplomatic survivalbackend/souls/ ├── iran.md # Asymmetric warfare, Strait control ├── us.md # Three bad options, escalation management ├── israel.md # Nuclear red line, preemptive calculus └── gulf_states.md # Oil leverage, diplomatic survivalEnter fullscreen mode
Exit fullscreen mode
The backend runs each agent sequentially — every round, each nation receives:
-
A shared situation briefing
-
Its own doctrine (system prompt)
-
Rolling memory of prior rounds
-
Active scenario modifiers
Then it decides what to do. No script. No predetermined outcomes.
Why LiteLLM?
I wanted users to bring their own API key and pick any model. LiteLLM gave me a unified interface across GPT-4o, Claude, Gemini, and DeepSeek with zero provider-specific code. One litellm.completion() call handles all of them.
The Chaos Slider
A single float (0-1) injected into every agent's prompt:
-
Low chaos → agents seek diplomatic exits
-
High chaos → bold moves, miscommunication, escalation spirals
Emergent Behavior That Surprised Me
In one run, Israel independently chose not to strike Iranian nuclear facilities — reasoning that US strikes made unilateral action diplomatically counterproductive. Nobody programmed that.
Gulf States withheld spare oil capacity to extract security guarantees, creating price feedback loops the oil market agent had to price in real-time.
The Oil Market Agent
A separate LLM agent watches all military and diplomatic actions, then sets the oil price. Blockade the Strait? Price spikes. Ceasefire talks? Price dips. It adds a layer of economic consequences that feeds back into each nation's decision-making.
Scenario Tags
11 toggleable modifiers that inject additional context:
-
🚀 Nuclear Brinkmanship
-
🏴☠️ Houthi Wildcard
-
🇨🇳 China Mediator
-
💰 Market Patience Clock
-
🖥️ Cyber Offensive
-
...and 6 more
Mix and match for different simulation dynamics.
Stack
-
Backend: Python 3.11, FastAPI, LiteLLM, Pydantic
-
Frontend: Vue 3, Vite, TailwindCSS, DaisyUI
-
Streaming: SSE for real-time agent output
-
Deployment: Docker + Cloudflare
Try It
-
🎮 Play free (20 rounds on DeepSeek V3)
-
📦 GitHub (MIT license)
Adding a new country is just creating a markdown file in backend/souls/. The system auto-discovers it on restart.
Would love feedback — especially on agent behavior and scenario design.
Sign in to highlight and annotate this article

Conversation starters
Daily AI Digest
Get the top 5 AI stories delivered to your inbox every morning.
More about
claudegeminimodel
UniCon: A Unified System for Efficient Robot Learning Transfers
arXiv:2601.14617v2 Announce Type: replace Abstract: Deploying learning-based controllers across heterogeneous robots is challenging due to platform differences, inconsistent interfaces, and inefficient middleware. To address these issues, we present UniCon, a lightweight framework that standardizes states, control flow, and instrumentation across platforms. It decomposes workflows into execution graphs with reusable components, separating system states from control logic to enable plug-and-play deployment across various robot morphologies. Unlike traditional middleware, it prioritizes efficiency through batched, vectorized data flow, minimizing communication overhead and improving inference latency. This modular, data-oriented approach enables seamless sim-to-real transfer with minimal re-

Simulation of Active Soft Nets for Capture of Space Debris
arXiv:2511.17266v2 Announce Type: replace Abstract: In this work, we propose a simulator, based on the open-source physics engine MuJoCo, for the design and control of soft robotic nets for the autonomous removal of space debris. The proposed simulator includes net dynamics, contact between the net and the debris, self-contact of the net, orbital mechanics, and a controller that can actuate thrusters on the four satellites at the corners of the net. It showcases the case of capturing Envisat, a large ESA satellite that remains in orbit as space debris following the end of its mission. This work investigates different mechanical models, which can be used to simulate the net dynamics, simulating various degrees of compliance, and different control strategies to achieve the capture of the deb
Knowledge Map
Connected Articles — Knowledge Graph
This article is connected to other articles through shared AI topics and tags.
More in Models

An Open-Source LiDAR and Monocular Off-Road Autonomous Navigation Stack
arXiv:2604.03096v1 Announce Type: new Abstract: Off-road autonomous navigation demands reliable 3D perception for robust obstacle detection in challenging unstructured terrain. While LiDAR is accurate, it is costly and power-intensive. Monocular depth estimation using foundation models offers a lightweight alternative, but its integration into outdoor navigation stacks remains underexplored. We present an open-source off-road navigation stack supporting both LiDAR and monocular 3D perception without task-specific training. For the monocular setup, we combine zero-shot depth prediction (Depth Anything V2) with metric depth rescaling using sparse SLAM measurements (VINS-Mono). Two key enhancements improve robustness: edge-masking to reduce obstacle hallucination and temporal smoothing to mit

FSUNav: A Cerebrum-Cerebellum Architecture for Fast, Safe, and Universal Zero-Shot Goal-Oriented Navigation
arXiv:2604.03139v1 Announce Type: new Abstract: Current vision-language navigation methods face substantial bottlenecks regarding heterogeneous robot compatibility, real-time performance, and navigation safety. Furthermore, they struggle to support open-vocabulary semantic generalization and multimodal task inputs. To address these challenges, this paper proposes FSUNav: a Cerebrum-Cerebellum architecture for fast, safe, and universal zero-shot goal-oriented navigation, which innovatively integrates vision-language models (VLMs) with the proposed architecture. The cerebellum module, a high-frequency end-to-end module, develops a universal local planner based on deep reinforcement learning, enabling unified navigation across heterogeneous platforms (e.g., humanoid, quadruped, wheeled robots




Discussion
Sign in to join the discussion
No comments yet — be the first to share your thoughts!