Courses · The Ambush Method

Pick your exam.

Every guide follows the same method: short daily sessions, the traps each topic sets, and exam-style questions with an explanation for every option.

  • 100% free · no paywalls, subscriptions or ads
  • 30–60 min a day
  • Exam-style questions
  • Taught in English

How to Choose an LLM on Databricks: Gates First, Then Latency, Cost and Quality

How to choose an LLM on Databricks: the least model that fits, clearing privacy and license gates before latency, cost and quality

Someone hands you a feature and one line of instructions: pick the model. No budget, no latency target, no shortlist. So you sort a leaderboard by the top score and write that name in the doc. Then Monday arrives, and every question is about cost, privacy and context size, not the leaderboard.

That gap is exactly what the exam tests when it asks you to choose an LLM on Databricks. It is not a memory test about model names. It is a test of whether you can defend a choice in the right order. In my book I call that order the Selection Stack, and here I’ll walk through it the way I’d explain it to a friend studying for the Generative AI Engineer Associate.

If you are still mapping the whole exam, start with my Databricks Generative AI Engineer Associate study guide. This post is the foundation under almost everything else: once you can pick a model, the rest of the exam is about feeding it, serving it and checking it.

How to choose an LLM on Databricks: where it sits in the exam

The objectives are short and easy to skim past. “Select model tasks to accomplish a given business requirement” lives in Design Applications. “Select a model from a model hub or marketplace for a task based on model metadata/model cards” and “Select the best LLM based on the attributes of the application to be developed” live in Application Development. According to the official certification page, those two sections weigh 14% and 30%, and Application Development is the heaviest on the paper. The exam has 45 scored questions in 90 minutes and costs US$200.

Almost every “which model” question is one of these three objectives in disguise.

First, what the model is actually doing

Before choosing a model, you need the right picture of what one is. A large language model does not look facts up. It predicts the next token from patterns it learned, over and over, until the answer is done. That is why a fluent answer can be confidently wrong, and why a newer model does not repair a made-up policy. Fixing that is a grounding problem, which I cover in RAG on Databricks.

Three words from that picture show up in every model-choice question.

Tokens: the unit of every limit and every price

A token is a chunk of text, usually smaller than a word. The model never sees words or characters, only tokens, so every limit and every price is counted in them. A common rule of thumb for English is about four characters per token. Treat it as an approximation, not a promise, because the split depends on the exact text. Hosted models bill for input tokens plus output tokens, which is why “shorten the prompt” and “cap the response length” are the two levers that really move a bill.

The context window: a budget, not a memory

The context window is the most tokens a model can handle in one call, and your input and its output share it. People call it memory, and that is the wrong word. Each call starts empty. A chat that seems to remember earlier messages is re-sending them inside every new request and paying window space for them each time. If the input alone overruns the window, the overflow is not read. Depending on the tool around the model, the call fails or quietly drops text, and the model answers from a truncated copy without telling you. That silent version is the same trap I wrote about in chunking strategies for Databricks RAG.

Temperature: a randomness knob, not an intelligence knob

At temperature zero the model takes the most likely token every time, so output is repeatable. Higher values let less likely tokens through, so output varies. Neither is “better.” Low fits classification, extraction and anything you will test or audit. Higher fits brainstorming and drafting. If a teammate says “it gave a different answer when I ran it again,” that is sampling, not a bug. One current-docs wrinkle worth knowing: the supported models page notes that some newer models reject sampling parameters such as temperature, so check the model’s own entry before you rely on the knob.

The Selection Stack: three decisions, in order

Here is the idea the whole post hangs on. Choosing a model is three decisions made top to bottom:

  • Architecture: the shape of the solution. Is this a single model call, a retrieval pipeline, an agent?
  • Model: which one fits the application’s attributes.
  • Grounding: how you supply what the model never learned, such as your private data.

Each layer constrains the one below it, so the order cannot be shuffled. Picking a model before you know the architecture is how teams end up evaluating chat models for what is really a search problem. The rest of this post lives in the middle layer, with a short look at the first.

