Every GenAI system has to decide which model, or models, to use.
There are plenty of options: hosted frontier models, open-weight models you can run yourself, smaller models optimized for speed, reasoning models, multimodal models, and models with context windows large enough to process an entire book.
Choosing the right model means balancing several requirements: answer quality, response time, cost per request, data privacy, and how much infrastructure your team can manage. A system can also use multiple models, choosing a different one for each type of task.
In this chapter, we'll look at how to make these decisions, from choosing between hosted and self-hosted models to deciding when long context makes sense and when retrieval is a better option.