For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
Agentgateway
Configure an agentgateway deployment as a model endpoint for kagent.
You can route model requests through an agentgateway deployment. Agentgateway is an AI-native proxy that provides traffic management, observability, and security for LLM calls. Because agentgateway exposes an OpenAI-compatible API, you configure the ModelConfig with provider: OpenAI and set openAI.baseUrl to your agentgateway Gateway service address.
Set up agentgateway model routing
Note
The AgentgatewayModel feature is experimental and disabled by default. You must enable it when you install agentgateway by passing --set agentgatewayModels.enabled=true to the control plane Helm chart.
Install agentgateway in your cluster. For more information, see the agentgateway documentation. Add
--set agentgatewayModels.enabled=trueto the Helm command for the agentgateway control plane.Create a
Gatewayresource for model routing.kubectl apply -f - <<EOF apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: agentgateway-proxy namespace: agentgateway-system spec: gatewayClassName: agentgateway listeners: - name: http protocol: HTTP port: 80 allowedRoutes: namespaces: from: All kinds: - group: gateway.networking.k8s.io kind: HTTPRoute - group: agentgateway.dev kind: AgentgatewayModel EOFCreate an
AgentgatewayModelresource for each model that you want kagent to access. The resource name becomes the model name that kagent sends in requests, so it must matchspec.modelin the kagentModelConfig. The following example routes requests forgpt-4o-minito the OpenAI provider. For more provider options and authentication configuration, see the agentgateway model documentation.kubectl apply -f - <<EOF apiVersion: agentgateway.dev/v1alpha1 kind: AgentgatewayModel metadata: name: gpt-4o-mini namespace: agentgateway-system spec: parentRefs: - group: gateway.networking.k8s.io kind: Gateway name: agentgateway-proxy sectionName: http provider: OpenAI EOFSave the agentgateway Gateway service address in an environment variable.
export AGENTGATEWAY_URL=http://agentgateway-proxy.agentgateway-system.svc.cluster.local
Connect to an agentgateway endpoint
Create a
ModelConfigresource. Choose the tab that matches your agentgateway authentication configuration.If your agentgateway deployment does not enforce any API key authentication, apply the following
ModelConfig.kubectl apply -f - <<EOF apiVersion: kagent.dev/v1alpha2 kind: ModelConfig metadata: name: agentgateway-model namespace: kagent spec: provider: OpenAI model: gpt-4o-mini openAI: baseUrl: "$AGENTGATEWAY_URL" EOFReview the following table to understand this configuration. For more information, see the API docs.
Setting Description providerSet to OpenAI, because agentgateway exposes an OpenAI-compatible API.modelThe model name to request from agentgateway. This value must match the name of an AgentgatewayModelresource in your agentgateway deployment.openAI.baseUrlThe Kubernetes service address of your agentgateway Gateway, set in $AGENTGATEWAY_URL.Verify that the
ModelConfigis accepted.kubectl get modelconfig agentgateway-model -n kagent -o yaml
Agentgateway is now added as a model endpoint in kagent. Next, you can create or update an agent to use this model.