diff --git a/docs-site/assets/conrefs/snippets/field-desc/review-table.md b/docs-site/assets/conrefs/snippets/field-desc/review-table.md new file mode 100644 index 00000000..2ab68fa4 --- /dev/null +++ b/docs-site/assets/conrefs/snippets/field-desc/review-table.md @@ -0,0 +1 @@ +Review the following table to understand this configuration. \ No newline at end of file diff --git a/docs-site/content/kagent/supported-providers/byo-agentgateway.md b/docs-site/content/kagent/supported-providers/byo-agentgateway.md new file mode 100644 index 00000000..4c0095cc --- /dev/null +++ b/docs-site/content/kagent/supported-providers/byo-agentgateway.md @@ -0,0 +1,140 @@ +--- +title: Agentgateway +description: Configure an agentgateway deployment as a model endpoint for kagent. +weight: 9 +author: kagent.dev +--- + +You can route model requests through an [agentgateway](https://agentgateway.dev/docs/) 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 {#setup} + +> [!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. + +1. Install agentgateway in your cluster. For more information, see the [agentgateway documentation](https://agentgateway.dev/docs/kubernetes/latest/setup/). Add `--set agentgatewayModels.enabled=true` to the Helm command for the agentgateway control plane. + +2. Create a `Gateway` resource for model routing. + ```yaml + kubectl apply -f - <}} + {{% tab name="No authentication" %}} + If your agentgateway deployment does not enforce any API key authentication, apply the following `ModelConfig`. + ```yaml + kubectl apply -f - <}} For more information, see the [API docs](https://kagent.dev/docs/kagent/resources/api-ref#modelconfigspec). + + | Setting | Description | + | --- | --- | + | `provider` | Set to `OpenAI`, because agentgateway exposes an OpenAI-compatible API. | + | `model` | The model name to request from agentgateway. This value must match the name of an `AgentgatewayModel` resource in your agentgateway deployment. | + | `openAI.baseUrl` | The Kubernetes service address of your agentgateway Gateway, set in `$AGENTGATEWAY_URL`. | + {{% /tab %}} + {{% tab name="API key authentication" %}} + If your agentgateway deployment applies an `apiKeyAuthentication` policy with `mode: Strict`, you must provide an API key in the `ModelConfig`. + + 1. Save the API key that the agentgateway `apiKeyAuthentication` policy requires. This is the key that clients must send in the `Authorization` header when they call agentgateway. Create a Kubernetes secret in the same namespace as your agent, such as `kagent`. + ```bash + export AGENTGATEWAY_API_KEY= + kubectl create secret generic kagent-agentgateway-key -n kagent \ + --from-literal AGENTGATEWAY_API_KEY=$AGENTGATEWAY_API_KEY + ``` + + 2. Create the `ModelConfig` resource. + ```yaml + kubectl apply -f - <}} For more information, see the [API docs](https://kagent.dev/docs/kagent/resources/api-ref#modelconfigspec). + + | Setting | Description | + | --- | --- | + | `provider` | Set to `OpenAI`, because agentgateway exposes an OpenAI-compatible API. | + | `model` | The model name to request from agentgateway. This value must match the name of an `AgentgatewayModel` resource in your agentgateway deployment. | + | `apiKeySecret` | The name of the Kubernetes secret that stores your agentgateway API key. | + | `apiKeySecretKey` | The key in the secret that stores your API key. | + | `openAI.baseUrl` | The Kubernetes service address of your agentgateway Gateway, set in `$AGENTGATEWAY_URL`. | + {{% /tab %}} + {{< /tabs >}} + +2. Verify that the `ModelConfig` is accepted. + ```bash + 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](https://kagent.dev/docs/kagent/getting-started/first-agent) to use this model. \ No newline at end of file