Welcome back. In the last lesson, we surveyed the landscape of the major LLM families—OpenAI, Anthropic, and Gemini—comparing their general strengths, weaknesses, and pricing. You learned that choosing a model isn't about finding the single "best" one, but about understanding a dynamic set of trade-offs.
Today, we move from comparison to decision-making. You will learn a systematic framework for choosing the right type of model for a specific task within an agentic workflow. Your goal is to build production-grade agents for clients, which means your technical choices must be economically sound. This lesson focuses on the core engineering skill of balancing performance, capability, and cost. By the end, you'll be able to confidently choose between reasoning, fast, multimodal, and embeddings models to build agents that are not just smart, but also efficient and scalable.
The Model Hierarchy: A Tool for Every Task
A common mistake for developers new to AI engineering is to default to the most powerful, "intelligent" model for every task. This is like using a high-precision laser cutter for every job in a woodshop, from making intricate joints to simply cutting a board in half. It's slow, expensive, and unnecessary.
A better mental model is to think of the available LLMs as a hierarchy of tools, each optimized for a different balance of intelligence and cost. The most successful AI agents don't rely on a single, monolithic brain; they are systems that strategically deploy different models for different sub-tasks.

We can group models into four broad categories based on their primary function in an agent system.
1. The Reasoning Engines (The "Brains")
These are the flagship models, like OpenAI's GPT-4o and Anthropic's Claude 3.5 Sonnet. They are characterized by:
- High Intelligence: They excel at complex logic, multi-step reasoning, planning, and understanding nuance.
- High Cost: They are the most expensive models to run, with prices often an order of magnitude higher than their smaller siblings.
When to use a Reasoning Engine:
- For the central "thinking" part of an agent that requires planning a sequence of actions.
- When the task involves complex instruction following, creativity, or generating sophisticated, long-form content.
- When acting as a final "synthesizer" that takes information from multiple sources and produces a comprehensive answer.
Using a reasoning engine for a simple task like classifying an email as "urgent" or "not urgent" is a waste of resources. That's where the next category comes in.
2. The Fast Workers (The "Hands")
These are smaller, highly optimized models like OpenAI's GPT-4o mini, Anthropic's Claude 3 Haiku, and Google's Gemini Flash. They are built for speed and efficiency.
- High Speed: They have very low latency (Time to First Token), making them feel much more responsive in interactive applications.
- Low Cost: They are significantly cheaper, allowing you to process high volumes of requests without breaking the bank.
When to use a Fast Worker:
- Classification: Is this customer review positive or negative?
- Extraction: Pull the name, email, and company from this block of text.
- Routing: Is this user query about sales, support, or billing?
- Simple Q&A: Answering factual questions based on a small amount of provided context.
The cost difference is the most compelling reason to use these models wherever possible. Let's look at a practical guide to LLM cost optimization.
LLM Cost Optimization Guide: Cut AI API Spend by 60-80% | Hyperion Consulting
This guide from Hyperion Consulting breaks down the economics of running LLMs in production. Understanding these numbers is critical to building viable AI products.
Focus on the Model Pricing Comparison table and the subsequent section, The 17x Gap. Note the massive price difference between a flagship model like GPT-4o and its "mini" counterpart.
As you just read, the 17x price gap between GPT-4o and GPT-4o mini for input tokens is not a minor detail; it's the economic foundation for building intelligent, multi-tiered agent systems.
3. The Specialists: Multimodal and Embeddings Models
Beyond the general-purpose reasoning/fast hierarchy, we have specialized models for tasks that go beyond text-to-text generation.
Multimodal Models
Models like GPT-4o and Gemini Pro are natively multimodal, meaning they can process information beyond text, including images, audio, and video.
When to use a Multimodal Model:
- Processing visual information, such as reading text from a scanned document or describing the contents of a user-uploaded image.
- Analyzing user interface elements for UI automation tasks.
- Transcribing audio from a meeting to generate a summary.
Since today's top reasoning models are also the top multimodal models, you often get this capability as part of the "brains" of your system.
Embeddings Models
This is a critical and distinct category. Models like OpenAI's text-embedding-3-small do not generate human-readable text. Instead, they convert chunks of text into a numerical vector (a list of numbers) that represents its semantic meaning.
When to use an Embeddings Model:
- Semantic Search: To find documents relevant to a user's query, even if they don't share the same keywords. This is the core of Retrieval-Augmented Generation (RAG).
- Clustering: To group similar documents together.
- Classification: As a preliminary step to turn text into features for a simpler machine learning model.
It is crucial to understand that an embeddings model solves a different problem than a generative model. You use it to find relevant information, which you then feed to a generative model to synthesize an answer. We will dedicate an entire module to this process (RAG) later in the course.
A Practical Framework: The Agent Cascade
Now, let's put it all together. The most effective agent architectures use a "cascade" or "routing" pattern, where requests are handled by a chain of models, starting with the cheapest and escalating only when necessary.
Consider a common use case you might build for a client: an automated customer service agent.

