Skip to main content

You Don't Have to Train an AI Model to Build an AI Application

Understanding foundation models, the rise of AI engineering, and the new stack behind modern AI applications.

Updated 26 min readMarkdown

I used to associate building AI applications with training machine learning models. Collect the data, clean it, engineer features, choose an algorithm, train the model, evaluate it, deploy it. That is a familiar machine learning workflow, and it is still important, but something interesting has happened. Today, a developer can build an application that summarizes documents, answers questions, generates images, writes code, analyzes information or interacts with external tools without training a large AI model from scratch.

So, what changed? The answer takes us to one of the most important developments in modern AI: foundation models. I have been learning more about AI engineering, and one idea from the first chapter of AI Engineering really helped me understand the shift: building AI applications and building AI models are related, but they are not the same activity. You can build useful AI-powered software by taking an existing model and engineering an application around it. That sounds simple, but there is quite a lot happening underneath. Let's unpack it.

1. The shift: from building models to building with models

Before foundation models became widely accessible, building an AI-powered application often meant developing a model for a specific task. Imagine a company wants to detect fraudulent financial transactions. The traditional approach might look something like this collect transaction data, label transactions as fraudulent or legitimate, clean and prepare the dataset, select a machine learning algorithm, train the model, evaluate its performance, integrate the model into an application, monitor its predictions. The model is developed for a particular problem. A fraud detection model is not automatically a translation model. A sentiment analysis model is not automatically a recommendation system. Each task generally requires its own modelling approach, data and evaluation process, foundation models changed the starting point.

Instead of developing a separate model for every application, developers can access an existing, general-purpose model and adapt it to their needs. For example, the same foundation model could be used as part of a document summarization application, a customer support assistant, a code generation tool, a translation application, a question-answering system, an application that extracts information from documents. The model provides a general capability. The application engineer figures out how to turn that capability into something useful. This is the shift from primarily developing models to engineering applications on top of existing models. And that is the foundation of AI engineering.

2. First, what exactly is a language model?

Before understanding foundation models, it helps to understand where they came from, A language model is a model that learns statistical patterns in language. It estimates how likely a word or token is to appear in a particular context. For example, consider this sentence:

My favourite colour is _____.

A language model trained on English text would likely assign a higher probability to words such as blue, green or red than to an unrelated word such as airplane. It is learning patterns in language and using those patterns to make predictions.

What are tokens?

Language models do not necessarily process text as complete words. They process smaller units called tokens. A token can be a complete word, part of a word, a character, a punctuation mark or other text unit. The exact tokenization method depends on the model. For example, a word such as cooking might be split into cook and ing. The process of converting text into tokens is called tokenization. Why not simply use words?, there are several reasons:

  1. Efficiency: A token vocabulary can be smaller than a vocabulary containing every possible word.
  2. Meaningful components: Parts of words can carry useful information.
  3. Unknown words: A model can process an unfamiliar word by splitting it into familiar token pieces.

The chapter I was reading illustrates tokenization with the sentence “I can't wait to build AI applications.” Its example shows that even a familiar sentence is converted into a sequence of tokens before the model processes it. One important detail: a token is not always a word. This matters when working with model APIs because many models measure input and output limits in tokens rather than words.

Two types of language models

1. Masked language models: A masked language model predicts missing tokens using context from both before and after the missing position. For example:

My favourite _____ is blue.

The model uses the surrounding words to predict that the missing token might be colour. A well-known example is BERT. Masked language models have commonly been used for tasks such as text classification and sentiment analysis.

2. Autoregressive language models

An autoregressive language model predicts the next token using the tokens that came before it. For example:

My favourite colour is _____.

The model predicts what should come next based on the preceding context. It can then use that prediction as part of the context for predicting the following token. This allows it to generate text one token at a time.

A simplified view:

Input:
"My favourite colour is"

        ↓

Language model

        ↓

Predict next token:
"blue"

        ↓

Updated sequence:
"My favourite colour is blue"

        ↓

Predict the next token

This is the basic idea behind autoregressive text generation. The book used the term language model to refer to autoregressive language models unless stated otherwise.

