liveBook · Manning

Baking model

As explained in LLMs in Production

Baking a model is the technique of packaging model files inside a container image so newly created containers contain the model.

Baking packages a model inside a Docker image, so every newly created container receives the model with the image and needs only one deployment artifact. section 6.1.2

Treat baking as a deliberate trade-off rather than a default storage strategy:

  • Expect poor production boot-time gains: new machines still download the image, and downloading a model inside it may be slower than retrieving the model from object storage. section 6.1.2
  • Accept significant security risk because containers can be easy to access, exposing the packaged model. section 6.1.2
  • Manage two large assets instead of one: the model and the image. section 6.1.2
  • Consider baking for edge deployments or other environments where one self-contained image substantially simplifies delivery. section 6.1.2

A self-contained edge service

An edge device can deploy one image containing both the service and its model, avoiding a separate model download while accepting larger images, weaker security, and potentially slower startup. section 6.1.2

Figure 6.3 Different strategies for storing LLMs and their implications at boot time. Often, we have to balance system reliability, complexity, and application load time.
figure

Compare baking with other LLM storage strategies by balancing reliability, complexity, and application load time. section 6.1.2

How LLMs in Production covers it

How deep it goes
Explains the packaging mechanism, boot-time drawbacks, security risks, duplicated assets, and viable deployment context.
Examples
Uses a self-contained image deployed to an edge device as the main viable example.
What you can do after
Evaluate baking against object storage by weighing deployment simplicity, startup time, security, and asset management.
How it connects
Connects model storage with Docker images, containers, object storage, boot time, security, and edge deployment.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of LLMs in Production. The section links point to the parts of the book it draws on.