Let's trace the flow of a customer message, "My order was damaged," through this system:
-
Intake & Triage (Fast Model): The message first hits a Fast Worker like
gpt-4o-mini. Its only job is to classify the user's intent and extract key information. It's cheap, fast, and reliable for this simple task. It doesn't try to solve the problem; it just routes it. Its output might be a simple JSON object:{ "intent": "damaged_item", "urgency": "high", "order_id_mentioned": false } -
Orchestration & Reasoning (Reasoning Model): Based on the
damaged_itemintent, the system now invokes a powerful Reasoning Engine likegpt-4o. This expensive model is only used because the simple triage step confirmed it was necessary. Its job is to plan and execute the next steps:- Thought: "The user's order was damaged. I need to find their most recent order in the CRM, check the company's return policy for damaged goods, and then formulate a response."
-
Knowledge Retrieval (Embeddings Model): To check the return policy, the reasoning agent doesn't use its own knowledge (which might be outdated). It uses a
get_policytool. This tool takes the query "return policy for damaged items", uses an Embeddings Model to convert it into a vector, and queries a database of company documents to find the most relevant paragraph. This paragraph is returned to the reasoning agent. -
Action & Response (Reasoning Model): Now armed with the order details from the CRM and the specific return policy from the knowledge base, the
gpt-4oagent can execute the final steps: update the CRM, trigger a replacement order, and generate a helpful, context-aware response for the customer.
This cascade approach provides the best of all worlds: the user gets a fast initial acknowledgment, simple queries are handled cheaply, and complex problems get the full power of a reasoning engine, all orchestrated seamlessly. This is the core principle of cost-effective agent engineering.
LLM Cost Optimization Guide: Cut AI API Spend by 60-80% | Hyperion Consulting
Let's revisit the Hyperion guide to see how this "Model Routing" pattern is described and the immense financial impact it can have.
Read the section on Model Routing. Pay close attention to the different patterns (Complexity Classifier, Task-Based Router, Cascade Pattern) and the final real-world savings example.
The 84% cost reduction in the example is not an exaggeration; it is the direct result of applying the model selection principles we've discussed today.
Conclusion
Choosing the right LLM is a strategic decision that directly impacts the performance, user experience, and financial viability of your AI agents. You are no longer just an API consumer; you are an architect designing an intelligent system with budgetary constraints.
Here are your key takeaways from this lesson:
- Categorize Models by Function: Think in terms of Reasoning Engines (brains), Fast Workers (hands), and Specialists (multimodal, embeddings) for specific sensory or data-processing tasks.
- Embrace the Cascade: Design your agents to use the cheapest, fastest model that can reliably handle each sub-task. Escalate to more powerful models only when necessary.
- Cost Drives Architecture: An 80-90% cost reduction is achievable by switching from a "one-model-fits-all" approach to a multi-tiered, routed architecture. This is often the difference between a prototype and a profitable product.
- Embeddings are for Retrieval, Not Generation: Embeddings models create numerical representations for semantic search (RAG), a foundational technique for providing agents with external knowledge that we will master later.
In our next lesson, we will zoom in on a single model call. Now that you know how to choose a model, you will learn how to control its output using key parameters like temperature, top-p, and max tokens to shape its creativity, determinism, and verbosity.