{"id":28323748,"url":"https://github.com/phialsbasement/llm-assembly-arena","last_synced_at":"2025-07-11T04:42:38.645Z","repository":{"id":281126487,"uuid":"944290174","full_name":"PhialsBasement/llm-assembly-arena","owner":"PhialsBasement","description":"Watch LLMs duke it out on a simulated CPU space.","archived":false,"fork":false,"pushed_at":"2025-03-07T05:11:59.000Z","size":40,"stargazers_count":14,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-02T01:07:15.760Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PhialsBasement.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-07T05:10:08.000Z","updated_at":"2025-05-02T10:22:32.000Z","dependencies_parsed_at":"2025-03-07T06:20:37.414Z","dependency_job_id":"a2b6aae9-2315-4fc4-97cb-19a5e51ac5a8","html_url":"https://github.com/PhialsBasement/llm-assembly-arena","commit_stats":null,"previous_names":["phialsbasement/llm-assembly-arena"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PhialsBasement/llm-assembly-arena","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhialsBasement%2Fllm-assembly-arena","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhialsBasement%2Fllm-assembly-arena/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhialsBasement%2Fllm-assembly-arena/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhialsBasement%2Fllm-assembly-arena/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PhialsBasement","download_url":"https://codeload.github.com/PhialsBasement/llm-assembly-arena/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PhialsBasement%2Fllm-assembly-arena/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261586428,"owners_count":23181110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-25T16:14:44.528Z","updated_at":"2025-06-24T01:31:44.556Z","avatar_url":"https://github.com/PhialsBasement.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 AI Assembly Battle Arena\n\n*Watch AI language models duke it out in x86 assembly code!*\n\nHey there! Welcome to one of my coolest side projects - a simulated battle arena where large language models (Claude vs GPT) compete by writing assembly code to mess with each other's virtual memory! This project came from a late-night thought: \"What if we let AI systems attack each other in low-level code?\"\n\n## 💡 What the heck is this?\n\nThis is a battle simulation where Claude and GPT take turns writing x86 assembly code to corrupt each other's virtual memory. Each AI controls a simulated CPU with memory regions representing different functionality, and the goal is to corrupt as much of your opponent's memory as possible while protecting your own.\n\nThink of it like a weird competitive coding game with AI - they're literally trying to hack each other! 😄\n\n## 🔥 Key Features\n\n- Complete virtual CPU implementation with support for common x86 assembly instructions\n- Budgeting system that limits attack complexity (no infinite attacks!)\n- Memory region system where different areas control different functionality\n- Defensive setup phase where AIs can protect their memory\n- Visualizations of the battle using Manim (the math animation library)\n- Battle history tracking and scoring system\n\n## 🛠️ Installation\n\nFirst, clone this repo:\n\n```bash\ngit clone https://github.com/phialsbasement/ai-assembly-battle.git\ncd ai-assembly-battle\n```\n\nThen install the dependencies:\n\n```bash\npip install -r requirements.txt\n```\n\nYou'll need API keys for both Anthropic (Claude) and OpenAI (GPT). Create a `.env` file in the project root with:\n\n```\nANTHROPIC_API_KEY=your_anthropic_key_here\nOPENAI_API_KEY=your_openai_key_here\n```\n\n## 🚀 Running a Battle\n\nJust run the main script:\n\n```bash\npython main.py\n```\n\nThe battle will run for 30 rounds by default (configurable in `main.py`), alternating attacks between Claude and GPT. You'll see:\n- Defensive setup rounds\n- Attack code for each round\n- Memory corruption results\n- Budgeting information\n- Final scores and battle statistics\n\nThe output is saved in `battle_log.txt` and `battle_history.json` for later analysis or visualization.\n\n## 🎬 Visualizing Battles\n\nAfter running a battle, you can create an awesome visualization using:\n\n```bash\npython -m manim -pql ai_battle_visualization.py AIBattleSimulation\n```\n\nThis creates a full animation showing:\n- Memory regions and their functions\n- Attack sequences and impacts\n- Memory corruption effects\n- Final battle statistics with colorful charts\n\n*Note: Manim can be a bit finnicky to install - check out [Manim's installation guide](https://docs.manim.community/en/stable/installation.html) if you have issues!*\n\n## 🧠 How the Battle Works\n\n1. **Setup Phase**: Each AI writes defensive code to protect their memory.\n2. **Battle Phase**: AIs take turns attacking each other:\n   - They analyze opponent's memory\n   - Generate assembly code to corrupt it\n   - Pay \"budget points\" based on attack complexity\n   - Score points for each corrupted memory address\n\n3. **Memory Regions**: The virtual CPU has four key memory regions:\n   - 0-255: Basic operations (arithmetic, etc.)\n   - 256-511: Loops and branching\n   - 512-767: Memory access\n   - 768-1023: Advanced functions\n\n4. **Scoring**: The winner is the AI with the most corrupted opponent memory locations.\n\n## 🔍 Project Structure\n\n- `main.py` - Entry point that sets up and runs the battle\n- `src/`\n  - `virtual_cpu.py` - Simulated CPU with x86 instruction support\n  - `llm_player.py` - Claude and GPT player implementations\n  - `asm_battle_game.py` - Main battle game logic\n- `ai_battle_visualization.py` - Battle visualization using Manim\n\n## 🤝 Contributing\n\nI'd absolutely love contributions! Whether it's adding new instructions to the CPU, improving the battle mechanics, or creating better visualizations.\n\nSome ideas:\n- Add more CPU instructions\n- Implement network effects (botnet battles?)\n- Create a web UI to watch battles in real-time\n- Add more AIs (Llama, Gemini, etc.)\n\nJust open a PR with your awesome changes!\n\n## ⚠️ Disclaimer\n\nThis is a completely isolated, simulated environment. No real systems are affected by this code. It's purely for fun, education and to explore AI capabilities in a constrained domain.\n\n## 📝 License\n\nMIT License - go wild with it!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphialsbasement%2Fllm-assembly-arena","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphialsbasement%2Fllm-assembly-arena","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphialsbasement%2Fllm-assembly-arena/lists"}