587: Add minimal AI model inference example (scikit-learn + FastAPI)#591
587: Add minimal AI model inference example (scikit-learn + FastAPI)#591NIRANJAN0125 wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: NIRANJAN0125 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Welcome @NIRANJAN0125! |
|
Hi @NIRANJAN0125, thanks for this PR. One thought for the 'Further Reading' section: Since baking the model into the image works so well here for the Iris dataset, it might be worth adding a small note about using InitContainers or PersistentVolumes for users who are planning to scale this pattern to multi-gigabyte models. It would help them transition from this example to production-scale AI. |
Closes #587
What This PR Adds
A new example under
AI/model-inference-sklearn/demonstrating how to deploya lightweight AI/ML model for real-time inference on Kubernetes -- without GPUs,
specialized hardware, or heavy ML platforms.
This covers the core deployment pattern requested in #587:
Iris dataset, trained during the container build and baked into the image.
/predict,/healthz, and/readyzendpoints.probes, non-root user, read-only root filesystem, seccomp profile,
capabilities dropped, topology spread constraints.
Files
Also updates
AI/README.mdto add an "Available Examples" table listingthis example alongside the existing TensorFlow Serving and vLLM examples.
Verified Locally
train_model.pyproduces a valid model (test accuracy: 1.0)./healthzreturns 200,/readyzreturns 200 after model load./predictreturns correct class labels and probabilities.appropriate 422 responses.
model paths all match across Deployment, Service, PDB, Dockerfile, and
application code.