Step one: name the task before the model

A business request hides a language task. “Condense these long notes into something readable on a dashboard” is summarization. “Sort incoming emails into complaint or not” is classification. “Find tickets that mean the same thing” is not generation at all: it is an embedding task, a search problem that uses the retrieval machinery from Databricks Vector Search.

Naming the task first matters for two reasons. It shortens the shortlist, because a classification job can often run on a small, cheap model with no large generative model anywhere in the design. And it protects you from the broad-versus-specific trap.

The trap: the technically true answer

When a narrow task and the broad family that contains it are both on offer, the broad one is true and still wrong. Summarization is a kind of text-to-text generation, so “text-to-text generation” is technically correct for almost anything. Think of it as a job posting that says “produce some text”: it commits you to nothing. The exam rewards the most specific category that describes the requirement.

The tell is the verb in the stem. “Summarize,” “classify,” “translate,” “route”: the requirement usually contains the word for its own task. When a verb names a specific job, distrust the more general option sitting next to it.

Step two: read the model card like a contract

Once you have a shortlist, you open the model card. The mistake is reading it like a brochure. A model card has two kinds of content on one page. Some of it is contract: terms that bind you whether or not you read them. The rest is brochure: numbers someone chose to print.

The clauses that bind

  • License. It decides what you are allowed to do. Some licenses allow commercial use freely, some limit a model to research, some allow commercial use only under a company-size threshold. A model can be excellent on every other axis and still be unusable because the license forbids what your product does.
  • Context length. A hard number. If your inputs need more tokens than the card allows, no score changes that arithmetic.
  • Training cutoff. The date after which the model has seen nothing. It bounds what the model can know on its own. A recent cutoff does not replace handing the model your current data at answer time.
  • Intended use and limitations. The fine print where makers say what the model is not for, such as languages it was not tuned for. It is the shortest section and often the most honest.

The parts that only suggest

Parameter count is a hint about capability and cost, never a ranking to obey. More parameters often means more capable, but it also means slower and more expensive to run, so size is a trade-off with a price, not a free upgrade. Benchmark scores are a real measurement on someone’s chosen test, and any benchmark is a proxy for your task, not your task. A high score earns a spot on the shortlist. It does not win the job.

For the exam, remember the order: read the binding clauses first, then let the brochure impress you. A model with a license that says no is not a strong option with a caveat. It is out.

On Databricks, the supported models page lists each hosted model with its service name (the system.ai names), supported inputs and notes. Models you pull from outside hubs or marketplaces carry the same card logic: read the clauses before you wire anything.

Step three: choose by the application’s attributes

This is the heart of “select the best LLM.” Five attributes of the application decide the answer, and they are not equal.

Two gates and three trade-offs

  • Privacy is a gate. If the data is customer records or regulated data and may not leave your governed boundary, a model that sends every prompt outside it is out, however good it is.
  • License is a gate. If the application is commercial, the license must permit commercial use.
  • Latency is a trade-off. A live chat feature needs answers fast. A nightly batch job that summarizes yesterday’s tickets has no such ceiling and can use a slower, stronger model freely.
  • Cost is a trade-off. It is the price per call multiplied by the number of calls, and volume is the part that ambushes people. A model that is affordable in a demo can get expensive at high request volume.
  • Quality is a floor, not a score to maximize. Name the quality the task actually needs, clear it, and stop paying for capability above it.

So the real decision is: clear the two gates first, then find the point among latency, cost and quality that the application can live with. These three pull against each other, since more quality usually costs more money and more time.

If you like learning traps like this one at a time, that is how my free Databricks Generative AI Engineer Associate course is built: 30-60 minutes a day, one objective at a time, no dumps.

The ambush: peak capability versus constrained fit

This is the trap I would bet on. A scenario describes an application with a firm constraint, such as a tight latency budget, high request volume on a small budget, or a privacy rule. Among the answers sits the flagship model, the most capable and the most expensive. It is written to be chosen, because “most capable” feels like the safe pick that nobody gets blamed for.

