Deploying Llama Stack
Understanding Llama Stack
Llama Stack is an open source standardized, opinionated framework for building and deploying generative AI applications. It provides a unified API interface and building blocks that abstract the complexity of working with large language models, enabling developers to focus on building agentic AI applications rather than managing infrastructure.
As part of Red Hat AI 3 running on this lab, Llama Stack brings enterprise-grade capabilities for deploying production AI workloads with the scalability, security, and operational excellence that Red Hat platforms provide.
What is Llama Stack?
Llama Stack is designed around the concept of distributions - pre-configured stacks that combine inference engines, model providers, and additional capabilities like retrieval-augmented generation (RAG), safety guardrails, and tool execution. Each distribution is a composition of:
-
Inference providers: vLLM, AWS Bedrock, Fireworks AI, Together AI, and others
-
Memory and vector stores: For conversational context and retrieval
-
Safety components: Content moderation and guardrails
-
Tool runtime: Integration with external systems and APIs
-
Agent framework: Orchestration for multi-step reasoning
Chat Interfaces
Custom Tools] end subgraph API["Llama Stack Unified API Layer"] INF[Inference API] AGT[Agents API] RAG[RAG API] SAF[Safety API] MEM[Memory API] TOL[Tools API] end subgraph Distribution["Distribution Layer"] PROV[Provider Adapters
vLLM, Bedrock, Fireworks] VECT[Vector Stores
Chroma, FAISS] SAFE[Safety Runtime
Llama Guard] TOOL[Tool Runtime
Built-in Tools] end subgraph Infra["Infrastructure Layer"] OCP[OpenShift Platform] VLLM[vLLM Instances] EXT[External APIs] end APP --> INF APP --> AGT APP --> RAG APP --> SAF APP --> MEM APP --> TOL INF --> PROV AGT --> PROV RAG --> VECT SAF --> SAFE MEM --> VECT TOL --> TOOL PROV --> OCP PROV --> VLLM VECT --> OCP SAFE --> OCP TOOL --> OCP TOOL --> EXT style Application fill:#e1f5ff style API fill:#fff4e1 style Distribution fill:#e8f5e9 style Infra fill:#f3e5f5
Why use Llama Stack with Red Hat AI?
Llama Stack on Red Hat OpenShift provides several key advantages for enterprise AI deployments:
- Standardization and portability
-
The unified API allows you to switch between different model providers (vLLM, AWS Bedrock, Azure OpenAI) without rewriting application code. This helps to address vendor lock-in across hybrid cloud deployments.
- Enterprise-grade operations
-
Running on OpenShift provides automated deployment, scaling, monitoring, and security features. The Llama Stack operator manages the lifecycle of your AI infrastructure using Kubernetes-native patterns.
- Production-ready tooling
-
Llama Stack includes built-in capabilities for production AI applications:
-
Agent framework: Multi-turn conversations with tool calling and reasoning
-
RAG support: Vector storage and retrieval for knowledge-grounded responses
-
Safety guardrails: Content moderation and prompt injection protection
-
Observability: OpenAPI-compliant endpoints with health checks and monitoring
-
- Model flexibility
-
Support for multiple model hosting approaches in a single distribution:
-
Local inference: Using vLLM for low-latency, cost-effective serving
-
Model-as-a-Service: Integration with cloud providers like AWS Bedrock
-
Mixed deployments: Combine local and remote models based on workload requirements
-
- Developer experience
-
The OpenAPI specification and client SDKs in Python, Node.js, and other languages provide a consistent developer experience. The same code works across development, staging, and production environments.
Port: 8321
Distribution: starter
Storage: PVC 20Gi] VLLM_SVC[vLLM Service
Model-as-a-Service
Qwen3-14B] subgraph AGENT["Agent Application"] FRONT[Frontend Pod
Chat UI - Node.js] BACK[Backend Pod
Python Agent] end end ROUTE[Routes/Ingress
chat-ui.apps.cluster.example.com] end subgraph RHAI["Red Hat OpenShift AI 3"] SERVE[Model Serving
vLLM] GPU[GPU Acceleration
Intel Gaudi, Nvidia, etc] MLOPS[MLOps Pipelines] end end FRONT --> BACK BACK --> LLS LLS --> VLLM_SVC VLLM_SVC --> SERVE SERVE --> GPU ROUTE --> FRONT style OCP fill:#e3f2fd style NS fill:#fff3e0 style CRD fill:#e8f5e9 style AGENT fill:#fce4ec style RHAI fill:#f3e5f5
Llama Stack distributions
A distribution defines which providers and capabilities are available in your Llama Stack deployment. The starter distribution includes:
-
Inference: vLLM for local model serving, with optional cloud provider support
-
Vector databases: For RAG and semantic search
-
Tool runtime: Built-in tools for web search (Tavily) and RAG
-
Safety: Content moderation and guardrails
-
Agent orchestration: Multi-turn conversations with tool calling
This lab uses the starter distribution with vLLM as the primary inference provider, configured to use OpenShift AI’s Model-as-a-Service (MaaS) capability.
Deploying your Llama Stack instance
First of all, in both Terminal 1 and Terminal 2 login to your OpenShift cluster with provided credentials {user} and {password}:
{login_command}
And answer y to the Use insecure connections
The server uses a certificate signed by an unknown authority.
You can bypass the certificate check, but any data you send to the server could be intercepted by others.
Use insecure connections? (y/n): y
You should successfully login with your user and see your project agentic-{user} who has been already created for you:
Login successful.
You have one project on this server: "agentic-{user}"
Using project "agentic-{user}".
Welcome! See 'oc help' to get started.
Your cluster and namespace have a Custom Resource Definition (CRD) available for the Kind LlamaStackDistribution therefore you can create your own instance of a Llama Stack Server.
|
What is a CRD? A Custom Resource Definition extends the Kubernetes API with new resource types. The |
Using Terminal 1, check if the LlamaStackDistribution CRD is available:
oc api-resources | awk 'NR==1 || $1 ~ /llama/ {print $5 "\t" $4}' | column -t
KIND NAMESPACED
LlamaStackOperator
LlamaStackDistribution true
The lab materials are stored in a GitHub repository, you can find the URL in the Resources section of this page.
Now, git-clone a copy of the project files into your home directory:
cd $HOME
git clone https://github.com/burrsutter/fantaco-redhat-one-2026
cd fantaco-redhat-one-2026/
Red Hat OpenShift AI 3 comes with a supported version of Llama Stack Operator and a supported Llama Stack distribution named rh-dev.
The LlamaStack setup is configurable using a ConfigMap and the Llama StackDistribution CR as follows:
oc apply -f llama-stack-scripts/llamastack-configmap.yaml
configmap/llama-stack-config created
oc get cm
NAME DATA AGE
config-service-cabundle 1 65m
config-trusted-cabundle 1 65m
kube-root-ca.crt 1 65m
llama-stack-config 1 8s
odh-kserve-custom-ca-bundle 1 63m
odh-trusted-ca-bundle 2 64m
openshift-service-ca.crt 1 65m
|
What does the ConfigMap configure? The |
You can also view the llamastack configuration in the ConfigMap via the oc command.
oc get configmap llama-stack-config -o jsonpath='{.data.run\.yaml}' ; echo
You can review the models available on the provided Model as a Service - MaaS using the following command:
curl -sS {litellm_api_base_url}/models -H "Authorization: Bearer {litellm_virtual_key}" | jq
Review the Llama Stack Server manifest below and apply by copy and paste the command in the terminal in order to install a Llama Stack Distribution for vLLM using Model-as-a-Service (MaaS):
|
Key fields in the manifest below:
|
oc apply -f - <<'EOF'
apiVersion: llamastack.io/v1alpha1
kind: LlamaStackDistribution
metadata:
annotations:
openshift.io/display-name: llamastack-distribution-vllm
name: llamastack-distribution-vllm
labels:
opendatahub.io/dashboard: 'true'
spec:
replicas: 1
server:
containerSpec:
command:
- /bin/sh
- '-c'
- llama stack run /etc/llama-stack/run.yaml
env:
- name: VLLM_TLS_VERIFY
value: 'false'
- name: MILVUS_DB_PATH
value: ~/.llama/milvus.db
- name: FMS_ORCHESTRATOR_URL
value: 'http://localhost'
- name: VLLM_MAX_TOKENS
value: '4096'
- name: VLLM_API_URL
value: '{litellm_api_base_url}'
- name: VLLM_API_TOKEN
value: '{litellm_virtual_key}'
- name: LLAMA_STACK_CONFIG_DIR
value: /opt/app-root/src/.llama/distributions/rh/
name: llama-stack
port: 8321
resources:
limits:
cpu: '2'
memory: 12Gi
requests:
cpu: 250m
memory: 500Mi
distribution:
name: rh-dev
userConfig:
configMapName: llama-stack-config
EOF
llamastackdistribution.llamastack.io/llamastack-distribution-vllm created
In Terminal 2, check that the LlamaStack pod is running, it will takes a few seconds to init and start.
oc get pods -w
NAME READY STATUS RESTARTS AGE
llamastack-distribution-vllm-94bf699bf-84sx9 1/1 Running 0 2m59s
| You can stop watching the pod with CTRL+C |
In Terminal 1, check LlamaStack service, we will use it to connect to LlamaStack within the namespace:
oc get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
llamastack-distribution-vllm-service ClusterIP 172.231.210.76 <none> 8321/TCP 3m46s
|
What just happened? The Llama Stack Operator saw your |
If you see the pod and service then congratulations, you have a successfully deployed Llama Stack. In the next chapter, you will be exploring Llama Stack.