Generative AI is a completion machine

Here is another idea I found useful. You can think of a language model as a completion machine. Give it some text, and it tries to continue that text. For example:

Prompt:
"To be or not to be"

Possible completion:
", that is the question."

This is a useful mental model because many seemingly different tasks can be expressed as text completion.

Translation:

Prompt:
"How are you in French is..."

Completion:
"Comment ça va."

Classification:

Prompt:
"Is this email spam?

Email: [email content]

Answer:"

Possible completion:

"Likely spam."

Summarization, translation, question answering and even code generation can all be framed as completion tasks. But there is an important catch: A model generates predictions based on probabilities. It does not guarantee that every generated answer is correct. That probabilistic behaviour is part of what makes generative AI powerful, but it is also why we need evaluation, verification and thoughtful application design.

3. How did language models become large?

This brings us to one very important concepts: self-supervision. Traditional supervised learning requires labelled examples, suppose I want to train a fraud detection model. I need transaction examples with labels such as:

Transaction Label
Transaction A Fraud
Transaction B Not fraud
Transaction C Fraud

The model learns from the relationship between the input data and the labels. The challenge is that creating labelled datasets can be expensive and time-consuming. For some tasks, obtaining reliable labels requires specialists. Think about medical images, legal documents or scientific data. Language models have an interesting advantage: text can provide its own training signals.

What is self-supervised learning?

In self-supervised learning, the model derives training targets from the input data itself instead of relying on manually assigned labels for every example. Consider this sentence:

I love street food.

An autoregressive language model can turn it into several training examples.

Input context Expected next token
Beginning of sequence I
I love
I love street
I love street food
I love street food .

The model learns to predict the next token from the preceding tokens. The sentence itself provides both the context and the expected prediction. That is the interesting part: a large amount of text can be converted into training examples without someone manually labelling every next token, this helps overcome one of the major bottlenecks in scaling language models: the cost of manually labelled data.

Self-supervised is not the same as unsupervised

These terms are easy to mix up.

  • Supervised learning: Uses labelled examples.
  • Self-supervised learning: Generates training targets from the input data.
  • Unsupervised learning: Learns patterns from data without requiring labelled targets.

The distinction matters because self-supervised learning still has a learning signal. The difference is where that signal comes from.

What are parameters?

You will often hear people compare models using their number of parameters. A parameter is a value inside a model that is updated during training. Parameters are part of what allows a model to learn patterns and represent relationships in data. I learnt that larger models generally have greater capacity to learn behaviours, although more parameters do not automatically guarantee better performance. Larger models also need enough training data and computational resources to make effective use of that capacity. This is one reason training large foundation models is so expensive.

4. From large language models to foundation models

Language models are powerful, but language is only one way humans interact with the world. We communicate through text, but we also use images, audio and video. A model that only processes text cannot directly handle every kind of information we encounter. This is where multimodal models come in. A multimodal model can work with more than one type of data, or modality. Examples include text and images, text and audio, images and video, other supported combinations of data. Imagine giving an AI model a photograph and asking:

What is happening in this picture?

A multimodal model can use visual information alongside the text in your question to produce an answer. The model is no longer working with text alone. You might be wondering why the word foundation? That is because these models provide a general-purpose base that developers can build different applications on top of.

General-purpose versus task-specific models

This is one of the biggest differences between traditional machine learning applications and applications built with foundation models. A traditional task-specific model might be trained to classify customer feedback as positive or negative while a foundation model may already be capable of sentiment analysis, translation, summarization and question answering. It can support different tasks without requiring a completely separate model for each one.

However, general-purpose does not mean perfect. An existing model might produce a reasonable product description but fail to match a company's brand voice. It might summarize a document but omit an important detail, It might answer a question confidently while getting the answer wrong. The model gives us a starting point. We still need to adapt it to the application.

5. The three ways to adapt a foundation model