The Selection Stack disarms it. Peak capability is a property of the model. Fit is a property of the relationship between the model and the application, and the objective asks about the second. A model that violates a hard constraint is not a strong option with a drawback. It is a disqualified option, the same gate logic as the license clause, now applied to the application’s limits. The right answer is the least model that clears every constraint, not the greatest model that clears only some.

The mirror image is overcorrecting to the smallest, cheapest model that misses the quality floor. When a stem names a constraint and one answer is the obviously most powerful model, treat the power as the distraction and the constraint as the question.

Serving mode is part of the decision

Cost and latency are not only model-choice levers. They are also serving-mode levers, and Databricks splits them there. Per the Foundation Model APIs docs:

  • Pay-per-token is the easiest way to start and is recommended for beginning your journey. For latency-sensitive production traffic, the docs also describe priority pay-per-token, an opt-in mode billed at a higher per-token rate.
  • Provisioned throughput is recommended for production workloads that need high throughput, performance guarantees, fine-tuned models or additional security requirements. It comes in on-demand and reserved options.
  • AI Functions optimized models are recommended for batch inference workloads.

So two models with identical cards can cost and behave very differently depending on what sits behind them. Light or bursty traffic and prototypes point to pay-per-token. Sustained load that needs predictable latency points to provisioned throughput. A scheduled job over a table points to batch. I compare the batch and real-time paths in detail in Databricks Model Serving vs ai_query.

Test on your own data

A benchmark can shortlist a model, but only your data can pick one. The habit worth building is to run the same prompt through two or three candidates and compare. Here is a tiny sketch of that idea using the Foundation Model APIs from Python.

from databricks.sdk import WorkspaceClient

w = WorkspaceClient()
client = w.serving_endpoints.get_open_ai_client()

# Same prompt, two candidate models: compare quality, latency and cost on YOUR data.
for endpoint in ["databricks-meta-llama-3-1-8b-instruct",
                 "databricks-meta-llama-3-3-70b-instruct"]:
    reply = client.chat.completions.create(
        model=endpoint,
        messages=[{"role": "user",
                   "content": "Classify this ticket as billing, bug or other: 'I was charged twice.'"}],
        temperature=0,    # repeatable output while you compare
        max_tokens=10,    # a label needs a few tokens, so cap the output (and the bill)
    )
    print(endpoint, "->", reply.choices[0].message.content)

You are comparing quality, speed and cost on your own task, with temperature pinned so differences come from the models and not from sampling. When the comparison grows beyond a toy, you will want proper judges and ground truth, which is the subject of Databricks agent evaluation vs monitoring. And because the instructions you send shape the result as much as the model does, my post on Databricks prompt engineering is the natural next step.

FAQ

How do I choose an LLM on Databricks for the exam?

Use the Selection Stack: decide the architecture, then choose the model by the application’s attributes, then decide how to ground it. Within the model step, clear the gates (privacy and license) first, then balance latency, cost and quality.

Does a bigger model always give better answers?

No. Bigger often means more capable, but it also means slower and more expensive, and it is never automatically best for a specific task. The exam rewards the least model that clears every constraint and meets the quality the task needs.

What is the difference between a context window and memory?

The context window is a per-call token budget shared by input and output. The model keeps nothing between calls. A chat only seems to remember because earlier messages are sent again with each request.

When should I use pay-per-token versus provisioned throughput?

Pay-per-token fits getting started, prototypes and light or bursty traffic. Provisioned throughput fits production workloads that need performance guarantees. Batch jobs use AI Functions.

Learn the rest of the exam the same way

Choosing a model is a small slice of the exam, but it is the one you reuse everywhere: name the task, read the clauses, clear the gates, then balance the trade-offs. If you can do that out loud, you can defend your pick to anyone, on exam day or in a Monday meeting.

If you want every objective broken down like this, with the traps called out and short daily sessions instead of a cram weekend, take my free Databricks Generative AI Engineer Associate course. It is built for 30-60 minutes a day, and it never uses exam dumps.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *