Should the Model Be Built In-House or API-Invoked? — Four Criteria, One Cost Inflection Line, and Three Ways to Miscalculate

By: QTank Published: 11/18/2026 Views: 112
Current rating: ★★★☆☆ Rate this Equivalent to 8 ratings

The question of whether to build a model in-house is often asked incorrectly by most companies. They ask, "Is our data sensitive?" The correct question is, "Can all four criteria be met simultaneously?" Data sensitivity is just the first criterion and is often the easiest to overestimate.

A real failure looks like this: A company opts for a private deployment because "data cannot be transmitted outside," buys two eight-card machines, and finds that the model's performance is one level lower than that of a public cloud API. The business department uses it for a quarter and then switches back to the web version. The machines in the server room continue to depreciate, and no one dares to propose shutting them down the following year—because shutting them down would mean admitting that the initial judgment was wrong.

Building in-house is only worth it if all four criteria are met: there are written compliance constraints, the load is stable enough to amortize fixed costs, there is someone to handle 7×24 inference operations, and the business can accept the model being 6 to 12 months behind the mainstream. By this standard, most companies fall on the side of "should not build in-house." The remaining companies need something in between the two extremes.

1. "Private Deployment" Actually Has Three Tiers, with a Fivefold Price Difference

Tier Data Boundary Initial Investment Unit Cost with Volume Version Freshness Maintenance Responsibility Suitable for
A Public Cloud API Data leaves the company network and enters the vendor's Almost zero Linear, pay as you go Latest, vendor rolling upgrades Vendor The default starting point for most scenarios
B Dedicated Instance / VPC-Hosted Data does not leave the company network boundary, logically isolated Annual fee, starting from six figures Stepped decrease Lagging 1 to 2 quarters Vendor (company manages gateway and permissions) Compliance requirements, average load
C Fully In-House (weights on-premises, self-maintained) Completely within the domain Hardware + server room + manpower, starting from seven figures Decoupled from usage volume Lagging mainstream by 6 to 12 months Company itself Contractual hard constraints + existing team

The difference between the three tiers is not in "security levels," but in responsibility boundaries. Moving from A to B buys isolation, and moving from B to C buys control—control comes with the price of maintenance responsibility and version lag.

The most common mistake: Verbally stating the need for "private deployment," but actually requiring B (data stays within the network, model maintained by the vendor), while budgeting for C. Once the budget table is out, the cost quintuples, and the project is shelved. Or, if they push through with C, they find the performance is worse than A, and the team dares not mention AI for the next two to three years.

The judgment method is simple: Ask three questions: Can the data enter the vendor's VPC? Do we need to evaluate model upgrades ourselves? Who will get up if the inference service goes down at midnight? If all three answers are "the company itself," then it's Tier C.

2. Cost Inflection Point: A Line You Can Calculate Yourself

If the in-house costs are not clearly calculated, the discussion will remain stuck on positions. The algorithm is simple:

  • Annualized in-house cost = Hardware depreciation + Server room electricity + Maintenance manpower + Adaptation and evaluation manpower
  • Annualized API cost = Annual token volume × Average unit price × (1 + Retry and redundancy factor)

Lay out the magnitudes (the table below is an example and must be replaced with your own quotes):

Cost Item Assumption Annualized
1 Eight-card inference machine Purchase cost 800,000, 3-year depreciation 267,000
Electricity and rack space Whole machine 4-6 kW running continuously 30,000-50,000
Maintenance (including on-call) 1.5 people, 400,000 per person per year 600,000
Adaptation and evaluation 0.5 person + evaluation set maintenance 200,000
**Total Approx. 1,100,000**

Compare with the API side: At a common scale of 8 yuan per million tokens (mixed input and output), an annual consumption of 1 billion tokens is about 8,000 yuan. The difference is two orders of magnitude, not just a little.

To break even at 1.1 million, the annual consumption needs to be at the 130 billion token level, which translates to an average of 300 to 400 million tokens per day. This number is the inflection point, but it also hits the second constraint: a single eight-card machine can handle approximately a few thousand tokens per second on a 30B model, minus idle time and redundancy, it can run about 100 million tokens per day. Therefore, an average of 300 to 400 million tokens per day requires three to four machines, and the fixed costs will triple or quadruple, moving the inflection point further to the right.