The three common AI engineering techniques: prompt engineering, retrieval-augmented generation (RAG), fine-tuning. Let's use one example to understand all three. Imagine a retailer wants an AI application that generates product descriptions for its online store. A general-purpose model can already write descriptions. But the retailer wants descriptions that reflect its brand voice, product information and messaging. How can we adapt the model?

Approach 1: Prompt engineering

Prompt engineering means designing the instructions and context given to a model to influence the output it produces. Instead of changing the model itself, we change what we ask it to do. For example:

You are a product copywriter for a fashion retailer.

Write a product description using the
following information:

Product: Linen summer dress
Colour: Beige
Material: 100% linen

Requirements:
- Use a friendly, elegant tone.
- Keep the description under 100 words.
- Highlight comfort and breathability.
- Avoid exaggerated marketing claims.

The model receives instructions and generates a description based on them. Prompt engineering is usually the easiest place to begin because it does not require changing the model's weights or preparing a fine-tuning dataset. It is also useful for experimenting with different models and instructions. However, prompts alone might not be enough for applications with complex requirements or strict performance expectations.

Approach 2: Retrieval-augmented generation (RAG)

What if the model needs information that is not included in its existing knowledge? For example, the retailer has a product catalogue, customer reviews, brand guidelines and product specifications. Instead of expecting the model to know all this information, we can retrieve relevant information from an external data source and provide it as context. This is called retrieval-augmented generation, or RAG.

A simplified workflow looks like this:

User request
    |
    v
Search relevant information
    |
    v
Retrieve product details
and customer reviews
    |
    v
Add retrieved information
to the prompt
    |
    v
Foundation model
    |
    v
Generated product description

The important idea is that the model is given additional information at the time of the request, we are not necessarily changing the model's internal weights. RAG is useful when an application needs to work with external, domain-specific or frequently updated information.

Approach 3: Fine-tuning

Sometimes, instructions and retrieved information are not enough. A developer might want to change the model's behaviour more directly, this is where fine-tuning comes in. Fine-tuning means continuing to train an already trained model using additional data. For the retailer, this could involve training the model on examples of high-quality product descriptions that reflect the desired writing style. Unlike prompt engineering and ordinary RAG, fine-tuning updates the model's weights. It is generally more involved and requires suitable training data and computational resources.

Comparing the three approaches

Technique What changes? Useful when
Prompt engineering Instructions and context You need to guide model behaviour
RAG Information supplied to the model You need external or changing information
Fine-tuning Model weights You need to adapt model behaviour through additional training

A useful way to remember this:

  • Prompt engineering tells the model what to do.
  • RAG gives the model information to work with.
  • Fine-tuning changes the model itself.

These approaches are not necessarily mutually exclusive. An application can combine them. And importantly, you do not automatically need fine-tuning every time you build an AI application. It is often sensible to start with simpler adaptation techniques and evaluate whether they are sufficient.

6. What can we actually build with foundation models?

This is where it became especially interesting, foundation models are general-purpose, which means they can support a wide range of applications. The book grouped common generative AI applications into eight categories.

1. Coding

AI can assist with software development tasks such as code completion, generating code from natural-language instructions, translating between programming languages, writing documentation, generating tests, explaining existing code, extracting structured information from web pages and documents. Tools such as coding assistants demonstrate how foundation models can become part of a developer's everyday workflow. But assistance is not the same as complete automation. Complex engineering work still requires understanding requirements, architecture, testing, security and the consequences of implementation decisions.

2. Image and video production

Foundation models can help generate or edit visual content. Applications include image generation, photo editing, video generation, presentation creation, design assistance, visual concept exploration. This is one of the areas where the creative possibilities of generative AI become particularly visible.

3. Writing

AI can help with both personal and professional writing. Examples include emails, blog posts, social media content, marketing copy, reports, memos, technical documentation. The important engineering challenge is making the output suitable for its intended audience and purpose, rather than simply generating text.

4. Education

Foundation models can support learning through personalised tutoring, explaining difficult concepts, practice questions, feedback on assignments, employee onboarding, training materials. A tutoring application, for example, could explain the same concept at different levels depending on a learner's understanding.

5. Conversational bots

