Book a free call

Foundation Model Best Practices: Pick, Test and Ship Safely

Pick a foundation model for one job, test it on your own cases and ship it with guardrails. These practices cover selection, testing, cost and monitoring.

Hertiv engineering teamReviewed by a senior engineer
8 min read
Foundation Model Best Practices: Pick, Test and Ship Safely
On this page

Short answer

Foundation model best practices start with picking a model for one job, testing it on your own cases before it ships, and running it with guardrails, cost limits and monitoring. Test on real examples from your own work, not on the vendor's demo. Measure accuracy, cost and speed together, keep a human check on risky outputs, and log what the model does so problems can be traced.

What are foundation model best practices?

Foundation model best practices are the habits that keep a large pre-trained model reliable, affordable and safe when it is used in a real product. A foundation model is trained on broad data and can handle many tasks, but that breadth is also the risk: it will answer confidently on topics it knows poorly, and it will cost more than a smaller model if it is used for every request.

The practices below cover the full life of a model in production, from picking one to watching it after launch. They are not about the training itself, which most teams leave to the model provider, but about everything around it: the job you give it, the data you feed it, the checks you put on its output, and the way you measure whether it is still working.

PracticeWhat it meansWhat it prevents
One job per modelGive the model a narrow, named taskWeak answers on edge cases
Test on your own casesBuild an evaluation set from real workSurprises after launch
Guardrails on outputCheck, filter or route risky answersWrong or unsafe output reaching users
Cost and speed limitsSet budgets per request and per dayRunaway bills and slow responses
Logging and reviewRecord prompts, outputs and decisionsProblems you cannot trace or fix

Teams that skip these steps usually learn the same lesson twice: first in a demo that looks impressive, then in production when the model meets real data.

How do you pick the right foundation model?

Pick a foundation model by testing two or three candidates on your own cases, not by comparing marketing claims. Start by writing down the job in one sentence: what goes in, what should come out, and how you will know a good answer from a bad one. Then gather 50 to 100 real examples from your own work, with the correct answers attached.

Run each candidate on that set and score the results by hand or with a simple checklist. Look at accuracy, but also at cost per request, response time and how the model handles inputs it has never seen. A model that is slightly less accurate but twice as fast and a tenth of the price is often the better choice for a high-volume job.

Check the practical details too: data residency, whether your prompts are used for training, rate limits, and what happens when the provider changes the model version. A model that changes under you without warning can break a workflow that was working. For the basics of what these models are, see what a foundation model is.

How do you test a foundation model before shipping?

Test a foundation model on a fixed set of your own cases before it ships, and keep that set fixed so results stay comparable over time. The set should include the easy cases, the hard cases and the cases where a wrong answer would cost you: the ambiguous requests, the unusual formats and the inputs that look like one thing but mean another.

Score each case as pass or fail against a written rule, not by gut feeling. Two people should agree on most scores; if they do not, the rule needs rewriting. Record the failure rate by category, because a model that fails on one type of case needs a different fix from one that fails a little on everything.

Test the failure paths as well as the happy path. Feed the model empty inputs, very long inputs, inputs in the wrong language and inputs that ask for something it must refuse. A model that handles these gracefully is ready for real users; one that invents an answer for every input is not.

How do you control cost and latency?

Control cost and latency by matching the model to the job and by caching, routing and limiting requests. The largest model is rarely the right default: use a smaller, cheaper model for routine requests and reserve the large model for the cases that need it. A simple router that sends easy questions to the small model and hard ones to the large model can cut costs sharply without hurting quality.

Cache repeated answers where the input repeats, such as common questions or standard document summaries. Set a maximum output length so a runaway response cannot burn through a budget, and set daily spending limits with an alert before the limit is reached, not after.

Measure cost per completed task, not cost per request. A cheap model that needs three retries costs more than a pricier model that answers correctly the first time. For the money side in more detail, see foundation model cost.

How do you keep data and prompts safe?

Keep data and prompts safe by deciding what the model may see and by checking what it sends back. Never send customer secrets, passwords or full personal records in a prompt unless the provider contract and your own policy allow it. Strip or mask sensitive fields before the prompt is built, and keep the original data in your own system.

Check the provider's terms on training: whether your prompts and outputs are used to train future models, how long they are stored, and in which region. If the terms do not fit, use a provider or deployment that keeps your data out of training, or run the model in your own environment.

Put checks on the output as well. Filter for disallowed content, check that numbers and names in the answer match the source data, and route anything the checks cannot verify to a person. For the security side, AI security covers the controls that matter for LLM applications.

How do you run a foundation model in production?

