docs: add standalone AI Gateway docs - #27592
Conversation
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.
|
Documentation CheckReviewed through Updates Needed
Verified accurate in the new commit: the OpenAI-serves- Automated review via Coder Agents |
3e7e013 to
5cff57c
Compare
| run as a [standalone deployment](../../../ai-coder/ai-gateway/standalone.md) | ||
| that scales independently of the control plane. The standalone Helm chart | ||
| requests 1 vCPU and 1 GiB of memory per replica, sets no limits. It ships | ||
| without a HorizontalPodAutoscaler nor a PodDisruptionBudget. Size replicas from | ||
| your own AI request volume and `CODER_AI_GATEWAY_MAX_CONCURRENCY`. | ||
|
|
There was a problem hiding this comment.
This is going to become stale quickly. Just link to the README.md for the Helm chart.
| No separate AI Gateway login or credential is required. | ||
| that a user uses for the rest of the Coder API. | ||
| No separate AI Gateway login is required for client traffic. | ||
| For token creation, expiration, and revocation, refer to [Sessions and API tokens](../../admin/users/sessions-tokens.md). |
There was a problem hiding this comment.
Does AI Gateway check token scopes?
There was a problem hiding this comment.
When starting the process or when Gateway connects to coderd, no. Only Gateway key is required for connection.
When authenticating users it re-uses the same method as embedded, scope is not checked, only that key exists and user is not deleted / is active / is not a system user:
coder/coderd/aibridgedserver/aibridgedserver.go
Lines 746 to 813 in 659fb48
| For example, if the Gateway is reachable at `https://ai-gateway.example.com` and the providers are configured, configure Claude Code with: | ||
|
|
||
| ```sh | ||
| ANTHROPIC_BASE_URL=https://ai-gateway.example.com/anthropic | ||
| ``` | ||
|
|
||
| Configure an OpenAI-compatible client with: | ||
|
|
||
| ```sh | ||
| OPENAI_BASE_URL=https://ai-gateway.example.com/openai/v1 | ||
| ``` |
There was a problem hiding this comment.
You also need to set ANTHROPIC_AUTH_TOKEN=${CODER_TOKEN} / OPENAI_API_KEY=${CODER_TOKEN} / etc.
There was a problem hiding this comment.
This paragraph is only about how to reach the Gateway. I'm not sure about adding whole configuration here. Better examples are in clients docs, eg: https://github.com/coder/coder/blob/5d2a69d85a2e47b37d1369fe77809cf348c7e161/docs/ai-coder/ai-gateway/clients/claude-code.md
I could add link to that part of documentation, something like "For full configuration examples refer to [docs/ai-coder/ai-gateway/clients/index.md]".
| Each [standalone Gateway](./standalone.md) replica accepts the same API dump | ||
| settings and writes dumps to its own local disk. | ||
|
|
There was a problem hiding this comment.
Does it also support the YAML config form, or just the CLI flag and environment variable?
There was a problem hiding this comment.
Good point, ai-gateway start command doesn't have -c --config flag so it is not possible to use YAML config.
Created followup issue.
Co-authored-by: Cian Johnston <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
Co-authored-by: Cian Johnston <[email protected]>
0978e40 to
77c1a68
Compare
Documents standalone AI Gateway deployment, Gateway key authentication, monitoring, and the updated embedded vs standalone topology in the AI Gateway docs.