Most “agency vs in-house” articles stop at a pros-and-cons list. This one puts numbers on the in-house side using public US salary data, explains how agencies actually structure their pricing so you can compare like with like, and ends with the contract terms that decide whether outsourcing leaves you with a working capability or just a bill.
It covers one decision: whether to build your own machine learning team or hire an outside firm. If you have already decided to commission a custom build and want to know what the phases and deliverables look like, read our guide to custom AI development. If what you need is off-the-shelf AI software rather than a build, see how to choose an AI software vendor.
What a minimal in-house ML capability looks like
One ML engineer is rarely enough. A model that runs in production needs someone who can frame the problem and build the model, someone who can get data into shape and wire the model into your systems, and someone accountable for priorities and quality. In a small company those jobs collapse into two or three people:
- Data scientist / ML engineer. Explores data, selects and trains models, evaluates results.
- Data or software engineer with MLOps duties. Builds data pipelines, deploys the model, sets up monitoring and retraining.
- Technical lead or manager (often optional at first if an existing CTO can absorb it). Sets priorities, reviews work, owns the relationship with the business.
Product ownership, QA and security review are also needed, but most companies borrow them from existing staff for a first project.
Year-one cost of an in-house team, using BLS data
The figures below use median annual wages for May 2025 from the US Bureau of Labor Statistics Occupational Outlook Handbook. BLS does not publish a separate “machine learning engineer” category, so we map each role to its nearest BLS occupation.
To get from salary to what the employer actually pays, we use the BLS Employer Costs for Employee Compensation release. For private-industry workers in management, professional and related occupations in June 2026, wages and salaries made up 68.5% of total compensation and benefits the other 31.5%. Dividing a salary by 0.685 gives a rough fully loaded cost.
| Role | Nearest BLS occupation | Median wage (May 2025) | Approx. fully loaded (salary ÷ 0.685) |
|---|---|---|---|
| Data scientist / ML engineer | Data scientists | $120,230 | ~$176,000 |
| Data / MLOps engineer | Software developers | $135,980 | ~$199,000 |
| Technical lead / manager | Computer and information systems managers | $175,140 | ~$256,000 |
| Two-person team (no dedicated lead) | $256,210 | ~$374,000 | |
| Three-person team | $431,350 | ~$630,000 |
Read these as a floor, not a quote, for four reasons:
- Medians cover every experience level and every region. Experienced ML specialists in competitive markets earn well above them. Levels.fyi, which collects self-reported pay including bonus and equity, showed a US median total compensation of about $250,000 for ML/AI software engineers when we checked in October 2026.
- The 31.5% benefits share is an average across a broad occupational group. Your own benefits package may cost more or less.
- Salary is not the whole bill. Recruiting fees, laptops, software licenses, cloud compute for training and serving, and data-labeling costs all sit on top. Put your own numbers against each of these. They vary too much between companies to estimate here.
- Year one is not a full productive year. Every month spent recruiting and onboarding is a month with no output. Salaries also start before the first model ships.
Demand is not easing either. BLS projects data scientist employment to grow 35% from 2025 to 2035, against 3% for all occupations, so expect to compete for these hires.
How agencies price ML work
Agency rates vary too widely by region, seniority and specialty for a single number to be useful, so we won’t quote one. What you can compare is the pricing structure, because each one moves risk to a different side of the table.
| Structure | How it works | Who carries the risk | Fits when |
|---|---|---|---|
| Fixed scope / fixed price | An agreed price for defined deliverables, often split into milestones | Mostly the agency, which usually prices in a buffer for it | The data is known, the success metric is clear and the scope is unlikely to change |
| Time and materials | Billed per hour or day by role, against actual effort | Mostly you | The work is exploratory and the approach depends on what the data shows |
| Retainer / dedicated team | A recurring fee for reserved capacity or a named team | Shared. You pay for capacity whether or not you use it. | Ongoing improvement, monitoring and retraining after launch |
Many engagements combine these structures: a short paid discovery phase at a fixed fee, then a fixed or capped build, then a retainer for support. If you use time and materials, ask for a not-to-exceed ceiling and a burn report at every review.
To compare an agency with in-house, ask for a proposal priced by phase, then line it up against the in-house table above for the same scope and the same time frame. Also price what happens after launch. An agency quote that ends at deployment is not comparable with a salaried team that keeps maintaining the model.
The hybrid model: the agency builds, your owner learns
For many mid-sized companies the realistic answer is neither option on its own. An agency builds the first version while one internal person, often an existing engineer or analyst, works alongside it and takes over afterwards. That keeps the first-year cost closer to a project fee than to a full team, and still leaves you with someone who understands the system.
For this to work:
- Name the internal owner before kickoff, not at the end. Give them real time on the project, not a few hours on Fridays.
- Have the owner pair with the agency on real work: running training jobs, reviewing evaluation results, deploying to staging.
- Define “handed over” as something the owner can do unaided, for example retrain on new data, redeploy and roll back. Don’t define it as the date the agency stops invoicing.
- Keep a small support retainer for a period after handover, so the owner has a safety net while gaining confidence.
If the owner is not technical enough to retrain a model, the realistic outcome is an ongoing agency retainer. That is a legitimate choice, but budget for it rather than discover it later.
Decision matrix
| Your situation | Leaning | Why |
|---|---|---|
| ML is the product customers pay for | In-house | Continuous retraining and model IP are your competitive advantage, so you need accountable people on staff |
| First ML project; value not yet proven | Agency (fixed or capped) | You can cap your spend before committing to permanent headcount |
| Proven use case that needs ongoing tuning, but no full team yet | Hybrid | The agency builds while an internal owner learns to run the system |
| No technical leadership in-house | Agency or hybrid | ML hires without someone to manage them tend to stall |
| Common pattern (document extraction, forecasting, retrieval chatbot) | Agency | An experienced firm has likely built something similar before |
| Strict data residency or regulatory limits on third-party access | In-house, or an agency working only inside your environment | Data access terms can rule out some agency setups |
| Several ML initiatives planned over multiple years | Build the team, possibly starting hybrid | Fixed salaries spread across continuous work |
Whichever way you go, the most common failure has nothing to do with who writes the code. In interviews with 65 experienced data scientists and engineers, RAND researchers found that misunderstanding or miscommunicating the problem to be solved was the leading root cause of AI project failure. Write down the business problem and the success metric before you compare costs. If you are unsure whether the problem calls for machine learning at all, this explainer on AI, ML and deep learning is a useful starting point.
Handover clauses to insist on
If you outsource, the contract determines whether you can ever bring the work in-house. Ask your lawyer to check for each of these:
- IP assignment that names source code, trained model weights, training and evaluation scripts, prompts and configuration, not just “deliverables.”
- Your accounts from day one. Repositories, cloud projects, model registries and third-party API keys sit in accounts your company owns, with the agency added as users.
- Documentation as a paid, accepted deliverable: architecture overview, data sources and lineage, how to retrain and redeploy, known limitations, and monitoring runbooks.
- Reproducibility. Your team can rebuild the model from the delivered code and data, and the contract says so.
- Knowledge transfer schedule with named sessions, pairing time and a handover acceptance test that your internal owner performs.
- Data handling and return. What client data the agency may keep, and confirmation that copies are deleted at the end.
- Exit assistance. A defined period and rate for help after termination, so switching providers or moving in-house is not held hostage.
- Hiring terms. Check any non-solicitation clause. If you might want to hire someone who worked on your system, negotiate that now.
If a model will make or influence decisions about customers or staff, also agree who reviews its outputs after handover. Our post on human-in-the-loop AI covers how to design that review.
Comparing providers
If the numbers point toward an agency or a hybrid setup, you can compare firms by specialty in our AI/ML development provider directory. How we review providers explains how listings are assessed. Empirical Edge, which runs this site, is one of the listed firms.
Frequently Asked Questions
For a first project with a defined end point, usually yes, because you pay for the build and stop. Hiring commits you to salaries and benefits whether or not there is ML work to do. The comparison flips when the work is continuous and central to your product: a stable internal team running for several years can cost less per unit of output than repeatedly paying an outside firm to relearn your data.
It is salary plus everything the employer pays on top: health insurance, retirement contributions, paid leave, payroll taxes and similar benefits. The BLS employer-cost survey is a public way to estimate that share. On top of fully loaded pay, budget separately for recruiting, equipment, software licenses, cloud compute and the months before a new hire is productive.
Yes, and it is a common path, but it only works if the contract and the project are set up for it from day one. Code, models and infrastructure should live in accounts you own, documentation should be a paid deliverable, and a named internal person should work alongside the agency team long enough to retrain and redeploy the model without help.
There is no universally safe choice. Fixed-scope pricing caps your spend but needs a clear specification, which early ML work rarely has. Time-and-materials suits exploratory work but needs a budget ceiling and regular reviews. Many buyers split the difference: a short paid discovery phase first, then a fixed or capped price for the build once the data and approach are known.
Written by: AIML Marketplace Team