liveBook · Manning

Pretrained model

As explained in Build AI-Enhanced Web Apps

A pretrained model is a machine-learning model whose parameters have already been learned from training data before being adapted or used for an application.

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
A screenshot of a chat

AI-generated content may be incorrect.

Use the conversational UI figure to see the user query and generated model response as a complete application interaction. section 2.1

How Build AI-Enhanced Web Apps covers it

How deep it goes
Compares hosted convenience with self-hosted control, but stops short of explaining model internals or training procedures.
Examples
Demonstrates Astra answering a dad-joke request through OpenAI or Gemini-backed conversational interfaces.
What it assumes
Assumes basic web-application work while allowing newcomers to follow preconfigured React, Node.js, Tailwind CSS, and Vite examples.
What you can do after
Apply it via OpenAI REST APIs to add natural-language responses to a React, Express.js, or Next.js application.
How it connects
Connects pretrained models with public APIs, large language models, fine-tuning, React, Express.js, and Next.js.

Also explained in

Compare how 7 books explain pretrained model →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build AI-Enhanced Web Apps. The section links point to the parts of the book it draws on.