-
Book Overview & Buying
-
Table Of Contents
Building Natural Language and LLM Pipelines
By :
This chapter was our final step in the journey from a local NLP concept to a scalable, production-grade application. We mastered the critical concepts and practical steps for deploying robust Haystack pipelines, ensuring that they are accessible, manageable, and ready for real-world demands.
We began by exploring the two dominant strategies for deployment, balancing the trade-off between customization and speed.
First, we took the custom control path by building a custom REST API from the ground up using FastAPI. We learned why FastAPI is the industry standard for ML: its asynchronous performance via Starlette and its data validation via Pydantic. We manually defined our application's lifespan, wrote Pydantic models for our requests, and used dependency injection to serve our pipeline.
We then packaged this custom application using Docker, writing a multi-stage Dockerfile for a lean, secure, and portable image. We completed this pattern by building a CI/CD...