You run a foundation model in production by treating it like a service with owners, limits and a fallback, not like a one-off experiment. The steps below are the minimum for a system that real users depend on.

  1. Name an owner. One person is responsible for the model, its evaluation set and its incident response.
  2. Version everything. Record the model version, the prompt version and the settings used for every release, so a bad change can be rolled back.
  3. Monitor live traffic. Sample real requests each week and score them against the same rules used before launch.
  4. Set a fallback. Decide what happens when the model fails or the provider is down: a cached answer, a simpler model or a human queue.
  5. Review costs weekly. Track spend per task and investigate any sudden rise before it becomes a bill.

Keep the evaluation set running on a schedule, not just at launch. Models change, data changes and user behaviour changes, and a weekly check catches drift while it is still small. For the build steps that lead here, see how to implement a foundation model.

Example (hypothetical): a support team ships a foundation model

Example (hypothetical): a support team handles 400 tickets a day. Today an agent spends about 6 minutes drafting each reply, which is 400 x 6 = 2,400 minutes, or 40 hours a day across the team. The team decides to use a foundation model to draft replies, with an agent checking every draft before it is sent.

They build an evaluation set of 100 real tickets with known good answers, test two models on it, and pick the cheaper one: it drafts 320 of the 400 replies well enough to send after a quick check, and 80 need rewriting.

Checking a draft takes 2 minutes, so the daily work becomes 400 x 2 = 800 minutes, or about 13 hours, plus the 80 rewrites at 6 minutes each, which is another 8 hours. The total is about 21 hours against 40 before, saving roughly 19 hours a day.

After a month they tune the prompt with the cases that failed, and the share of drafts sent after a quick check rises from 320 to 360 of 400. The lesson is not that the model replaced the agents, but that a tested model with a human check turned drafting time into review time, and the evaluation set showed exactly where the next improvement would come from.

What are the common mistakes?

The most common foundation model mistakes are picking the biggest model by default, testing on the vendor's demo instead of your own cases, and shipping without guardrails or monitoring.

  • Biggest model by default. The largest model is the most expensive and the slowest. Test smaller models first; many jobs do not need the largest one.
  • Testing on demo cases. A vendor demo shows the model at its best. Your own cases, including the awkward ones, are the only honest test.
  • No output checks. A model that invents a price, a date or a policy will do so confidently. Check outputs against source data before they reach users.
  • Sending sensitive data in prompts. Customer records and secrets in prompts become a data-handling problem. Mask or strip them first.
  • No versioning. When the provider updates the model and quality drops, you need to know what changed and roll back.
  • Measuring usage instead of outcomes. Thousands of requests tell you nothing. Measure accuracy, cost per task and error rate.

Start small: one job, one evaluation set, one owner. The practices that work on a single workflow are the ones you repeat when the next workflow arrives.

Key takeaways

  • Pick the model by testing candidates on your own cases, not on marketing claims
  • A fixed evaluation set with written pass rules is the only honest test before launch
  • Route easy requests to a smaller model and reserve the large one for hard cases
  • Mask sensitive data before it reaches the prompt and check outputs before they reach users
  • Version the model and prompt, monitor live traffic weekly and keep a fallback ready

Frequently asked questions

What is the first step when using a foundation model?

Write down the job in one sentence, then gather 50 to 100 real examples with correct answers. Test two or three candidate models on that set before choosing one, and score accuracy, cost and speed together.

How many test cases do I need before shipping?

Fifty to one hundred real cases is a workable start, including easy cases, hard cases and cases where a wrong answer would be costly. Keep the set fixed so results stay comparable as you change prompts or models.

Should I always use the largest foundation model?

No. Test smaller models first on your own cases. Many jobs are handled well by a smaller, cheaper model, and routing easy requests to it while reserving the large model for hard cases cuts cost without hurting quality.

How do I stop a foundation model from inventing facts?

Ground its answers in your own documents, check numbers and names against source data before the answer reaches users, and route uncertain cases to a person. No prompt setting removes invention entirely, so checks matter more than tuning.

What should I monitor after launch?

Sample real requests each week and score them with the same rules used before launch. Track accuracy by category, cost per completed task, response time and the share of outputs that needed a human fix.

Can I send customer data to a foundation model?

Only if the provider contract and your own policy allow it. Check whether prompts are used for training, how long they are stored and in which region, and mask sensitive fields before the prompt is built.

Found this useful? Share it.
Hertiv engineering team

Written from projects we build for clients: AI and agent systems in production. Every post is reviewed by a senior engineer before publishing and updated when practice changes.

About HertivHow we work

Planning to ship a foundation model in your product? Talk to Hertiv.

A senior engineer replies within one business day. Or see our AI Product Development service.

Book a free call

Keep reading

All posts

Tell us what you want to build

A senior engineer reads every request and replies within one business day with questions, a rough range, or a call link.

  • NDA on request before any details
  • You own all code, models and IP
  • US, UK and EU time-zone overlap

Your email app should open with your message ready to send. If it does not, write to contact@hertiv.com.

Prefer email? Write to contact@hertiv.com
Estimate costBook a call