docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H) - #438

Merged
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides
May 29, 2026
Merged

docs: adapter protocol families + BYO + 3 platform-adapter integration guides (#302 Phase H)#438
moonming merged 2 commits into
mainfrom
docs/phase-h-adapter-guides

Conversation

@moonming

@moonmingmoonming commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

Phase H documentation subset for #302 — 5 new pages, each grounded in current origin/main code (every field name, secret shape, dispatch claim, and curl example verified against source):

PageWhat it covers
reference/adapters.mdThe 5 adapter protocol families + two-tier dispatch (specialized-by-provider → family-by-adapter) + specialized bridges vs OpenAI-compat reuse + catalog/BYO + featured/non-featured
configuration/byo-endpoint.mdBYO OpenAI-compatible endpoint (vLLM/SGLang/Ollama/proxy): provider+adapter:openai+api_base+secret, Model cost block, standalone-pricing caveat
integration/upstream-bedrock.mdSigV4 JSON secret, Anthropic /invoke vs Converse dispatch, cross-region inference profiles
integration/upstream-vertex.mdSA-JSON→JWT→OAuth mint (+ pre-minted token mode), Gemini dispatch, roadmap note for Anthropic/Llama-on-Vertex
integration/upstream-azure-openai.mdDeployment URL + api_version, BOTH auth schemes (api-key + AAD client_credentials with authority_host, the seam from #434), content-filter tolerance

Accuracy verification (against origin/main)

Confirmed by reading source — not assumed:

  • Adapter enum = {Openai, Anthropic, Bedrock, Vertex, AzureOpenai}; dispatch via resolve_bridgedispatch_two_tier (crates/aisix-proxy/src/dispatch.rs).
  • ProviderKey has provider: String + adapter: Option<Adapter>; telemetry_tags.kind = catalog/byo.
  • Bedrock secret parses session_token? (bedrock/src/bridge.rs:268); chat_stream routes all publishers (incl. Anthropic) through Converse stream; non-stream Anthropic uses /invoke.
  • Vertex secret = exactly one of service_account_json / access_token; non-Gemini publishers return a "not yet implemented" Config error (vertex/src/bridge.rs:533).
  • Azure AzureSecret::parse detects api-key (bare string) vs AAD (JSON {); authority_host optional override (feat(azure-openai): production AAD authority_host override seam (closes #413) #434).
  • Standalone emits cost_usd=0.0; cp-api recomputes server-side (chat.rs:908).

Scope

Only the 5 new files. Each has frontmatter (no sidebar_position collision), a Verification section that checks an observable contract (alias-restore + outbound auth/URL shape, not just 200), and the plaintext-secret production warning.

Follow-ups (NOT in this PR — flagged for separate work)

  • reference/provider-compatibility.md + overview/feature-matrix.md still describe the old 6-value provider enum and don't mention the 5 adapter families — should backlink adapters.md.
  • configuration/provider-keys.md documents only display_name/secret/api_baseprovider, adapter, and telemetry_tags are now on the struct; should be documented + backlink the 3 upstream guides.
  • configuration/models.md (~line 160) has a stale claim that provider is a closed enum (openai/anthropic/google/deepseek/cohere/jina); on origin/main it's a free-form string — pre-existing doc bug to fix separately.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added comprehensive guides for configuring bring-your-own endpoints and routing traffic to Azure OpenAI, AWS Bedrock, and Google Vertex AI services.
    • Added adapter family reference documentation detailing supported protocol families and request routing mechanisms.

Review Change Stack

…n guides (#302 Phase H)
Adds the Phase H documentation subset, grounded in current ai-gateway
origin/main code (every field name, secret shape, dispatch claim, and
curl example verified against source):
- reference/adapters.md — the 5 adapter protocol families (openai,
anthropic, bedrock, vertex, azure-openai), the two-tier dispatch
(specialized-by-`provider` then family-by-`adapter`), specialized
bridges vs OpenAI-compat reuse, catalog vs BYO, featured vs
non-featured, with a request-flow diagram.
- configuration/byo-endpoint.md — bring-your-own OpenAI-compatible
endpoint (vLLM / SGLang / Ollama / self-hosted proxy): provider +
adapter:openai + api_base + secret, full curl flow, the Model `cost`
block for budget tracking, and the standalone-doesn't-enforce-pricing
caveat (cost_usd=0.0; cp-api recomputes server-side).
- integration/upstream-bedrock.md — SigV4 JSON secret
{access_key_id, secret_access_key, region, session_token?}; Anthropic
`/invoke` (non-stream) vs Converse dispatch; streaming via Converse
stream for all publishers; cross-region inference profile prefixes.
- integration/upstream-vertex.md — service-account JSON → JWT → OAuth
mint (and pre-minted access_token mode); Gemini `:generateContent`;
api_base regional override; clearly-marked roadmap note that
Anthropic/Llama-on-Vertex return a "not yet implemented" error.
- integration/upstream-azure-openai.md — deployment URL + api_version;
BOTH auth schemes (bare-string api-key vs JSON AAD
{tenant_id, client_id, client_secret, authority_host?} → Bearer,
the authority_host seam from ai-gateway#434); national-cloud
authorities; content-filter tolerance; a curl example per scheme.
Each page carries Docusaurus frontmatter (sidebar_position slots into
its folder with no collision), a Verification section that exercises an
observable contract (alias-restore on response.model + the outbound
auth/URL shape) rather than just a 200, and the plaintext-secret
production warning. Only the 5 new files are added; no existing pages
or sidebar config touched.
@coderabbitai

coderabbitaiBot commented May 29, 2026

Copy link
Copy Markdown
ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Free

Run ID: 0d50b629-f0af-45c7-a6cd-a2db4e9eb92d

📥 Commits

Reviewing files that changed from the base of the PR and between 5c33d19 and e2daa19.

📒 Files selected for processing (5)
  • docs/configuration/byo-endpoint.md
  • docs/integration/upstream-azure-openai.md
  • docs/integration/upstream-bedrock.md
  • docs/integration/upstream-vertex.md
  • docs/reference/adapters.md

📝 Walkthrough

Walkthrough

This PR adds comprehensive documentation for AISIX AI Gateway's upstream adapter system and provider integrations. It establishes the architecture for routing requests to OpenAI-compatible endpoints and cloud providers (Azure, Bedrock, Vertex), with configuration guides, request/response mapping examples, and verification procedures for each integration pattern.

Changes

Upstream Integration and Adapter Reference Documentation

Layer / File(s)Summary
Adapter Families Architecture Reference
docs/reference/adapters.md
Defines the five closed-set adapter families (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI), explaining how dispatch resolves models via two-tier lookup, how bridges encode/decode upstream-native requests while maintaining OpenAI-shaped responses, and how catalog vs BYO modes select adapters.
Bring Your Own OpenAI-Compatible Endpoint Configuration
docs/configuration/byo-endpoint.md
Configuration guide for routing to private OpenAI-compatible servers (vLLM, SGLang, Ollama), with step-by-step provider key creation, model alias-to-upstream mapping, caller API key setup, pricing via optional cost blocks, and verification of alias restoration and routing dispatch.
Azure OpenAI Integration Guide
docs/integration/upstream-azure-openai.md
Complete guide for Azure OpenAI routing via the azure-openai adapter, covering URL construction, dual authentication (API key vs Entra ID OAuth2), response mapping, content-filter tolerance, and verification of outbound auth headers and dispatch behavior.
AWS Bedrock Integration Guide
docs/integration/upstream-bedrock.md
Guide for Bedrock routing with SigV4 signing, detailing publisher-specific dispatch paths (Anthropic /invoke vs Converse /converse), credential formation, cross-region inference profiles, model configuration, response mapping, and verification of alias restoration and signed routing with error redaction behavior.
Google Vertex AI Gemini Integration Guide
docs/integration/upstream-vertex.md
Guide for Vertex/Gemini routing via the vertex adapter, covering OAuth2 token minting from service-account credentials, model and caller API key configuration, request/response examples with alias restoration, verification of Bearer-auth dispatch to :generateContent, and Gemini-only limitations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes


Note

🎁 Summarized by CodeRabbit Free

Your organization has reached its limit of developer seats under the Pro Plan. For new users, CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please add seats to your subscription by visiting https://app.coderabbit.ai/login.If you believe this is a mistake and have available seats, please assign one to the pull request author through the subscription management page using the link above.

Comment @coderabbitai help to get the list of available commands and usage tips.

Audit (partial, before stall) flagged that adapters.md described the
Vertex bridge as minting a token "before each call". That is imprecise
on two counts, both already documented correctly in the upstream-vertex
guide: (1) the `access_token` secret mode supplies a pre-minted token
verbatim (no mint), and (2) the service-account mode caches the minted
token (not per-call). Reworded the summary line to "minted in-process
and cached, or supplied pre-minted" with a link to the Token minting
section. No behavioral claim changed elsewhere.
@moonming

Copy link
Copy Markdown
MemberAuthor

Independent doc-accuracy audit: clean — no HIGH, no MEDIUM.

A fresh cold-read agent verified every factual claim across all 5 pages against origin/main source (git show-based), in addition to the author's own pre-push verification:

  • Azure — api-key vs AAD {-prefix detection (AzureSecret::parse bridge.rs:394), authority_host default + national-cloud values + (tenant_id, client_id) cache key + 60s refresh (aad_token_mint.rs), api_base 3 shapes, api-version 2024-10-21, deployment URL. ✓
  • Bedrock — secret {...session_token?} (bridge.rs:268), non-stream Anthropic→/invoke+bedrock-2023-05-31+model-stripped / others→Converse / streaming all→Converse stream, publisher + cross-region prefixes. ✓
  • adapters.md + byo — two-tier dispatch (dispatch.rs:30), OpenAI api_base fallback only for openai/empty vendor, ModelCost{input_per_1k,output_per_1k}, standalone cost_usd=0.0 (chat.rs:1351). ✓
  • Admin curl/portsPOST /admin/v1/{provider_keys,models,apikeys} exist, body fields match the structs, proxy :3000 / admin :3001. ✓
  • Links — all 12 cross-page files + every anchor resolve. ✓

Two precision issues found during review were already fixed pre-merge: telemetry_tags.kind (was "carries a kind") and the Vertex auth wording (mint-or-pre-minted + cached).

LOW (non-blocking, no change): the Converse-publisher list shows cohere.command* / ai21.jamba-* as examples; from_model_id actually keys on the bare cohere / ai21 tag, so any cohere.* / ai21.* resolves. The doc's "and other catalog publishers" caveat already covers this, and the gateway's own dispatch-error message uses the same cohere.command* example phrasing — so the docs stay consistent with the code's user-facing wording.

Merging on green CI.

@moonming
moonming merged commit 82e3d10 into mainMay 29, 2026
7 checks passed
@moonming
moonming deleted the docs/phase-h-adapter-guides branch May 29, 2026 02:10
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@moonming