Adding a trained model to your SaaS product
AI for SaaS: move one high-volume AI feature off a frontier API onto a trained model you test on your own data and run in your own cloud account.
Updated
Adding a trained model to your SaaS product means moving one high-volume AI feature off a frontier API and onto a model that you test, own and host. You pick a task your product already runs thousands of times a day, train a model for that task, and ship it only after it beats your current model on a test built from your own data.
Pick the feature to move first
Start with the AI call that runs most often and has an answer you can check. In SaaS products that usually means one of these:
- Pulling fields out of uploaded documents, such as invoice totals, due dates and vendor names, into the schema your billing code expects.
- Tagging support tickets by product area, urgency and account tier, so each one reaches the right queue.
- Turning free-text intake forms into fixed fields for a CRM or project tool.
- Sorting inbound emails or webhooks before they reach a workflow.
A general chat assistant is a poor first choice, because nobody can score an open-ended answer against one right answer. A feature that drafts marketing copy is hard to test for the same reason.
Check the invoices and the code together. The invoice shows which model you pay for. The code shows which calls run in loops, which run on every page load, and which retry on failure. A retry loop that calls the model three times for every timeout can cost more than the feature it serves. The AI cost audit guide lists what a code review usually turns up.
What a trained model learns
A trained model learns one job from examples of that job. Take a contract-intake feature that reads each uploaded agreement and fills in the renewal date, notice period, governing law and auto-renew flag. A general model needs a long prompt that explains the fields, the date formats, and what to do when a clause is missing. A trained model has seen many agreements with those fields filled in correctly, so the prompt can shrink to the document itself.
On one public contract-clause test, our trained model scored 0.717 to Claude Opus’s 0.635, which is one task and not a promise about your feature. Full results.
Build the test from your own data
The rule we use is simple: the trained model must beat your current model on your test before it goes live. Build the test in this order.
- Pull real inputs from the last few months of production, and sample across customers, not just your largest account.
- Have the people who already do this work label the correct output for each input. Two labelers on the same sample will show you where the task is ambiguous before you train anything.
- Split by customer account or source document, so near-identical items do not land in both training and test.
- Score your current model first and save the numbers. Keep the split fixed, because a changed split makes old results incomparable.
- Test the output format as well as the answer. If your code parses JSON, a model that is right most of the time but breaks the parser on some inputs will still break your feature. Count parse failures as failures and log the inputs that caused them.
The mistakes that show up most often are building the test from clean demo inputs, scoring on inputs the model saw in training, and checking only the average when one customer segment is failing. Another is letting one person write all the labels, which bakes in that person’s reading of the rules.
Where the model runs and what you give up
A model does not have to live on a vendor’s servers. Own Weights serves the trained model in your cloud account or on-prem, so traffic, logs and access rules stay under your own controls. You own the weights, which means a price change or a retired model at one vendor does not force a rewrite of the feature.
There are trade-offs. Your team now owns a model in production. Someone has to watch its scores after each release, handle a new output format when the product changes, and retrain when incoming documents drift. A frontier API hides all of that behind a vendor. Decide who owns it before you ship.
Compare cost per document, not cost per token. Take one customer action, count every model call it triggers including retries, and add the human review step if there is one. That total, multiplied by your real monthly volume, is the number to put in front of whoever approves the change.
Roll out in steps
Roll out behind a feature flag. Start in shadow mode, where the trained model runs on real traffic but its output is only logged, so you can see where it disagrees with the current model before any customer does. Then send a small share of production calls to it, and widen that share only while the numbers hold.
Some teams route by difficulty. The trained model handles the common cases, and any call that fails a format check or looks uncertain goes back to the current API. Keep the old API path in the code until the new one has run on real traffic long enough that you trust it. Removing the old path is the last step, not the first.
Stay within your own controls
If your product touches regulated work such as legal, medical, tax or financial documents, the model assists the people who review its output. It is not legal, medical, tax or financial advice. Running the model in your own environment gives you control over where data goes. Your own policies and reviews still decide whether the feature is fit for that use.
Book a free audit with the button on this page, and we will map your AI calls and talk through which feature is worth moving first.
Questions
How do I add AI to a SaaS product without a large API bill?
Move the one AI call that runs most often onto a trained model, and keep the rest on your current API. Test the trained model against your current model on your own data before you switch. Compare cost per document, not cost per token, so you see what the feature really costs.
Can a trained model run in my own cloud account?
Yes. Own Weights serves the trained model in your cloud account or on-prem, and you own the weights. Traffic and logs stay under your own access controls.
What should I test before switching a feature to a trained model?
Build the test from real inputs your product has seen, label the correct outputs, and score your current model first. The trained model must beat it on that test before it goes live. Check the output format too, because a malformed response can break the feature even when the answer is right.