Chapter 2. Gateway discovery for Distributed Inference with llm-d
Discover and select existing Kubernetes Gateway resources when deploying LLMInferenceService models. This Technology Preview feature builds on distributed inference capabilities by providing visibility into available Gateways.
Gateway discovery for Distributed Inference with llm-d is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.
For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.
2.1. Gateway discovery for Distributed Inference with llm-d Copy linkLink copied to clipboard!
When deploying LLMInferenceService models, you can discover and select an existing Kubernetes Gateway resource directly from the model serving UI. This eliminates the need to manually configure a Gateway reference and provides visibility into which Gateway you have permission to use.
Gateway discovery is disabled by default and must be enabled by a cluster administrator through the dashboard configuration resource.
Which Gateways appear in the dropdown?
A Gateway is available only when both of the following conditions are met:
-
RBAC permissions: You must have permissions to create
LLMInferenceServiceresources in the target namespace. - Listener configuration: The Gateway must include a listener configured to accept routes from the target namespace.
To deploy models with specific Gateway configurations or to reference multiple Gateways, use the YAML-based deployment approach. For more information, see Select Gateway using YAML.
The system does not validate against a specific GatewayClass resource or its controller. The default OpenShift Gateway controller provides all Distributed Inference with llm-d features. Third-party Gateway controllers might be incompatible with Distributed Inference with llm-d.
2.2. Enable Gateway discovery in the dashboard Copy linkLink copied to clipboard!
Enable Gateway discovery in the OpenShift AI dashboard so that you can discover and select Kubernetes Gateway resources during model deployment.
Prerequisites
- You have cluster administrator access to OpenShift.
- You have enabled distributed inference with the Gateway API installed. For more information, see Enabling distributed inference.
Procedure
Enable Gateway discovery in the dashboard configuration:
$ oc patch odhdashboardconfig odh-dashboard-config \ -n redhat-ods-applications \ --type merge \ -p '{"spec":{"dashboardConfig":{"llmGatewayField":true}}}'
Verification
- Log in to the OpenShift AI dashboard.
- In the navigation menu, click AI Hub.
- Click a project name, then click Deploy model.
- Verify that the Gateway field is displayed in Advanced Settings.
2.3. Select a Gateway from the model deployment wizard Copy linkLink copied to clipboard!
You can discover and select an existing Kubernetes Gateway resource during an LLMInferenceService deployment through the OpenShift AI model deployment wizard. The Gateway can be the shared openshift-ai-inference Gateway configured during distributed inference setup or a namespace-scoped Gateway.
If you edit a deployment with multiple Gateways through the model deployment wizard UI, the Gateway Selection field displays only the first Gateway. Gateway selection does not support MaaS Gateways.
Prerequisites
- You have enabled distributed inference as described in Enabling distributed inference.
- Gateway discovery is enabled in the dashboard. For more information, see Enabling Gateway discovery in the dashboard.
-
You have permission to create
LLMInferenceServiceresources in your namespace. - At least one Gateway exists with a listener configured to accept routes from your namespace.
- You have a model stored in S3-compatible storage, a persistent volume claim (PVC), or an OCI container registry or accessible through a URI.
Procedure
- Log in to the OpenShift AI dashboard.
- In the navigation menu, click AI Hub.
- Click the name of the project that you want to deploy a model in.
- Click Deploy model.
- Configure the model deployment properties as required for your model. For more information, see Deploying models on the single-model serving platform.
- In Advanced Settings, locate the Gateway Selection section.
- In the Gateway section, locate the Select a gateway dropdown.
- Select the Gateway from the dropdown list.
- Click Next.
- Click Deploy Model.
Verification
-
On the Models page, verify that the
LLMInferenceServiceis listed with a checkmark in the Status column. - Click the deployed model name to view details.
Verify that the Gateway reference is configured in the deployed model resource:
$ oc get llminferenceservices <llmisvc_name> -n <namespace> -o yamlwhere:
<llmisvc_name>-
Specifies the name of your
LLMInferenceService. <namespace>Specifies the project namespace where you deployed the model.
The output includes the Gateway reference configuration. The Gateway reference appears under
spec.router.gateway.
Troubleshooting
- The Gateway dropdown is empty or does not show any available Gateways
-
Check RBAC permissions: You might not have permission to create
LLMInferenceServiceresources in your namespace. Contact your cluster administrator to verify your RBAC permissions. -
Check listener configuration: You might not have Gateways that are configured to accept routes from your namespace. Verify that at least one Gateway has a listener configured with
allowedRoutes.namespacesthat includes your namespace.
-
Check RBAC permissions: You might not have permission to create
2.4. Select Gateway using YAML Copy linkLink copied to clipboard!
Select Kubernetes Gateway resources for an LLMInferenceService deployment by creating the resource using YAML. This approach enables you to reference multiple Gateways or specify detailed Gateway configurations that are not available through the model deployment wizard.
If you edit a deployment with multiple Gateways through the model deployment wizard UI, the Gateway Selection field displays only the first Gateway. Gateway selection does not support MaaS Gateways.
Prerequisites
- You have enabled distributed inference as described in Enabling distributed inference.
-
You have permission to create
LLMInferenceServiceresources in your namespace. - At least one Gateway exists with a listener configured to accept routes from your namespace.
- You have a model stored in S3-compatible storage, a persistent volume claim (PVC), an OCI container registry, or accessible through a URI.
Procedure
Create a YAML file for your
LLMInferenceServicewith Gateway references:apiVersion: serving.kserve.io/v1alpha1 kind: LLMInferenceService metadata: name: <llmisvc_name> namespace: <namespace> spec: modelSource: storageUri: <storage_uri> runtime: name: <runtime_name> router: gateway: refs: - name: <gateway_name> namespace: <gateway_namespace>where:
<llmisvc_name>-
Specifies the name for your
LLMInferenceService. <namespace>- Specifies your project namespace.
<storage_uri>-
Specifies the location of your model, such as
s3://my-bucket/my-model/orpvc://my-pvc/my-model/. <runtime_name>-
Specifies the serving runtime to use, such as
vllm-runtime. <gateway_name>- Specifies the name of the Gateway to use.
<gateway_namespace>- Specifies the namespace where the Gateway is located.
To reference multiple Gateways, add additional entries to the
refslist:router: gateway: refs: - name: <gateway_name_1> namespace: <gateway_namespace_1> - name: <gateway_name_2> namespace: <gateway_namespace_2>Apply the YAML file:
$ oc apply -f <filename>.yaml
Verification
Verify that the
LLMInferenceServicewas created:$ oc get llminferenceservices <llmisvc_name> -n <namespace>where:
<llmisvc_name>-
Specifies the name of your
LLMInferenceService. <namespace>- Specifies your project namespace.
Verify the Gateway references in the deployed resource:
$ oc get llminferenceservices <llmisvc_name> -n <namespace> -o yamlThe output includes the Gateway reference configuration under
spec.router.gateway.refs.Verify that the
LLMInferenceServiceis ready:$ oc get llminferenceservices <llmisvc_name> -n <namespace> -o jsonpath='{.status.conditions[?(@.type=="Ready")].status}'The output should be
Truewhen the service is ready.