Coding a Vision ChatGPT that plays Poker Autonomously! (GPT-4V Python tutorial)

Enric Domingo - AI Engineering · Beginner ·🧠 Large Language Models ·2y ago
Explaining how to make GPT-4V play Poker for me (Autonomous Vision bot in Python) Blog: https://medium.com/@enricdomingo/making-gpt-4v-to-play-poker-for-me-automatic-vision-bot-in-python-69031c79e733 Donate: https://buymeacoffee.com/edomingodot NEW VIDEO - Updated video of how to build a similar bot but for GeoGuessr, with the new OpenAI GPT-4o, Anthropic Claude 3.5 and Google Gemini 1.5 Pro: https://www.youtube.com/watch?v=OyDfr0xIhss (check it to know how to update the GPT-4V Poker Bot to GPT-4o) In this video we will see how to create an automatic bot that uses the new OpenAI GPT-4V (Vision) LLM in order to play Poker in real time. We will be using the game board image to send it to the API in order to give full context from the game state in a single image. If we wanted to do it before using the normal text GPT-4, we would need any scrapping tool which could be impossible or difficult to implement, otherwise we would need to send all the game table information manually, probably running out of time for our turn. In Poker it is not only important to see our current cards and the table's ones, but also everyone's amount of money, every bet and more details that can influence making a call, folding, or any other action beyond the simple probability of our current hand. For this reason it's important to send as much information as possible, as fast as possible. Now, with the new OpenAI Vision model, this is easier than ever as we only need to take a screenshot of the game at the time of our turn and the API will respond us back with the LLM prediction of the best move according to what we put in the prompt as well.  This is also an original review of this new vision LLM in a quite known and common but at the same time original task. DISCLAIMER: This is only a demo for demonstration and experimentation purposes. I only used this techniques in my local instance of PokerTH playig against other NPCs without any real bets or money involved. It's also very importan
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Related AI Lessons

Is Claude 4.x Actually Smarter, or Just Hardwired to Spend?
Learn to critically evaluate AI models like Claude 4.x and understand the difference between true intelligence and hardcoded behavior
Medium · LLM
Beyond Facts and Triggers: Closing the Gap Between “Knowing” and “Understanding” in LLM Assistants
Learn how to close the gap between knowing and understanding in LLM assistants by going beyond facts and triggers, enabling more effective decision-making and action-taking
Medium · LLM
Why your dating app conversations die after 3 messages — a technical breakdown
Learn why dating app conversations often die after 3 messages and how to analyze this phenomenon using LLMs and data analysis
Medium · Startup
What If LLMs Learn Better from Language Than from Rewards?
Discover how LLMs can learn better from language than rewards, and explore TextGrad, MIPRO, and GEPA for rethinking LLM optimization
Medium · AI
Up next
5 Levels of AI Agents - From Simple LLM Calls to Multi-Agent Systems
Dave Ebbelaar (LLM Eng)
Watch →