Conversational applications allow users to interact with AI through natural language. Examples include general-purpose chatbots, customer support assistants, product copilots, voice assistants, digital characters. For businesses, customer support is an obvious application. A chatbot can help users find information and resolve common questions without waiting for a human agent. However, customer-facing applications also introduce risks. Incorrect answers, privacy concerns and poor handling of sensitive requests can affect real users.

6. Information aggregation

We produce more information than we can realistically read and process. Foundation models can help summarise and organise information from emails, meeting notes, research papers, reports, websites, documents news and other sources. A practical example is an application that takes meeting notes and extracts three things the key facts, open questions and action items. This turns a large amount of unstructured information into something easier to act on.

7. Data organisation

A lot of useful information is stored in unstructured formats: PDFs, images, videos, scanned documents and text. AI can help make this information searchable and organised. For example, an application could extract names, dates, contact information, invoice details, information from contracts, information from reports. This is especially interesting because it connects AI engineering with data engineering. Before information can be searched, analysed or used by another system, it often needs to be extracted and structured.

8. Workflow automation

This category is about using AI to help complete tasks, not just generate answers. Examples include planning trips filling out forms, managing customer requests, processing invoices, entering data, managing leads, handling reimbursements. Some workflows require an AI system to interact with external tools. For example, an application that helps someone book a restaurant might need to search for restaurants, check availability and interact with a booking service. This brings us to another important concept: AI agents. An AI agent is an AI system that can plan and use tools to accomplish tasks. A chatbot might tell you how to book a restaurant. An agent-enabled application could potentially carry out parts of the booking process using the tools and permissions available to it. That is a meaningful difference: answering a question and taking an action are not the same thing.

7. Not every AI application should be built

This was one of the most practical lessons I found. It is easy to become excited about a model's capabilities and immediately start building. But a working demo is not necessarily a useful product. An application can generate impressive outputs and still fail to solve a real problem. Before building, we need to ask a more important question: Why should this application exist?

Start with the use case

A useful way to think about an AI application is to identify the problem and the value it is expected to create. For example:

Problem Possible AI application Potential value
Employees spend too much time searching internal documents Internal knowledge assistant Faster access to information
Customer requests take too long to process Customer support assistant Faster responses
Businesses receive many unstructured documents Document extraction system Less manual data entry
Developers spend time writing repetitive code Coding assistant Improved developer productivity

The point is not to add AI because it is fashionable. The point is to identify a problem where AI can provide a meaningful advantage.

Think about risk

Not all applications carry the same level of risk. An internal tool that summarises meeting notes has different consequences from an AI system that gives medical recommendations or makes decisions affecting someone's finances. The chapter highlights that organisations often begin with internal-facing applications because they can be easier to evaluate and may involve fewer risks than applications exposed directly to customers. This is a useful approach when introducing AI into an organisation: Start with a problem where the value is clear, the risks are manageable and the results can be evaluated.

Ask whether AI is actually necessary

Sometimes a normal software solution is better. If a task can be solved with a simple rule, database query or conventional algorithm, adding a foundation model might introduce unnecessary cost, complexity and unpredictability. For example, if an application only needs to calculate the total price of items in a shopping cart, a language model is not the right tool. A deterministic calculation is simpler and more reliable. AI is useful when its capabilities solve a problem that would otherwise be difficult, expensive or time-consuming to handle.

8. Understanding the AI engineering stack

Now we get to the part that connects everything. The chapter described AI engineering through three main layers: application development, model development and infrastructure. Think of these as the building blocks involved in turning a foundation model into a working AI application.

Layer 1: Application development

This is the layer closest to the user. It focuses on how people interact with the AI application and how the application guides the model's behaviour. The chapter highlights three important responsibilities:

Evaluation

Evaluation helps us understand whether the model and application are doing what we expect. It is used to compare models, measure progress, decide whether an application is ready for deployment and identify issues after deployment. This is especially important because foundation models can produce open-ended outputs. For a traditional classification model, we might compare a prediction against a known label. For a chatbot, there may be many reasonable ways to answer the same question. We cannot simply create one exact expected answer for every possible prompt. That makes evaluation more challenging.