The conclusion is harsh: Relying solely on cost savings, building in-house is almost impossible to justify. The only valid reasons for building in-house are written compliance constraints or if the inference capability itself is a competitive advantage. Cost is never the reason; it is just the last thing used as a reason.

3. Four Criteria, Fail One and Don't Build In-House

Criterion Passing Line (all must be met) Counterexample
Written Compliance Constraints Specific clauses can be pointed out: contract attachments, customer audit requirements, industry regulatory texts; and there is a list of fields that "must remain within the domain" "Leaders feel data is not safe outside" — this is a preference, not a constraint
Load Stability Average daily token consumption is stable over three consecutive months, peak/average < 3, and there is a certain growth in the next 12 months Project-based, seasonal, tenfold monthly fluctuations — fixed costs cannot be amortized
Maintenance Capability At least one dedicated inference maintenance person, with on-call mechanisms, experience in handling memory and driver issues, and model rollback procedures IT has only two people managing the entire company's network and ERP
Version Tolerance Tasks are stable, such as classification, extraction, and fixed format conversion, and do not rely on the latest inference or multimodal capabilities Relying on long context inference or the multimodal capabilities of new models to support business

If all four criteria are met, building in-house is rational. If one is missing, the cost column will spiral out of control; if two are missing, the result will be unusable within three months.

There is one implicit criterion worth mentioning separately: The economic viability of in-house deployment usually comes from "you already have it," not from "you are building it now." Companies that already have a GPU cluster, an algorithm team, and an evaluation system have a marginal cost close to zero for in-house deployment, making this path rational for them. Companies starting from scratch are not buying a model but a whole new set of capabilities—maintenance costs for these capabilities will persist and will not disappear with the completion of a project.

4. Data is Sensitive but Can't Be Built In-House, Follow These Three Intermediate Paths

The real situation for most companies is "compliance requirements + no load + no team." These three paths are much more cost-effective than forcing Tier C:

  1. Go for Tier B, not Tier C. Keep the data in your VPC and let the vendor handle the model's maintenance and upgrades. Compliance can pass audits, and maintenance responsibility does not fall on you. The cost is a slightly lagging version, usually one to two quarters, which is generally imperceptible in business operations.
  2. Hybrid Split: Sensitive tasks use local small models, non-sensitive tasks use API. The criterion is whether the input of a task contains "customer identity, contract amount, formula parameters." If it does, use the local model; if not, use the API. Most business token consumption is concentrated in the non-sensitive half, keeping costs under control and maintaining compliance.
  3. Desensitization Gateway Before Data Leaves the Domain. Replace entities (names, customer names, amounts, material numbers) before sending to the API. Understand what it can and cannot block: it can block direct identifiers but not context-based inferences—a detailed business description can still be recognized even without names. Desensitization reduces risk but does not eliminate it; contract clauses and permission controls remain the primary defenses.

5. Three Ways to Miscalculate

  1. Only Counting the Servers, Not the People. Hardware is a one-time expense, while manpower and evaluation are recurring annual costs. Of the 1.1 million, 800,000 is manpower. Only counting hardware will inevitably lead to a miscalculation.
  2. Calculating API Costs at Full Load. Actual utilization is often only 30%, and treating peak usage as the norm overestimates API costs by three times, leading to the conclusion that "in-house is cheaper."
  3. Ignoring Iteration Costs. After building in-house, each model upgrade requires re-running the evaluation set, re-adapting the prompt, and re-pressing tests. This cost is not on the budget sheet, but it will come every year. Companies without an evaluation set are gambling with upgrades, and the result is often "sticking with the old model"—which is precisely what in-house deployment aims to avoid.

One Sentence to Implement

First, clarify whether you need isolation or control by asking about the three tiers, then score using the four criteria. If all four criteria are not met, go for Tier B plus a desensitization gateway, and use the saved money on data governance and evaluation sets—these two things are useful regardless of the path chosen and will not become obsolete with a model change.

Knowledge code: 16.3.8
Version: v20261118
Author: QTank