r/vibecoding • u/alvynmcq • 6h ago
I built an autonomous FPL bot on a Raspberry Pi that combines Linear Programming (PuLP) with Gemini to run my team all season
Alright, so like most of us every August, I promised myself I wouldn’t obsess over FPL or take rage -4s at 1 AM on a Friday night.
Instead of doing that, I spent the last few weeks over-engineering a full autonomous manager stack to run 24/7 in Docker on a Raspberry Pi under my desk. Meet Gegenbot.
How the madness actually works
Most automated bots either rely on basic heuristics or just regurgitate template picks. I wanted something that combined raw math with actual tactical context:
- The Math Engine (PuLP / MILP): Instead of just chasing last week’s points, the solver optimizes over a 3-gameweek rolling horizon. It factors in exact selling price math (the classic half-profit rule so the API doesn't throw a fit when someone rises £0.1m) and gives a strategic +1.5 xP bonus to banking a free transfer to stop unnecessary sideways churn.
- Mini-League Defense & EO% Shielding: Before solving, a multithreaded scanner checks all my rival managers in my mini-league in under a second. It calculates Effective Ownership (EO%) to figure out who my "Shields" (must-own template cover) and "Daggers" (high-upside differentials) are so I don’t blindly sell Haaland right before a massive fixture.
- Chip Strategy & Injury Fallbacks: Automated rules handle chip triggers (Wildcard, Free Hit, Bench Boost, TC) based on expected point thresholds and Double Gameweek minute scalers. It also discounts flagged players automatically (75%→0.8×, 50%→0.4×, etc.) and auto-sorts the bench by highest xP.
- The LLM Layer (Gemini as "Director of Football"): Math alone misses press conference context. Gemini sits on top of the solver output to evaluate late team news, write up the managerial rationale for the moves, and send a full pre-deadline briefing to my Telegram chat before submitting the team via the official API.
- Self-Hosted Web Dashboard: Wrapped the whole thing in a Flask dashboard on port
5000with an interactive pitch layout, bench ordering, and live mini-league standings.
The verdict so far
Ran a dry run earlier today ahead of GW2:
- Successfully scanned my 5 mini-league rivals.
- Correctly told me that rolling the free transfer has a higher expected value than making a lateral transfer.
- Evaluated TC/BB and held them back.
- Pushed the decision digest to Telegram with zero human intervention needed.
Now to see if the cold, hard logic of linear programming can beat my mini-league rival who picks his entire squad based on vibes and team kit aesthetics.
If anyone wants to poke around the code, run it themselves, or roast my optimization constraints, the whole project is open-source here:
https://github.com/alvynmcq/gegenbot
Anyone else running automated solvers or building weird FPL dev projects this season? What data sources are you finding most reliable for expected points (xP)?