A little while back I finally caved and paid for GitHub Copilot. And like clockwork, a few weeks into hitting 'tab' instead of typing, the thought crept in that I think crosses every developer's mind eventually:
"What if I just built my own?"
A model trained on your codebase, your patterns, your weird utility libraries, that you own outright and never pay a monthly fee for again. No rate limits, no '2000 free completions', no handing your credit card to yet another chatbot.
So I went down the rabbit hole and actually priced it out. And what I found is that the answer to "how much does it cost to build a custom coding model" is basically two completely different numbers depending on what you actually mean. One of them will make your eyes water. The other is shockingly cheap.
Let me break both down.
First, What Do You Even Mean by "Build"?
This is where most people trip up, so let's get it straight before we talk dollars.
There are two very different things hiding under the phrase "build a coding model":
Training from scratch — You start with random numbers and feed the thing trillions of tokens of code until it learns to program. This is what OpenAI and Anthropic do. This is the eye-watering number.
Fine-tuning an existing open model — You grab something that already knows how to code (like one of the open-weight models floating around now) and you nudge it toward your specific style, stack, or domain. This is the cheap one.
99% of you reading this want option 2. But let's look at option 1 first, because the numbers are genuinely fun to look at.
Option 1: Training From Scratch
If you want to train a real, frontier-level coding model that competes with what Copilot is serving you today, here's the reality: you can't. Not as an individual, and probably not as a startup either.
GPT-4 reportedly cost somewhere between $78 million and $100 million just to train. And that's the old number. Anthropic's CEO has thrown out figures of $100 million to $1 billion for current frontier models, with projections that the next generation creeps toward the $10 billion mark.
That's not a typo. Billion. With a B.
But okay, you're not trying to beat Claude. You just want a model. So let's scale way down to something you could theoretically train yourself:
- A 7-billion parameter model from scratch runs roughly $60K to $1.2M in raw GPU compute alone.
- A 70-billion parameter model runs $750K to $12M in compute.
And "compute alone" is doing a lot of heavy lifting in those sentences, because compute isn't even the part that bankrupts you. More on that in a second.
The hardware itself? A single NVIDIA H100 (the GPU everyone wants) runs about $25K to $40K to buy, plus another $5K to $50K per card once you factor in power, cooling, and networking. And you don't need one. A serious training run wants dozens to thousands of them running for weeks.
Renting is saner at $2 to $4 per GPU-hour, but a 70B-class run still means hundreds of H100s spinning for weeks, which is how you land in the low millions on the cloud bill.
To put a real-world sticker on it: one widely-cited estimate pegged training a single mid-size model at around $52 million in H100 time. Even the scrappy efficiency stories, like the founder of 01.ai claiming a GPT-4-class model for "only" $3 million and 2,000 GPUs, are still, you know, three million dollars and two thousand GPUs.
So unless you've got a venture round burning a hole in your pocket, scratch training is off the table. Moving on.
The Hidden Cost Nobody Warns You About
Here's the part I didn't expect, and it's the most important takeaway in this whole post.
Compute is not the biggest cost. Data preparation is.
Across most real custom-model projects, cleaning, structuring, and preparing the training data eats up 30 to 50% of the entire budget. You can't just dump your repos into a model and hit go. Someone has to curate it, clean it, deduplicate it, format it, and make sure you're not teaching the thing all your worst habits.
And then there's the other hidden cost: people. The post-training and alignment work on a model like Llama 3.1 reportedly took 200+ people and over $50 million. One analysis found that the human-labor side of refining a model can cost 167 times more than the raw compute for the same step.
Translation: the GPUs are almost the cheap part once you're operating at any real scale. It's the humans and the data janitorial work that drain the account.
This is exactly like writing software, honestly. The compiler is free. It's the 20 years of figuring out what to actually build that costs you.
Option 2: Fine-Tuning (Where It Gets Actually Reasonable)
Alright, here's the good news, and the option you actually care about.
If you take an open-weight model that already knows how to code and just fine-tune it on your own code and style, the raw compute cost is almost laughably small:
- Fine-tuning a 7B model costs roughly $45 to $720 in GPU time and runs in anywhere from a few hours to a couple days.
- Fine-tuning a 70B model with an efficient technique like LoRA runs about $180 in raw GPU cost, one example clocked in at ~15 hours on 4 H100s.
Yeah. You read that right. The compute to fine-tune a 70-billion parameter model can cost less than a nice dinner out.
People have done genuinely impressive things on hobbyist budgets. Andrej Karpathy's "nanochat" project trained a small working model for about $100 of GPU time (a bigger version for ~$800).
One blogger trained a GPT-2-small-sized base model on a single RTX 3090 gaming GPU in his house over about 48 hours. Base models aren't just for the big labs anymore.
So if compute is this cheap, why isn't everyone running around with custom models?
So Why Doesn't Everyone Just Do It?
Because "the GPU bill was $180" is not the same as "the project cost $180." Not even close.
When companies actually fine-tune a model end-to-end for production use, including the data prep, the engineering hours, the evaluation, and getting it deployed, the all-in number lands somewhere around $150,000 to $750,000. The compute was a rounding error. The people were the budget.
And even at the solo/hobbyist level where you're not paying yourself a salary, the real cost is your time:
- Wrangling and cleaning your training data (the 30-50% tax, remember).
- Actually knowing what you're doing with training scripts, hyperparameters, and eval.
- Burning runs on dead ends while you figure out what works.
- Hosting the thing afterward — a 70B model needs 200GB+ of memory just to serve, which is its own ongoing cost.
That last one is the kicker people forget. "Open source is free" is one of the most expensive sentences in tech. Free to download, sure. Free to run? Not even a little.
The Honest Math
Let's lay out the math:
| What you're actually doing |
Realistic all-in cost |
Worth it? |
| Train a frontier coding model from scratch |
$100M – $1B+ |
No. You are not OpenAI. |
| Train a small (7B–70B) model from scratch |
$60K – $12M+ |
Only if you have a very specific reason and a budget to match |
| Fine-tune an open model (raw compute) |
$45 – $720 |
Fun weekend project |
| Fine-tune an open model (real production, all-in) |
$150K – $750K |
Maybe, if you have a real business case |
| Just pay for Copilot / an API |
~$10–20 a month |
For most of us... yeah |
Is It Worth Building Your Own? (My Take)
Here's where I land after 20+ years of doing this and watching the costs come down.
If you're a solo developer or a small shop and your goal is "better code completions," building your own model is almost never worth it. Not because it's impossible, fine-tuning is genuinely accessible now, but because the $20-a-month subscription is competing against hundreds of thousands of dollars and weeks of your life, and it's winning that fight by a mile. I went through this exact math in my head when I paid for Copilot, and it's not close.
Where it starts to make sense is when you have something the big models genuinely can't give you: a massive proprietary codebase, strict data rules that mean nothing can leave your building, a niche domain where the general models fall flat, or a real business reason to own the weights outright.
If that's you, fine-tuning an open model is the move, not scratch training. Scratch training is for people with a war chest and a death wish.
For everyone else? The same conclusion I came to with Copilot applies here. Instead of waiting around to build the 'perfect custom model,' the thing already on the menu for twenty bucks a month is good enough to give you back hours of your life. And your weekend GPU bill stays at zero.
Build the cool stuff with the model. Let someone else eat the $100 million.