Prompt engineering and context construction

This is where we design instructions and supply the information the model needs. It includes writing prompts, providing examples and constructing relevant context. A small change in a prompt can affect the model's output, so prompt design should be treated as an engineering activity that can be tested and improved.

AI interface

This is how users interact with the application. Possible interfaces include web applications, desktop applications, mobile applications, browser extensions, chat applications, voice interfaces integrations inside existing software. The interface matters because even a capable model can be difficult to use if the application around it is confusing.

Layer 2: Model development

This layer focuses on the model itself and the work required to prepare, adapt and improve it. The chapter identified three major responsibilities.

Modeling and training which includes designing model architectures, training models and fine-tuning existing models. With foundation models, many application developers do not need to pre-train a model from scratch. Their work is more likely to involve adapting an existing model.

Dataset engineering which involves curating, generating and annotating data used to train or adapt models. This is more than collecting a large dataset. For foundation models, important tasks can include removing duplicate data, tokenization, retrieving relevant context, quality control, removing sensitive information, filtering toxic or unsuitable data. The quality of the data still matters, even when we are using a model someone else has trained.

Inference optimization: Inference is the process of using a trained model to generate a prediction or response. Inference optimization aims to make that process faster and cheaper. This matters because large foundation models can require significant compute resources, and users expect applications to respond quickly. If a model generates output one token at a time, longer responses can take longer to produce. The application engineer therefore needs to think about latency, computational cost and the overall user experience.

Layer 3: Infrastructure

Infrastructure is the foundation that allows the application and models to run. It includes the compute resources, storage, deployment environments and supporting systems required to operate the application. The book's stack placed infrastructure alongside application development and model development because a working AI system depends on all three. A model can be capable, and an application can be well designed, but neither is useful if the infrastructure cannot support the workload.

Putting the three layers together

Here is the mental model I am taking away:

             AI APPLICATION
                    |
       +------------+------------+
       |                         |
APPLICATION DEVELOPMENT     MODEL DEVELOPMENT
       |                         |
   Evaluation              Modeling & training
   Prompt engineering      Dataset engineering
   AI interface            Inference optimization
       |                         |
       +------------+------------+
                    |
              INFRASTRUCTURE
                    |
       Compute, storage, deployment
          and supporting systems

The three layers work together. A successful AI application is not simply a model connected to a user interface. It is a system in which the application, model and infrastructure support one another.

9. AI engineering versus traditional ML engineering

So, how is AI engineering different from the ML engineering many of us have been learning?

Difference 1: Model development versus model adaptation

Traditional ML engineering often involves developing a model for a specific task. AI engineering frequently starts with a model that someone else has already trained. The focus shifts towards adapting that model for a particular application. That does not mean machine learning knowledge is irrelevant. Understanding models helps us choose them, evaluate them and understand their limitations. It simply means that training a model from scratch is no longer the only way to build an AI-powered application.

Difference 2: Compute, scale and inference cost

Foundation models can be much larger and more computationally demanding than traditional task-specific models. This creates additional pressure to optimise model inference, latency, compute usage, cost, hardware utilisation. The model may be accessible through an API, but that does not make its use free or unlimited. An application that makes thousands of model calls needs to account for the cost and performance implications.

Difference 3: Open-ended outputs make evaluation harder

Traditional machine learning tasks are often close-ended. A spam classifier might return:

Spam

or:

Not spam

A generative AI application can return many different responses to the same question. Some may be accurate and useful. Others may be incomplete, irrelevant or incorrect. This makes evaluating foundation-model applications more complicated. It also makes evaluation one of the most important responsibilities in AI engineering.

A quick comparison

Area Traditional ML engineering AI engineering with foundation models
Starting point Often develops a task-specific model Often uses an existing foundation model
Main model focus Modelling and training Model adaptation and evaluation
Data work Often feature engineering and structured data Also includes tokenization, retrieval and data quality
Outputs Often predefined or close-ended Often open-ended
Evaluation Often compares predictions with known labels Must assess a wider range of possible outputs
User interface May be less central to model development More important to the overall application
Inference Important Particularly important because of model scale and cost

