Skip to main content
AI on Kubernetes · GPU/NPULesson 8 of 20

Getting a Model Ready to Deploy

A model on Hugging Face does not make a serving Pod start fast. Tens to hundreds of GB of weights have to be pulled → packaged for deployment → pre-pulled onto GPU nodes. Follow what each stage does and what it leaves behind.

Raw weights—
Model artifact—
Node cache—
Pipeline · control planeStorage · GPU nodesML engineermodel + revisionWorkflowe.g. Argo WorkflowsAPI serverKubernetesCredentialsSecretDownload Jobfetch weightsHF · S3model sourceGPU nodenode-local cacheBuild Jobpackage as OCIRegistryOCI model artifactObject storageraw weightsmodel, revision, source
RequestResponse / reportAppears in a later step

What you will learn

  • How raw weights differ from a deployable artifact
  • Why models are stored as OCI artifacts in a registry
  • How models get pre-pulled onto GPU nodes
  • What happens when the cache is missing or evicted

Ways to deliver model files​

Download at startupUnpack onto a PVCOCI artifact + node cache
First start timeLong, every timeDepends on volume performanceShort when cached
VersioningDepends on pinned revisionManaged by path conventionsTags and digests
What to watchExternal network, tokensStorage readable from many nodesNode disk size, image GC

Try it yourself​

kubectl get jobs -n <namespace> # Import and build Job progress (steps 2, 5)
kubectl get job <name> -n <namespace> -o jsonpath='{.spec.backoffLimit} {.spec.activeDeadlineSeconds}' # Retry count and time limit
kubectl get daemonsets -A -o wide # Pre-pull DaemonSet ready on GPU nodes (step 7)
kubectl describe pod <pod> | grep -iE 'pulling|pulled' # Model pull time (step 8)
crictl images # On the node: is the cache there?

Check yourself

  1. Why pin the Hugging Face revision to a commit hash instead of using main?
  2. A serving Pod sits in ContainerCreating with a lingering Pulling image event on one GPU node. What is most likely?
  3. Why keep the raw weights in object storage after packaging them as an OCI artifact?

Further reading: Images · Image volumes · KServe OCI model storage · Garbage Collection · Jobs