AIaaS lets an application send a prompt and data to a managed API, which returns a result from a pre-trained model. Think of serverless as a taxi where you give turn-by-turn directions; AIaaS is a self-driving taxi—you give it a destination and let it work out the route. section 9.4.5
The provider manages the hardware and model, so you can add capabilities such as language processing or computer vision without building the core logic. The tradeoff: responses can vary or be wrong, and calls cost more than standard database queries. Use AIaaS for messy, unstructured data—not strict mathematical business rules. section 9.4.5
A practical fit
Send a chaotic user-uploaded document with a prompt to extract names, dates, and invoice totals. That kind of unstructured-data parsing suits AIaaS better than a calculation that must return the same exact answer every time. section 9.4.5
Figure 9.3 AI models are probability engines, not databases. Without RAG guardrails, they will confidently improvise the wrong answer. RAG turns the AI from an "improv actor" into an "open-book test taker”.

Use the figure to see why a model can improvise an answer, and how retrieval-augmented generation (RAG) can provide guardrails. section 9.4.5