The important distinction is not that one discipline replaces the other. AI engineering builds on many principles from ML engineering while introducing new challenges around foundation models, adaptation, evaluation and user-facing applications.

10. What does this mean for someone learning AI/ML and MLOps?

This is the part I find most useful as someone developing an AI/ML engineering skill set. It is tempting to think that becoming an AI engineer means learning every new framework, model provider, agent library and AI tool that appears. But I learnt a more useful way to organise the field. Understand the building blocks first. I would focus on these areas:

1. Understand machine learning fundamentals. Learn how models work, how they are trained, how to evaluate them and why they fail. Foundation models do not remove the need to understand machine learning.

2. Learn how to work with model APIs. Understand how applications send inputs to models and handle their outputs. Learn about API requests, authentication, structured outputs, errors, latency and usage costs.

3. Learn prompt engineering. Practise writing clear instructions, supplying examples and constructing context. Treat prompts as something to evaluate and improve, not magic sentences.

4. Understand RAG. Learn how to connect models to external information sources. Understand document processing, embeddings, retrieval and how retrieved context is passed to a model.

5. Learn evaluation. Do not stop at checking whether a response looks good. Build test cases, define quality criteria and compare outputs systematically.

6. Understand the application layer. Build interfaces that make AI useful to real people. Learn how to connect a model to a web application, database or existing software system.

7. Understand infrastructure and operations. Learn deployment, logging, monitoring, latency, cost management and reliability. An AI application needs to work outside your development environment. This is where AI engineering connects naturally with MLOps and software engineering.

What I'm taking away

The biggest shift I am taking from this chapter is that building AI applications is not the same as building AI models. For a long time, I associated AI development with collecting datasets, training algorithms and improving model accuracy. Those skills remain valuable, but foundation models have expanded what developers can build and how they can build it.

We can now start with an existing model, adapt it using prompts, retrieval or fine-tuning, build an interface around it, evaluate its behaviour and connect it to the infrastructure needed to serve users. That does not make AI engineering easy. It changes where much of the engineering work happens.

We still have to ask difficult questions:

  • Is this the right problem for AI?
  • Is the model capable of solving it?
  • How will we evaluate its outputs?
  • What information does it need?
  • How much will it cost to run?
  • What happens when it gives an incorrect answer?
  • How will real users interact with it?

And those are exactly the kinds of questions I want to become better at answering.

I am learning that becoming a strong AI engineer is not about memorising every new AI tool that comes out. It is about understanding the systems behind the tools and knowing how to put the pieces together to solve real problems.

The goal is not just to make a model respond. It is to build an application that is genuinely useful.

That's the journey I'm documenting here at Godfident Data. Faith-led. Data-driven. Future-focused.

A question for you

If you could build one AI application to solve a real problem in your school, workplace, community or everyday life, what would you build? I'd love to hear your idea. And if you're learning AI engineering too, let's keep building and learning together.

Source note

This article is based primarily on Chapter 1, Introduction to Building AI Applications with Foundation Models. The chapter's historical examples, statistics and tool comparisons reflect the period in which the book was written; they have not been presented here as current market statistics.

Separating model development from application engineering around foundation models clarifies why teams with zero custom training infrastructure can still ship useful AI products. Instead of building a bespoke classifier for every workflow, the engineering work shifts to context assembly, tool contracts, latency budgets, and evaluation harnesses.

That said, knowing when to drop back to a small supervised model still pays off: for high-volume, fixed-schema tasks like fraud scoring or binary routing, a lightweight trained classifier often runs orders of magnitude cheaper and more predictably than calling a general-purpose LLM.

Absolutely. I think one of the most important skills in AI engineering is learning to choose the right tool for the problem rather than defaulting to foundation models for everything. LLMs open up possibilities, but traditional ML models still have a very important place, especially where the task is well-defined and predictability, cost, and latency matter. It's really about building systems where the technology serves the problem, not the other way around.