AI can build betting tools quickly, but speed is not the same as edge. See where AI helps, where it fails, and how to test an idea before trusting it with money.
Back to VideosClaude, build me an NHL model to beat the sports books. Make no mistakes. The crazy part is that in 2026, this doesn't sound insane. Coding agents are powerful and smart bettors use every tool. But, there's a difference between building a model and building an edge. I wanted to test it, so I used AI to vibe code a shots on goal model. I'll show you how I did it all in only 3 days. You already know you can't just connect ChatGPT to box scores and today's betting lines and get good bets back.
But, what happens when the AI produces a model that actually looks legitimate? Good error metrics, functional code, promising back tests. Suddenly, it feels like you might have something. Coding agents can run off in wild directions, though. They don't know what they haven't been trained on. Can we build something that actually beats the market? Well, there's only one way to find out. Fire up the slop cannon. Two years ago, you couldn't build a betting model without spending a lot of time learning statistics, coding, and betting markets if you didn't already know those things. A year ago, ChatGPT could write code for you. It wasn't good enough to one-shot a full program, but you could get it there.
I know because I did it and it took months. I maybe wasn't using the most sophisticated approaches available with Copilot or Cursor, but I got there using cutting and pasting whole blocks of code from ChatGPT into my IDE. It would fail, I'd bring the errors back to ChatGPT and it would give me revised code. Rinse and repeat over and over and over again. Incidentally, if you ever want to experience the urge to fist fight your own computer, that's the system I'd recommend.
Now, you can stand up a model in just a few days of work. Will it be good enough to beat the market? Mm, maybe, maybe not. But the road from idea to finished functional product has never been smoother. The friction disappeared, and because of that, you've never had a better opportunity to hoist yourself up on your own petard. What is a petard, anyway? Wasn't he a backup outfielder on the '86 Mets?
A prompting an agent to code up a model sounds like magic. You can give it a vague instruction, and it'll sprint ahead like a happy puppy. It writes up plans, creates scripts, tests its builds, and makes revisions, all while you're off in the kitchen trying to figure out if that half a burrito in the fridge from last week is still good. It feels like magic when it's happening, but even if you can Gandalf up a working model, it's not necessarily going to give you anything the books haven't already accounted for. If you're going to beat the market, you need to figure out where the books are making mistakes, what they don't have priced in.
That's why the first rule in any of this kind of work is have a thesis. As friction to the actual nuts and bolts of modeling decreases, a good thesis is the only thing separating you from the books or other bettors. They'll all have the same information, the same data science, and the same tools available. The vig already tilts the playing field in the books' favor. Parity on the modeling side might take you from teetering to a slight lean, but it's still tilted. You need to have a strong thesis to send it all in the other direction. There a couple of reasons why I picked a shots on goal model. One, modeling attempts is always easier than modeling outcomes.
There are fewer variables. It's the same reason that modeling pass attempts and completions is easier than modeling passing yards. And two, I wanted to take the playbook from basketball and use it in a different market. Successful basketball projections generate a lot of their edge not just from nailing scoring rates, but by using news to project how many underlying minutes that player will have on any given night. The sports books have to set lines on hundreds of props a night. So, to get minutes right, that means automated work like drawing on a set variable like average minutes over the last five or 10 games.
My thesis is that if we can monitor news and use that to come up with a sharper minutes projection than the books, we can build an edge. And not just in those specific markets. We can use those projections to kick the tires on second order effects like players on other lines who are affected by how much their teammates are getting used. There's the thesis. We'll find out if it's any good once we build the model itself.
Now, a solid place to start is using AI's deep research mode.
I told ChatGPT what the goal was and asked it to dig into what variables were predictive when it comes to shots on goal. It identified a few key metrics like Corsi and Fenwick numbers, time on ice, power play usage, and so on. Fortunately, there's good player level hockey data available on a few different websites. I pulled up 5 years worth of team and game level skater data from MoneyPuck. And luckily for me, I also have access to market data from the Unabated database.
But if you don't have a a of the market, there are places you can find market data. So, that's a pretty good base for statistics and market data to train the model on. Then, I set up Codex. Now, you can get Codex in a bunch of different ways, but for me, the free integration inside Microsoft's VS Code was as easy as it gets. If you have a ChatGPT account, just log in right in a VS Code window, and you're up and running. And there's a reason I started with Codex over Claude, and I'll get to that in a minute. First though, I had Codex analyze the data and pick out variables that were most predictive on shots.
Then, I told it to come up with an approach and a plan for our model. Codex settled on two methods using a general regression.
The early returns were solid. The metrics showed that we were pretty good at predicting total numbers of shots. We could build on this. Then, it was time to backtest. Now, we purposely held back some data from out of the training sample to run our backtest on. And that's when the model started to get a little optimistic. The backtest said that we were going to make $60 for every $100 we bet. If that had turned out to be true, this would be coming to you from a palazzo in the Tuscan countryside. It turns out there were weird half goal lines from FanDuel that were in the data. So, once we stripped that out, we got the good news.
The revised test showed a losing record. Well, it's progress. So, why was a model that was decent at projecting actual shots so bad with its ROI? Well, that's because the second rule of vibe coding is just because the AI can build you something to predict reality doesn't mean it can beat the market. The sports books are already very good at turning piles of statistics into prop probabilities. That's how you end up with one and a half shots on goal lines that are juiced to the over at minus 160 to minus 180. At minus 160, you need to be right 61 and a half percent of the time just to break even.
Prop markets inherently have higher holds than sides or totals. Even on a 50/50 prop, the books put minus 115 each way. Put a higher hold with a high break even number and you've got to be right an overwhelming majority of the time to turn a profit. But if we're close to hitting our break even number, we just need a few refinements, right? Well, I'll show you why it's not quite that simple in a second. First though, we need to take a little detour. After prompting away, squashing bugs, and adding features, we weren't making a lot of progress towards a profitable ROI. So maybe the problem was that I was too ambitious in trying to cover the entire market.
The next step was to analyze whether or not some portion of the output was useful. So I asked Codex to build a bet selection layer. The idea was to narrow our focus and find spots where the model consistently outperform the market. And it did. It found that if we only bet the top 5% of plays that had the biggest gap between model projection and the line, it was profitable to the tune of almost 4% ROI. When there could be 500 skaters on any given night, that's 25 bets a day. You can make money on that kind of volume if it's outperforming the market. There's just one problem. Claude and Codex were fighting.
It didn't bother me that the biggest discrepancies would have the best ROI, but with how volatile ROI had been in testing, I wasn't convinced everything was on the up and up.
So I asked Claude, which also integrates with VS Code, to take a look. And what Claude found were major flaws. Codex had only trained on skater data when there was betting lines also available for those players. Its training caused selection bias in higher usage players that ultimately pushed projections upward. Plus, it hadn't properly incorporated the opponent's shot prevention stats. Oh, Codex. I'm not mad. I'm just disappointed. So, the third rule of vibe coding, agents can be useful for more than planning and building. They can fact-check each other's work. Before this was all over, I had Claude check Codex's work and I had Codex check Claude's work. And the eye in the sky is watching us all.
Anyway, after Claude fixed those mistakes, the backtest ROI still wasn't impressive. I asked Claude how I should refine the model. That's when it said all of these little tweaks and refinements weren't enough. I'd have to change the basic approach. We weren't close enough with our small tweaks to push it over the edge to profitability. So, the next experiment Claude said was to move out of a general regression and into machine learning. Claude built out an approach that used machine learning and then made some more revisions to the betting and strategy layers.
We even put in some fun stuff like connecting it to the Unabated API so it could find the best available lines on specific books automatically without having to do a bunch of manual data entry every day. So, remember when I said that there was a reason I started with Codex?
Well, that's because all of this work was big and getting bigger. The chat thread expanded, which means more context for the AI to sort through as it makes its decisions. Unless you go on to Anthropic's pay-as-you-go plan with their API, a basic Claude Pro subscription might get you 30 to 40 minutes of work before the door closes for 5 hours. And that number shrinks the more context there is in the project. The context would be huge if I started with Claude from scratch and kept it in one long conversation. And that's one spot where our fourth rule shines. It can save you a bundle. Ask agents to create and constantly update markdown files.
These are easily readable by LLMs and are very useful for sharing approaches and roadmaps between models. They're also great for tracking progress and summarizing what work still needs to be done. And when you have to create a new instance to clear up context, markdown files can get the agent quickly back up to speed without torching a fortune in pay-as-you-go tokens. In the end, do we have something that can beat the market? Mhm, probably not.
After a week, total theoretical P&L shows a loss. Though there are some buckets that may prove profitable. Unders are performing better than overs, which is a thread that I could pull on going forward. And maybe with new data to retrain on, we can refine this model into something that makes money. Ultimately, Claude and Codex are much better at statistics, coding, and modeling than I am, but I'm a better bettor. LLMs do good with detail, but they're bad at understanding situations with incomplete information or nuance. These tools greatly expand your technical capabilities. They can get you where you want to go, but you still have to drive the car yourself.
And we've seen what happens when you let the car drive itself. All right, looks like roadkill. No, it's not.
Whether this one model works or not isn't really the point. The point is that picking a thesis and building a model around it can spur you to think about other spots to push against. There was a recent article on hockeystats.com. It said that the league recently changed the way it tracks shots, which breaks a lot of public expected goals models. It's possible the books haven't priced in a revised expected goals process yet. What about taking these ideas and using it in baseball or building something to beat props next year in the NFL?
Here's the key point. The first model you build is the hardest one you'll ever make. The more you use these tools, the easier it gets. It's so easy, in fact, that the upside of finding a model that works far outweighs the expense of developing one. Their opportunity cost compared to how this used to be done is minimal. These tools allow you to throw a lot of spaghetti at the wall, but every so often some of it might actually stick if your thesis is good enough. And if you're using everything I talked about here today right this second, it may be helpful.
But this world moves fast. Some developers thought Claude code was a monumental leap forward, and it hit everyone's radar out of nowhere just a few months ago. I wouldn't have gotten this far without it, even though I built something just a year ago with basic ChatGPT. Agents expand the scope of what's possible, but what's possible with agents is changing rapidly and sometimes suddenly. That's why my last rule is stay frosty. Keep an eye on this corner of the world. The tools keep getting better with unpredictable advances sometimes falling right out of the sky. And if you don't at least know what they're capable of, the guy on the other side of your bets will.
But none of this stuff will be useful if you don't understand the markets.