Skip to main content
LLM Inference in Production
[Continued]
Suresh Peiris
GDG Sri Lanka Organizer
Co-Founder Inforwaves
Topics to be covered
1.Usage Patterns
2.Managed AI Services
3.Model Garden
4.Vector Stores on Cloud
5.MLOps/ LLMOps
6.AI Meets Kubernetes
7.Kube Flow Architecture
8.Serving LLMs on Kube Flow
9.AI Agents [additional]
10.Q & A
●Closed: cloud hosted model, eg: OpenAI GPT4 via API, Gemini 2 via API
●Open-source model:
○Accessed as cloud service API
○Run in your own cloud account
○Run in your datacenter
○Run on your laptop
LLM Usage Patterns: Operations
Managed Services
Model Garden
Vector Stores on Cloud
Fully Managed
Unmanaged /
Managed
Vector Search on Vertex AI
https://cloud.google.com/vertex-ai/docs/vector-search/overview
Fully - User Managed?
Scalable?
MLOps stands for Machine Learning Operations.
MLOps is a core function of Machine Learning
engineering, focused on streamlining the process
of taking machine learning models to production,
and then maintaining and monitoring them.
A Quick Intro to MLOps
●Kubernetes is a Container Orchestration platform.
●Specialized ML platform that is built for Kubernetes
●Collection of Pods and provides container images to
run ML workloads in Kubernetes Pods
Kubeflow and Kubernetes
What is a Kubernetes Cluster? ***
● Set of worker machines, called nodes, that run
containerized applications.
● The worker nodes host the Pods which have
Containers (subsequent slides)
● Pods host the the components of distributed
stateful application and workloads
Kubernetes Clusters
Why Relevant to Kubeflow Ecosystem?
● Kubeflow, running on Kubernetes Cluster,
provides Data Scientists and MLOps professionals
a way to automate execution, resource
management and administration of environment.
What is a Container? ***
● Similar to VMs w/ relaxed isolation properties to
share the Operating System (OS) among the
applications.
● Filesystem, share of CPU, memory, process space,
and more.
● Decoupled from the underlying infrastructure
therefore are portable across clouds and OS
distributions.
Containers in K8s
Why Relevant to Kubeflow Ecosystem?
● Kubeflow takes advantage of container isolation
to ensure machine learning stages are easily
portable and reproducible across machines and
clouds.
What is a Pod? ***
● Smallest deployable units of computing that you
can create and manage in Kubernetes.
● Group of one or more containers, with shared
storage and network resources, and a
specification for how to run the containers.
Pods in K8s
Why Relevant to Kubeflow Ecosystem?
● Kubeflow components run in Pods which
simplifies container management as well as
resource management during Notebook
Creation, Pipeline Execution and Model Serving.
What is an Operator?? ***
● Enables automation of common processes in
Kubernetes and extends the API. This includes
the application or infrastructure we want to
manage, a way to declare it (yaml!) and a loop to
constantly babysit and adjust our clusters state.
Operators & Controllers in K8s
Why Relevant to Kubeflow Ecosystem?
● Kubeflow operators and controllers support
MLOps and Data Science Model Development Life
Cycle, some examples are:
○ Training Operator: Kubernetes custom
resource that makes it easy to run distributed
or non-distributed TensorFlow/PyTorch/Apache
MXNet/XGBoost/MPI jobs on Kubernetes.
○ Notebook Controller: allows users to create the
custom resource "Notebook"
Visualizing Kubernetes
Portability
Write code once, and it will
be reproducible and
executable anywhere
Why ML on K8s?
Microservices
Workflows often need to
interact with multiple
services
Scalability
Adapting to varying demands by
scaling both up and down is
crucial for ensuring a seamless
service
Monitoring
Constant monitoring is
required to fulfil additional
requirements.
Kubeflow, introduced by Google, is an open-source platform for
machine learning and MLOps on Kubernetes.
It is a complete toolkit for an ML workflow including data, training,
tuning, serving, monitoring and automated ML.
Dev vs Prod
●Overview
●Notebook Servers
●TensorBoards
●Models
●Volumes
●Experiments (AutoML)
●Experiments (KFP)
Central Dashboard
●Pipelines
●Runs
●Recurring Runs
●Artifacts
●Executions
●Manage Contributors
Kubeflow Notebooks
●Provides a way to run web-based
development environments inside
a Kubernetes Cluster
●The IDE is determined by the
container image
●Develop Notebooks using Python
Code via the web IDE
●Deploy Kubeflow Pipelines from
Notebook w/ Kale
●Notebook Servers run as
containers inside a Kubernetes
Pod
Kubeflow Pipelines (kfp)
A pipeline is a definition of a workflow
that composes one or more
components together to form a
computational directed acyclic graph
(DAG).
KALE
KALE (Kubeflow Automated Pipelines Engine) is a project that aims at simplifying the
Data Science experience of deploying Kubeflow Pipelines workflows.
For hyperparameter tuning, neural architecture search
Katib works as a component of Kubeflow.
Katlib
●TensorFlow Training (TFJob)
●PaddlePaddle Training (PaddleJob)
●PyTorch Training (PyTorchJob)
●MXNet Training (MXJob)
●XGBoost Training (XGBoostJob)
●MPI Training (MPIJob)
●Job Scheduling
Training Operators
KServe
● is a Model Inference Platform that runs on Kubernetes, built for highly scalable use cases
● provides a performant, standardized inference protocol across ML frameworks
● supports serverless inference workload with Autoscaling, including Scale to Zero on GP
● provides high scalability, density packing, intelligent routing using ModelMesh
● provides simple and pluggable production serving including prediction, pre/post processing, monitoring
and explainability
● advanced deployments with canary rollout, experiments, ensembles and transformers
Serving LLMs on Kubeflow
https://kserve.github.io/website/latest/modelserving/v1beta1/llm/huggingface/text_generation/#serve-the-hugging-face-llm-model-using-vllm-backend
Installing Kubeflow
https://www.kubeflow.org/docs/started/installing-kubeflow/
Installing Kubeflow on Google Cloud
https://www.kubeflow.org/docs/started/installing-kubeflow/
Agent Builder…
Agents?
https://bit.ly/KubeflowWorkshop
Contact me on:
• Linkedin:
https://www.linkedin.com/in/sureshmichael
/
• Twitter:
https://twitter.com/TSMPeiris
• Email:
suresh@inforwaves.com
Questions and
Answers