A pretrained model has already learned parameters from training data before an application uses or adapts it. In web applications, hosted pretrained models provide language capabilities through public APIs, avoiding the infrastructure required to build and maintain a model from scratch. section 1.4.2 section 2.2.2
Choose between hosted and self-managed approaches by weighing convenience against control:
- Use a cloud-provider or third-party pretrained model for easier integration and access to capable language models. section 1.4.2
- Expect less customization or application-specific performance than a model adapted to your own requirements. section 1.4.2
- Build and host a model when training-data control and fine-tuning matter enough to justify substantial computational resources and machine-learning expertise. section 1.4.2
Astra conversational application
Astra uses OpenAI's REST APIs to power a conversational interface. A user enters “Tell me a dad joke,” and the application sends the request to a pretrained language model, then displays the generated response. The implementation can use React with Express.js or Next.js, with ephemeral conversation storage, input validation, sanitization, error handling, and Vitest unit tests. section 2.1 section 2.2.2
Figure 2.1 A simple conversational UI demonstrating a user query and an LLM-generated response
Use the conversational UI figure to see the user query and generated model response as a complete application interaction. section 2.1






