docs: add standalone AI Gateway docs - #27794
Conversation
Documents standalone AI Gateway deployment, Gateway key authentication, monitoring, and the updated embedded vs standalone topology in the AI Gateway docs. --------- Co-authored-by: Cian Johnston <[email protected]>
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here.
|
|
👋 Hey @pawbana! This PR is targeting the Only bug fixes should be cherry-picked to release branches. If this is a bug fix, please update the PR title to match the conventional commit format: If this is not a bug fix, it likely should not target a release branch. |
Documentation CheckLatest push ( Updates Needed
Re-verified on the current head: Automated review via Coder Agents |
nickvigilante
left a comment
There was a problem hiding this comment.
Great start to this! I'm requesting a few changes about casing for the word "gateway" in this PR. To clarify:
- If you're talking specifically about the AI Gateway feature, the G is capitalized.
- If you're talking about an individual gateway within Coder itself (independent of Kubernetes), the g is lowercase.
- If you're talking about the Gateway object in Kubernetes specifically and not the AI Gateway feature or a specific gateway within Coder, the G is capitalized.
So if I got the gateways mixed up and made too many Gateways lowercase, feel free to ignore those comments.
| [AI Gateway](../../../ai-coder/ai-gateway/index.md) proxies AI provider traffic | ||
| and records each AI session. It runs inside `coderd` by default, and can also | ||
| run as a [standalone deployment](../../../ai-coder/ai-gateway/standalone.md) | ||
| that scales independently of the control plane. Size replicas from your own AI | ||
| request volume and `CODER_AI_GATEWAY_MAX_CONCURRENCY`. For the chart's resource | ||
| requests and autoscaling defaults, refer to the | ||
| [AI Gateway Helm chart README](https://github.com/coder/coder/blob/main/helm/ai-gateway/README.md). |
There was a problem hiding this comment.
| [AI Gateway](../../../ai-coder/ai-gateway/index.md) proxies AI provider traffic | |
| and records each AI session. It runs inside `coderd` by default, and can also | |
| run as a [standalone deployment](../../../ai-coder/ai-gateway/standalone.md) | |
| that scales independently of the control plane. Size replicas from your own AI | |
| request volume and `CODER_AI_GATEWAY_MAX_CONCURRENCY`. For the chart's resource | |
| requests and autoscaling defaults, refer to the | |
| [AI Gateway Helm chart README](https://github.com/coder/coder/blob/main/helm/ai-gateway/README.md). | |
| [AI Gateway](../../../ai-coder/ai-gateway/index.md) proxies AI provider traffic and records each AI session. | |
| It runs inside `coderd` by default, and can also run as a [standalone deployment](../../../ai-coder/ai gateway/standalone.md) that scales independently of the control plane. | |
| Size replicas from your own AI request volume and `CODER_AI_GATEWAY_MAX_CONCURRENCY`. | |
| For the chart's resource requests and autoscaling defaults, refer to the [AI Gateway Helm chart README (https://github.com/coder/coder/blob/main/helm/ai-gateway/README.md). |
| Standalone replicas hold no durable state. `coderd` is the source of truth and the only component that writes AI Gateway state to the database. | ||
| Each replica maintains a control connection to `coderd` for Coder API key validation, provider configuration, and AI session recording, and becomes unready when that connection is unavailable. |
There was a problem hiding this comment.
| Standalone replicas hold no durable state. `coderd` is the source of truth and the only component that writes AI Gateway state to the database. | |
| Each replica maintains a control connection to `coderd` for Coder API key validation, provider configuration, and AI session recording, and becomes unready when that connection is unavailable. | |
| Standalone replicas hold no durable state. | |
| `coderd` is the source of truth and the only component that writes AI Gateway state to the database. | |
| Each replica maintains a control connection to `coderd` for Coder API key validation, provider configuration, and AI session recording, and becomes unready when that connection is unavailable. |
| If you run a [standalone AI Gateway](../../ai-coder/ai-gateway/standalone.md), | ||
| each replica exports its own metrics on its own listener. Its Helm chart uses the | ||
| same `0.0.0.0:2112` default as the `coder` chart, but sets up no scrape | ||
| discovery. Refer to | ||
| [AI Gateway monitoring](../../ai-coder/ai-gateway/monitoring.md#kubernetes-discovery) | ||
| for more details. |
There was a problem hiding this comment.
| If you run a [standalone AI Gateway](../../ai-coder/ai-gateway/standalone.md), | |
| each replica exports its own metrics on its own listener. Its Helm chart uses the | |
| same `0.0.0.0:2112` default as the `coder` chart, but sets up no scrape | |
| discovery. Refer to | |
| [AI Gateway monitoring](../../ai-coder/ai-gateway/monitoring.md#kubernetes-discovery) | |
| for more details. | |
| If you run a [standalone AI gateway](../../ai-coder/ai-gateway/standalone.md), each replica exports its own metrics on its own listener. | |
| Its Helm chart uses the same `0.0.0.0:2112` default as the `coder` chart, but sets up no scrape discovery. | |
| Refer to [AI gateway monitoring](../../ai-coder/ai-gateway/monitoring.md#kubernetes-discovery) for more details. |
|
|
||
| To forward intercepted requests to an AI Gateway that is not embedded in this Coder deployment, set: | ||
| AI Gateway Proxy remains part of the `coder server` process when you [deploy AI Gateway as a standalone service](../standalone.md). | ||
| To forward intercepted requests to the standalone Gateway, set: |
There was a problem hiding this comment.
| To forward intercepted requests to the standalone Gateway, set: | |
| To forward intercepted requests to the standalone gateway, set the following: |
| If you run a [standalone AI Gateway](../standalone.md), point clients at the | ||
| Gateway endpoint and drop the `/api/v2/ai-gateway` prefix, for example | ||
| `https://ai-gateway.example.com/openai/v1` or | ||
| `https://ai-gateway.example.com/anthropic`. |
There was a problem hiding this comment.
| If you run a [standalone AI Gateway](../standalone.md), point clients at the | |
| Gateway endpoint and drop the `/api/v2/ai-gateway` prefix, for example | |
| `https://ai-gateway.example.com/openai/v1` or | |
| `https://ai-gateway.example.com/anthropic`. | |
| If you run a [standalone AI gateway](../standalone.md), point clients at the gateway endpoint and drop the `/api/v2/ai-gateway` prefix (for example, `https://ai-gateway.example.com/openai/v1` or `https://ai-gateway.example.com/anthropic`). |
| Coder also publishes a chart, `oci://ghcr.io/coder/chart/coder-ai-gateway`, | ||
| that runs [AI Gateway](../ai-coder/ai-gateway/index.md) as its own Deployment | ||
| alongside the control plane. Use it when you want to scale AI traffic | ||
| independently of `coderd`. For installation and configuration, visit | ||
| [Standalone AI Gateway](../ai-coder/ai-gateway/standalone.md). |
There was a problem hiding this comment.
| Coder also publishes a chart, `oci://ghcr.io/coder/chart/coder-ai-gateway`, | |
| that runs [AI Gateway](../ai-coder/ai-gateway/index.md) as its own Deployment | |
| alongside the control plane. Use it when you want to scale AI traffic | |
| independently of `coderd`. For installation and configuration, visit | |
| [Standalone AI Gateway](../ai-coder/ai-gateway/standalone.md). | |
| Coder also publishes a chart, `oci://ghcr.io/coder/chart/coder-ai-gateway`, that runs [AI Gateway](../ai-coder/ai-gateway/index.md) as its own Deployment alongside the control plane. | |
| Use it when you want to scale AI traffic independently of `coderd`. | |
| For installation and configuration, visit [Standalone AI gateway](../ai-coder/ai-gateway/standalone.md). |
| ## Authenticate standalone Gateway replicas | ||
|
|
||
| AI Gateway keys are scoped to the Coder deployment. | ||
| A [standalone AI Gateway](./standalone.md) uses one of these keys to connect to `coderd`. |
There was a problem hiding this comment.
| A [standalone AI Gateway](./standalone.md) uses one of these keys to connect to `coderd`. | |
| A [standalone AI gateway](./standalone.md) uses one of these keys to connect to `coderd`. |
|
|
||
| ### Health and readiness | ||
|
|
||
| A standalone AI Gateway exposes health endpoints on its data-plane listener: |
There was a problem hiding this comment.
| A standalone AI Gateway exposes health endpoints on its data-plane listener: | |
| A standalone AI gateway exposes health endpoints on its data-plane listener: |
| The standalone listener also accepts the equivalent `/api/v2/ai-gateway/<provider-name>/` paths for compatibility. | ||
| For full per-client configuration examples, refer to [Client Configuration](./clients/index.md). | ||
|
|
||
| ### Expose the standalone AI Gateway |
There was a problem hiding this comment.
| ### Expose the standalone AI Gateway | |
| ### Expose the standalone AI gateway |
| -f values.yaml | ||
| ``` | ||
|
|
||
| ## Standalone AI Gateway Chart |
There was a problem hiding this comment.
| ## Standalone AI Gateway Chart | |
| ## Standalone AI gateway chart |
nickvigilante
left a comment
There was a problem hiding this comment.
Great start to this! I'm requesting a few changes about casing for the word "gateway" in this PR. To clarify:
- If you're talking specifically about the AI Gateway feature, the G is capitalized.
- If you're talking about an individual gateway within Coder itself (independent of Kubernetes), the g is lowercase.
- If you're talking about the Gateway object in Kubernetes specifically and not the AI Gateway feature or a specific gateway within Coder, the G is capitalized.
So if I got the gateways mixed up and made too many Gateways lowercase, feel free to ignore those comments.
…-about-standalone-gateway-deployment-backport
mtojek
left a comment
There was a problem hiding this comment.
@nickvigilante I'm overriding your review since this is a backport PR, and such changes must be applied on main first. @pawbana feel free to open another PR to adress Nick's comments.
In the meantime, I'll merge this pull request for consistency.
Sounds good to me, thanks! |
Documents standalone AI Gateway deployment, Gateway key authentication, monitoring, and the updated embedded vs standalone topology in the AI Gateway docs.