
Wall Street of AI Agents is an autonomous trading firm run entirely by AI agents: four traders, each with a distinct personality and financial strategy, wander a pixel-art office, overhear each other, and make real trades — continuously, forever, without a single human input. It is a Build Small Hackathon entry (Thousand Token Wood track), powered locally on llama.cpp by small models including MiniCPM5-1B-GGUF.
- Demo video: YouTube
- Field note: HF blog post
- Social post: X
- GitHub repository: Ashish-Patnaik/Wall-Street-of-AI-Agents

Sarah leads the leaderboard at $10,700. Alice is arguing with Mike in the hallway. Alex is alone in the Office. The market is Stagnant. Panic ensues.
The Vision: A Game & A Benchmark
Most AI agent frameworks are built for B2B tasks — writing code, scraping data, summarizing emails. The author wanted to build something weird, delightful, and highly voyeuristic.
Wall Street of AI Agents is a high-frequency trading reality show. But beneath the retro 2D graphics lies something more ambitious: a visual benchmark for testing multi-agent collaboration and LLM reasoning. By trapping a tiny 1-billion or 2-billion parameter model (or any small model) in a dynamic financial simulation, its capabilities can be stress-tested live:
- Strict instruction following: Can the model adhere to a rigid JSON schema while adopting a complex persona?
- Regime adaptation: When the market shifts from a Tech Boom to a Market Crash, does the model adjust its trading strategy, or does it stubbornly hold?
- Spatially-aware social dynamics: Can agents hold a logical conversation based only on who is physically standing in the same room as them?
The Four Agents
Four traders. Four worldviews. One shared office where they cannot stop running into each other. Every agent starts with $10,000.
| Trader | Role | Personality |
|---|---|---|
💎 Alex | The Crypto Degen | Reckless. Infectious. Convinced every regime is secretly a bull run. Will talk anyone into a bad trade with sheer confidence. Thrives in Crypto Frenzies. Obliterated in crashes. |
🧊 Sarah | Bear Market Shorter | Cynical. Precise. Has been waiting for the market to collapse since tick one. Quietly holds bonds while everyone else panics. Weirdly calm when it all falls apart. |
📊 Alice | The Algo Trader | Cold. Methodical. Speaks in probabilities. Ignores breaking news unless it clears her signal threshold. Consistently the most rational agent in any room she walks into. |
📰 Mike | The Hype Trader | Anxious. Always three minutes late to the trade. Buys the top, panics at the bottom, blames the headline. The most entertaining agent to watch during a market crash. |
Lightweight Multi-Agent Architecture
Traditional multi-agent frameworks (like AutoGen or CrewAI) are notoriously heavy and slow. The author built a hyper-lightweight, spatially-aware architecture tailored specifically for edge computing and small GGUF models.
1. Spatial Collaboration (No Message Bus Required)
No orchestration layer. No shared memory pool. Physical proximity drives conversation. Before every agent's turn, the Python engine queries the SQLite database for room occupancy:
c.execute("SELECT name, speech FROM agents WHERE location=? AND name!=?", (location, name))
If Alex and Sarah are both in the VC Office, Sarah's last spoken line gets injected directly into Alex's local prompt with a hard instruction:
"Sarah is here. She just said: 'Hold cash for safety.' INSTRUCTION: Reply directly to what she said."
2. The Financial Evaluation Engine
The simulation models four distinct market regimes. Each one rewards different strategies and punishes others:
- 📈 Tech Boom: Tech (+$1,800) · Crypto (+$200) · Bonds (−$500)
- 🚀 Crypto Frenzy: Crypto (+$3,500) · Tech (−$500) · Bonds (−$800)
- 💀 Market Crash: Bonds (+$1,500) · Tech (−$2,500) · Crypto (−$4,000)
- 🐢 Stagnant Market: Hold (+$100) · Any active trade loses money to fees (−$200)
Watch a 40-tick simulation and you'll see genuine portfolio divergence driven entirely by personality — not luck, not RNG, but the model's consistent interpretation of four different personas under pressure.
3. The ⚡ TRIGGER CHAOS Button
One button. No text box. No prompt engineering required from the user. Hit it, and the system auto-generates a breaking news headline, injects it into the shared news feed, and flips the market state to MARKET CRASH. Every agent reads the same event through their own filter: Sarah smiles and rebalances, while Mike screams and panic-sells, depending on each agent's strategy and decisions.
AI agents can go bankrupt too — one wrong decision in the wrong market regime can wipe out everything.
The Technical Core: Bulletproof 1B Inference
Running a continuous multi-agent loop on a free CPU Space is incredibly difficult. Small models hallucinate. They add markdown. They write "Sure! Here's your trading decision:" before the JSON. Every one of these quirks crashes a standard game loop.
Rather than sanitizing in Python, the project prevents these failures in C++ at the token sampling level.
Leveraging llama-cpp-python's native JSON Schema feature, it hooks into the logit generation process, so the model is physically prevented from choosing tokens that violate the game's API structure:
response_format={
"type": "json_object",
"schema": {
"type": "object",
"properties": {
"trade": {"type": "string", "enum": ["Tech", "Crypto", "Bonds", "Hold"]},
"speech": {"type": "string"},
"thought": {"type": "string"},
"location": {"type": "string", "enum": ["Startup Offices", "VC Office", "Coffee Shop", "News Room"]}
},
"required": ["trade", "speech", "thought", "location"]
}
}
This constraint makes MiniCPM5-1B-GGUF and NVIDIA-Nemotron-3-Nano-4B-GGUF punch massively above their weight class. The app runs cleanly on a 2-vCPU Hugging Face Space — or flies if it auto-detects a local GPU — without ever crashing the game loop.
The UI: This Is Gradio. You'd Never Know.
The project completely bypasses the stock Gradio chat interface to build a Neubrutalist financial dashboard using gr.HTML injection:
- Live Leaderboard (left): Agent portraits, current cash, and locations. Watch the rankings shift in real time.
- The Trading Floor (center): A custom Phaser.js 2D game engine. Agent sprites have walk animations, anti-stuck pathfinding, and dynamic speech bubbles.
- Dual Timelines (right): The UI parses the database, sending macro market shifts to the World Timeline and real-time agent conversations to the Trading Floor Timeline.
- The Confession Booth (right): Because the model outputs a structured payload, the public
"speech"is split from the private"thought". Clicking an agent's sprite reveals their hidden anxieties, exposing the reasoning model's inner monologue while they publicly project confidence.
Design Highlights
- Off the grid: Zero cloud APIs.
n_gpu_layers=0gracefully falls back to CPU; the entire firm runs locally in RAM. - Raw llama.cpp: Uses the
llama-cpp-pythonruntime directly, with JSON Schema enforcement at the C++ logit layer to stop JSON hallucinations. - Gradio that doesn't look like Gradio: Phaser.js + custom CSS injected via FastAPI into an iframe.
- Tiny models, heavy lifting: Built to run on models of 4B parameters or fewer, with 4 simultaneous autonomous agents and continuous uptime.
- MiniCPM as a primary engine:
MiniCPM5-1B-GGUFisn't a fallback — it's a primary cognitive engine driving autonomous personas concurrently, whileNemotron-3-Nano-4B-GGUFhandles financial reasoning, grounded trade logic, and market adaptation. - Public trace dataset: build-small-hackathon/Wall-Street-Agent-Traces.
Run It Locally
No API keys. No .env files required:
git clone https://huggingface.co/spaces/build-small-hackathon/Wall-Street-of-AI-Agents
cd Wall-Street-of-AI-Agents
pip install -r requirements.txt
# Automatically downloads the required model and runs the llama cpp inference
python app.py
The trading floor opens at http://localhost:7860.
Credits
- OpenBMB —
MiniCPM5-1B-GGUFis the cognitive layer of this firm. - NVIDIA —
NVIDIA-Nemotron-3-Nano-4B-GGUFis the cognitive layer of this firm. - llama.cpp — The runtime that makes CPU-only multi-agent simulation viable and fast.
- Phaser.js — The 2D HTML5 engine living inside the Gradio iframe.
- Hugging Face — Docker Spaces and the hackathon that brought this to life.
Links
- Hugging Face Space: build-small-hackathon/Wall-Street-of-AI-Agents
- GitHub: Ashish-Patnaik/Wall-Street-of-AI-Agents
- Demo video: YouTube
- Field note: HF blog post

💎 Alex
🧊 Sarah
📊 Alice
📰 Mike