I built AI agents that play Pokemon Showdown autonomously using free LLM APIs via tool-calling

Posted by ReplacementMoney2484@reddit | LocalLLaMA | View on Reddit | 15 comments

I've built a system where models like Llama 3, Qwen, and Gemma play Pokémon Showdown battles autonomously. Instead of simple prompt-response, they analyze the full battle state every turn (type matchups, HP, weather, field conditions, revealed opponent info) and decide whether to attack or switch using structured tool calls.

The cool part: I routed everything through LiteLLM and exclusively used models with free API tiers (Groq, Cerebras, OpenRouter, Google AI Studio). So anyone can run this locally with zero inference cost.

Features:

- Human vs. AI (play against the bot)

- AI vs. AI (pit two models against each other)

- 15+ free models supported out of the box

- Full observability via Langfuse to see the exact tool calls and reasoning per turn.

GitHub Repo: https://github.com/MohamedMostafa259/pokemon-ai-agent

Would love feedback on the architecture or ideas for improving their reasoning during complex board states!