# Gateway API Inference Extension Type of document: How-to guide Product: F5 NGINX Gateway Fabric > Use the Gateway API Inference Extension with NGINX Gateway Fabric to route traffic to self-hosted AI models. --- Learn how to use NGINX Gateway Fabric with the Gateway API Inference Extension to optimize traffic routing to self-hosted Generative AI models on Kubernetes. ## Overview The [Gateway API Inference Extension](https://gateway-api-inference-extension.sigs.k8s.io/) is an official Kubernetes project that aims to provide optimized load-balancing for self-hosted generative AI models on Kubernetes. The project's goal is to improve and standardize routing to inference workloads across the ecosystem. Coupled with the provided llm-d Router, NGINX Gateway Fabric becomes an [Inference Gateway](https://gateway-api-inference-extension.sigs.k8s.io/#concepts-and-definitions). An Inference Gateway adds AI-specific traffic management features, such as model-aware routing, serving priority for models, and model rollouts. ## Set up Install the Gateway API Inference Extension CRDs: ```shell kubectl kustomize "https://github.com/nginx/nginx-gateway-fabric/config/crd/inference-extension/?ref=v" | kubectl apply -f - ``` To enable the Gateway API Inference Extension, [install](/ngf/install/) NGINX Gateway Fabric with these modifications: - Using Helm: set the `nginxGateway.gwAPIInferenceExtension.enable=true` Helm value. - Using Kubernetes manifests: set the `--gateway-api-inference-extension` flag in the nginx-gateway container argument, update the ClusterRole RBAC to add the `inferencepools`: ```yaml - apiGroups: - inference.networking.k8s.io resources: - inferencepools verbs: - get - list - watch - apiGroups: - inference.networking.k8s.io resources: - inferencepools/status verbs: - update ``` See this [example manifest](https://raw.githubusercontent.com/nginx/nginx-gateway-fabric/main/deploy/inference/deploy.yaml) for clarification. **Note:** To verify the llm-d router certificate, attach a BackendTLSPolicy to the llm-d router Service. If no BackendTLSPolicy targets the llm-d router Service, NGINX Gateway Fabric connects over TLS but skips certificate verification. For the steps, see **Configure TLS verification for the llm-d router**. You can also change how NGINX Gateway Fabric connects to the llm-d router: - To skip certificate verification even when a BackendTLSPolicy exists, set the `nginxGateway.gwAPIInferenceExtension.endpointPicker.skipVerify=true` Helm value or the `--endpoint-picker-tls-skip-verify=true` flag. - To turn off TLS, set the `nginxGateway.gwAPIInferenceExtension.endpointPicker.disableTLS=true` Helm value or the `--endpoint-picker-disable-tls` flag. Use this option only for development, testing, or a service mesh that encrypts the traffic. ### Set up cert-manager This guide uses cert-manager to issue the llm-d router certificate from a local certificate authority (CA). If your cluster already has cert-manager and the `local-ca-issuer` ClusterIssuer, go to **Create a TLS certificate for the llm-d router**. Install cert-manager onto the cluster using Helm with Gateway API features enabled. - Add the Helm repository. ```shell helm repo add jetstack https://charts.jetstack.io helm repo update ``` - Install cert-manager, and enable the GatewayAPI feature gate: ```shell helm install \ cert-manager jetstack/cert-manager \ --namespace cert-manager \ --create-namespace \ --set config.apiVersion="controller.config.cert-manager.io/v1alpha1" \ --set config.kind="ControllerConfiguration" \ --set config.enableGatewayAPI=true \ --set crds.enabled=true ``` Create a self-signed `ClusterIssuer`, a CA `Certificate`, and a CA-backed `ClusterIssuer`. cert-manager uses the resulting `local-ca-issuer` to sign certificates in any namespace: ```yaml kubectl apply -f - < ``` Replace `` with the port number you use to access your Gateway. ## Deploy an HTTPRoute ```yaml kubectl apply -f - <