Code and dense tables are folded away. Open any of them on demand.
How much does it cost to use an LLM as a classifier?
The cost of an LLM classifier is more than its token price. Each call pays for the full prompt with the label list, the generated answer, retries when the output fails to parse, and the latency of generation. At volume these costs multiply per decision, which is why one-pass decision models are often cheaper for routine labelling.
An LLM classifier takes an afternoon to build. Write a prompt that lists the labels, paste in the text, ask for JSON, parse the result. No training data, no model hosting, and instruction-tuned models are genuinely good zero-shot classifiers on many tasks (Brown et al., 2020). For a prototype or a low-volume internal tool, that is often the right call.
The trouble starts when the prototype becomes a pipeline. Volume multiplies every per-call cost, latency compounds inside agent loops, and the operational burden of parsing, retrying and re-validating grows. None of these costs show up in the demo.
The anatomy of an LLM classification call
Every call pays for several things, most of which are independent of how hard the decision is:
Show technical detailsHide technical details· 7 rows × 3 columns
| Cost component | What drives it | Typical share |
|---|---|---|
| System prompt and instructions | Your prompt length; repeated on every call | Often the largest input share |
| Label list and descriptions | Number of labels and how well they are described | Grows with label count |
| Few-shot examples | How many examples you include to steer the model | Can dwarf the text itself |
| The text being classified | The input you actually care about | Often a minority of input tokens |
| Output tokens | JSON wrapper, label, optional rationale; hidden reasoning tokens on reasoning models | Priced higher per token than input on most APIs |
| Retries | Parse failures, invalid labels, timeouts, rate limits | Small percentage, but tail-heavy |
| Extra calls | One call per question if prompts are separate | Multiplies everything above |
Put rough numbers on it with a formula rather than a price list, because prices change:
Show technical detailsHide technical details· text sample
A worked token count: a 400-token system prompt, 150 tokens of labels, 300 tokens of few-shot examples and a 250-token email is 1,100 input tokens, of which only 23% is the email. Add 30 output tokens for a JSON label. If you ask four separate questions about each email with separate prompts, you send the email four times and pay the fixed overhead four times. At a million emails a month, that is on the order of 4.4 billion input tokens before a single retry.
Prompt caching and batching discounts, where your provider offers them, cut the fixed overhead. Combining questions into one prompt reduces calls but makes each output longer and each parse more fragile.
Latency is a cost too
Generative decoding adds a forward pass per output token after the prompt is processed. For a short label, that is a few steps; for a JSON object with a rationale, dozens. Hosted APIs add network time and queueing.
For context, the Laya model card cites independent measurements of TypeSafe Jev, a hosted decision API, at 236 to 276 ms p50 per call, and reports Laya at 32.8 ms for a single question on a T4 GPU (multilingual checkpoint). Hosted LLM calls have their own latency profile, which varies with model size, output length and provider load; measure yours at p50 and p95. Inside an agent that makes several decisions per turn, those milliseconds add up to seconds; see latency budgets for agents.
Hidden costs: parsing, drift and probabilities
Parsing and validation. A generated label is a string. It can be misspelled, capitalised differently, wrapped in prose or replaced by a label that is not in your list. Structured-output features reduce this but do not remove the need to validate. Every validation failure is a retry or a fallback path you have to build and maintain.
Order and phrasing sensitivity. Zheng et al. (2023) showed that LLMs choosing among options have measurable position biases: moving the correct answer to a different slot changes accuracy. Label order and wording become hidden hyperparameters.
Probabilities. Token log-probabilities are not always exposed, depend on how each label tokenises, and verbalised confidence ("confidence: 0.9") is just more generated text. Kadavath et al. (2022) found models can be reasonably calibrated in some formats, but getting usable probabilities is extra engineering. Without them, you cannot threshold.
Model churn. Hosted models are updated and retired. Each change means re-running your evaluation set and possibly re-tuning prompts.
Where a one-pass decision model changes the arithmetic
A decision model such as Laya removes several rows of the cost table by construction:
| Cost component | LLM classifier | Laya |
|---|---|---|
| Output tokens | Paid per call | None: output_tokens is always 0 |
| Parsing and invalid labels | Must be handled | Impossible: answers are drawn from your options |
| Multiple questions per item | Several calls or one long prompt | One request, one batched forward pass |
| Probabilities | Extra engineering | Returned for every option |
| Few-shot examples in prompt | Common | Not part of the format |
| Model churn | Provider-controlled | Open weights (Apache-2.0), pinned checkpoints |
On Laya Studio, billing is per input token: 1 credit = 1 input token, the tokens the model actually reads (at most the model's context per question). Each question reads the state once, so a four-question request costs about four times the state's tokens. See /pricing for current plans and the 5 free runs.
Where the LLM is still worth paying for
Being honest about the other side:
- Reasoning. If the decision requires reading a policy and applying it step by step, an LLM does something a 421M-parameter encoder cannot.
- Large label spaces. Laya's accuracy falls with dozens of options (0.425 on 77-label Banking77 vs 0.870 published for Jev). An LLM reading a long label list can do better.
- Zero-shot on idiosyncratic tasks. Laya's base checkpoints are near chance on the multi-field typed-decisions benchmark without fine-tuning.
- Explanations. If an auditor needs a rationale, you need text.
The economical architecture is often both: a fast decision model for every item, and an LLM only for the items where the fast model's calibrated confidence is low. See act or escalate.
Replacing a four-question LLM prompt with one Laya Studio call
Frequently asked questions
Is an LLM classifier always more expensive than Laya?
Can I cut LLM classification cost with prompt caching?
Does Laya charge by token?
When should I keep the LLM?
Does an LLM give me probabilities I can threshold?
How do I estimate what LLM classification will cost?
Is a small classifier cheaper than an LLM?
Sources
Last updated . Laya Studio is an independent hosted service for the open-source Laya model (Apache-2.0, © Convai Innovations) and is not affiliated with Convai Innovations or TypeSafe.
Next articleHallucination-free decisions: what a non-generative model rules outCan an AI classifier hallucinate? What a non-generative model like Laya rules out (invented labels, fake fields, unparseable text) and what it can get wrong.