liveBook · Manning

Cost

As explained in AI Agents and Applications

The expense incurred when running a trained model to produce outputs, commonly calculated from usage such as processed or generated tokens.

Cost is the expense of running a trained model to produce outputs. In LLM applications, inference cost usually rises with model size and the number of tokens processed or generated, making model choice an operational decision rather than an accuracy-only decision. section 1.5

Manage cost by balancing it against two closely related model-selection concerns:

  • Accuracy: larger models are often more accurate but cost more and respond more slowly. section 1.5
  • Speed: smaller models reduce latency and expense, but may sacrifice accuracy. section 1.5
  • Workflow design: assign different models to different tasks instead of using the largest model everywhere. section 1.7
  • Knowledge access: use RAG for dynamic runtime context when reducing retraining needs and costs matters; use fine-tuning for embedded domain knowledge and specialized efficiency. section 1.7

Task-specific model routing

A workflow can use GPT-5-nano for fast summarization, GPT-5-mini for answer synthesis, and full GPT-5 for complex query routing. This concentrates expensive inference where higher accuracy is justified. section 1.7

How AI Agents and Applications covers it

How deep it goes
Compares model size, per-token charges, and task routing without detailing a full cost-accounting procedure.
Examples
Uses customer-support chatbots, legal-document analysis, and GPT-5 model routing as concrete cost trade-off examples.
What you can do after
Apply via LangChain by selecting models and routing tasks according to accuracy, speed, and cost requirements.
How it connects
Connects cost with model selection, accuracy, latency, inference, RAG, fine-tuning, and prompt engineering.

Also explained in

Compare how 10 books explain cost →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents and Applications. The section links point to the parts of the book it draws on.