Skip to content

docs(rust-adk): add NVIDIA provider to Rust ADK docs - #345

Merged
edenreich merged 8 commits into
mainfrom
docs/issue-343-20260706-0001
Jul 6, 2026
Merged

edenreich merged 8 commits into
mainfrom
docs/issue-343-20260706-0001

Conversation

@inference-gateway-maintainer

Copy link
Copy Markdown
Contributor

Summary

The Rust ADK now accepts A2A_AGENT_CLIENT_PROVIDER=nvidia (rust-adk#86). NVIDIA was already documented at the gateway level (supported-providers.md, configuration.md, generator fixture + overrides), but the Rust ADK page had no provider enumeration at all - unlike the sibling TypeScript ADK page.

  • Add a "Switching providers and models" table to rust-adk.md mirroring the sibling TypeScript ADK page, including NVIDIA (nvidia / nvidia/meta/llama-3.1-8b-instruct / NVIDIA_API_KEY, bearer auth at https://integrate.api.nvidia.com/v1).
  • Add nvidia to the A2A_AGENT_CLIENT_PROVIDER env-var reference examples.

Verification

bun run format:check, bun run lint:md, bun run build, and bun test (6 pass) all succeed.

Note

The sibling TypeScript ADK provider table (typescript-adk.md) also predates NVIDIA (and MiniMax/Moonshot); aligning it would be a reasonable follow-up, but this PR is scoped to the Rust ADK per the issue.

Closes #343

Comment thread rust-adk.md Resolved
Comment thread rust-adk.md Resolved
@edenreich

Copy link
Copy Markdown
Contributor

@claude did you use task generate? there is a script for adding a provider.

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 2m 40s —— View job


Answer: task generate doesn't cover this file

Good question - I checked the generator against this change:

  • Confirm which files the provider generator writes
  • Check whether rust-adk.md has GENERATED: markers
  • Check the sibling typescript-adk.md for markers
  • Verify NVIDIA is already in the schema/overrides and the generated docs are in sync
  • Answer the question

Short answer: task generate was not used for rust-adk.md, and it wouldn't have produced this change - that file isn't one of the two the generator manages.

The generator (scripts/generate-provider-docs.mjs) only rewrites the GENERATED:<key> START/END marked regions in exactly two content files:

File Generated regions
configuration.md provider-settings, provider-config-sections
supported-providers.md providers-table, provider-uppercase, vision-list

NVIDIA was already onboarded into that pipeline in the earlier gateway-level work (it's in scripts/provider-overrides.json and the schema/fixture). I confirmed there's zero drift - running the generator now touches only those two files and produces no diff:

$ task generate
Generated 13 providers (..., nvidia) from .../schemas/main/openapi.yaml.
Updated: supported-providers.md, configuration.md

$ git status --porcelain      # <- empty, no changes
$ bun test                    # 6 pass, 0 fail

Why rust-adk.md had to be edited by hand: its "Switching providers and models" table (rust-adk.md:213) has no GENERATED: markers - it's hand-authored prose, exactly like the sibling typescript-adk.md table (typescript-adk.md:1092). The generator never reads or writes either ADK page, so there was no region to regenerate; adding the NVIDIA row by hand was the only path. Your two earlier review suggestions (the Nvidia row + the prose paragraph) are already applied on the branch.

Optional follow-up

If the intent is that adding a provider should be a single task generate across all pages (so the ADK tables can't drift), I'd be glad to bring the two ADK provider tables into the generator - add GENERATED: markers to rust-adk.md and typescript-adk.md, write a renderer for the Provider / env / example-model / API-key table (the example-model column is display-only, so it'd live in provider-overrides.json), and extend the fixture test. That would also fix a small casing divergence this hand-editing introduced: the generated gateway docs render NVIDIA (from the override displayName), whereas the ADK table uses Nvidia.

That's a larger, separate change than this PR's scope, so I left it out. Want me to open it as a follow-up?

@edenreich

Copy link
Copy Markdown
Contributor

@claude Create a follow up for it, it should be a part of the generated markers if we on board a new provider I don't want to hand maintain it.

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 5m 6s —— View job


Follow-up created: #346

Opened #346 - [DOCS] Generate the ADK provider tables from the schema (task generate) to bring the ADK "Switching providers and models" tables under the generator, so onboarding a provider is schema + provider-overrides.json + task generate with no hand-editing.

  • Read the generator, overrides, and both ADK pages to scope the work accurately
  • Draft the follow-up issue (GENERATED markers + renderer + fixture test)
  • Create the follow-up issue and link it here

What #346 covers

  • Add `` markers around the table in both rust-adk.md and `typescript-adk.md`.
  • New renderAdkProviderTable(...) renderer in scripts/generate-provider-docs.mjs, plus two new updateFile(...) calls in main().
  • New display-only adkExampleModel field per provider in scripts/provider-overrides.json (the example-model column isn't in the schema).
  • Handle the auth_type: none (local Ollama) API-key cell as a special case.
  • Extend the fixture test (scripts/generate-provider-docs.test.mjs) and add both files to GENERATED_FILES in Taskfile.yml so task generate:check guards them.
  • Update CLAUDE.md (now four managed files / seven regions, not two/five).

It also flags the design decisions to settle (canonical row order, Local Ollama vs Ollama label, TS table growing to include NVIDIA/MiniMax/Moonshot) and records the small casing fix it delivers: the ADK table's Nvidia becomes NVIDIA, matching the generated gateway docs.

No changes were made to this PR - this task was scoped to creating the tracking issue. This PR (#345) can merge as-is; #346 tracks eliminating the hand-maintenance going forward.
| Follow-up: #346

@edenreich

Copy link
Copy Markdown
Contributor

@claude Try the generator now instead of handwriting the docs

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 11m 41s —— View job


Done - the ADK tables are now generated, not hand-written

Switched from hand-editing to the generator. Committed as 29bb87e. Onboarding a provider is now schema + provider-overrides.json + task generate across all four managed pages - the ADK "Switching providers and models" tables can no longer drift.

  • Read the generator, overrides, fixture, both ADK pages, and Taskfile
  • Add adkExampleModel display field per provider in provider-overrides.json
  • Write renderAdkProviderTable(...) renderer + wire two updateFile(...) calls
  • Add GENERATED:adk-provider-table markers to rust-adk.md and typescript-adk.md
  • Add both files to GENERATED_FILES in Taskfile.yml
  • Extend the fixture test (8 pass, was 6)
  • CLAUDE.md already documents the four-file / seven-region state
  • Verify: bun test, format:check, lint:md, build, no-drift re-check
  • Commit

What changed

File Change
scripts/generate-provider-docs.mjs New renderAdkProviderTable(...) + extracted shared formatTable(...); two new updateFile(...) calls; adkExampleModel is now a required override (build fails fast if missing)
scripts/provider-overrides.json New display-only adkExampleModel per provider (values aligned with the existing adl-cli.md table)
rust-adk.md, typescript-adk.md Hand-written table replaced with GENERATED:adk-provider-table markers - injected identically into both
Taskfile.yml GENERATED_FILES now covers all four files, so task generate:check guards the ADK tables
scripts/generate-provider-docs.test.mjs Two new byte-for-byte fixture assertions

Table is now schema-driven (canonical order, all 13 providers)

Both ADK tables render identically from the schema. Because the table is now generated from the canonical provider set, it picked up three providers the hand-written tables were missing and normalized display via the overrides:

  • Added rows: Ollama Cloud (gpt-oss:120b), MiniMax (MiniMax-M3), Moonshot (kimi-k2-thinking)
  • Casing fix: Nvidia -> NVIDIA; Local Ollama -> Ollama (from displayName)
  • auth_type: none (Ollama) still renders the none (set A2A_AGENT_CLIENT_BASE_URL to your Ollama) cell - now derived, not typed
  • Rows are in canonical schema order, matching every other generated region

The NVIDIA context paragraph you requested in review is kept (hand-authored prose, outside the markers); I only bumped its Nvidia -> NVIDIA to match the generated table.

Verification

bun test          # 8 pass, 0 fail
bun run format:check   # All matched files use Prettier code style!
bun run lint:md        # exit 0
bun run build          # build complete
task generate (x2)     # idempotent - no drift (generate:check would pass)

This effectively delivers the follow-up tracked in #346, so that issue can be closed once this merges. To change an ADK example model going forward, edit adkExampleModel in scripts/provider-overrides.json and run task generate - no page edits.
| Branch: docs/issue-343-20260706-0001

inference-gateway-maintainer Bot and others added 2 commits July 6, 2026 10:08
Bring the "Switching providers and models" tables in rust-adk.md and
typescript-adk.md under the provider-docs generator, so onboarding a
provider is schema + provider-overrides.json + `task generate` with no
hand-editing.

- add renderAdkProviderTable + adk-provider-table markers in both pages
- add display-only adkExampleModel field per provider in the overrides
- add both files to GENERATED_FILES and extend the fixture test (8 pass)

This expands both tables to the full canonical provider set (adds Ollama
Cloud, MiniMax, Moonshot) and normalizes casing via the schema overrides
(Nvidia -> NVIDIA, Local Ollama -> Ollama).
@edenreich

Copy link
Copy Markdown
Contributor

@claude there was a merge conflict - I've resolved it, can you check it's merged as expected? also we should have a dirty check in the CI for docs drifts - can you confirm?

@inference-gateway-maintainer

inference-gateway-maintainer Bot commented Jul 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Claude finished @edenreich's task in 20m 43s —— View job


Checked the merge - it needed two fixes, plus a guard so this can't recur

Short version: the merge (0083082) did not come out clean. It introduced two duplications that were invisible to both the manual conflict resolution and CI, because git auto-merged them with no conflict markers. Both are now fixed on the branch, and I hardened the generator so the class can't slip through silently again.

  • Verify the merge - generated regions in sync, no drift, no artifacts
  • Fix what the merge duplicated
  • Confirm whether CI has a docs-drift check
  • Close the gap that let the duplication through

1. What the merge duplicated (and why nobody saw it)

Your branch and main both landed "generate the ADK tables" independently (this PR's 29bb87e and main's #347 aece944). Merging two copies of the same feature left duplicates:

# Artifact Why it stayed hidden Fix
1 Two export function renderAdkProviderTable in scripts/generate-provider-docs.mjs A duplicate export is illegal ESM, but bun tolerates it (second definition silently wins), so bun test + build passed 42e8469 - collapsed to one function (keeps main's adkKeyNote handling + reuses the shared formatTable helper; output byte-identical)
2 Two "Switching providers and models" sections in rust-adk.md (lines 144-162 and 239-257) The two sections sat at non-overlapping lines, so git auto-merged both with no conflict marker; the test reads only the first region (findIndex), so it stayed green while the second table went stale (kimi-k2-thinking) 4e1f67a - kept main's canonical section (parallel with typescript-adk.md, table in sync), dropped the duplicate

On #2 I kept the NVIDIA note you asked for in review - moved it under the surviving section, trimmed only the one sentence that would have repeated the base-URL guidance already sitting above it. rust-adk.md and typescript-adk.md are now structurally identical again.

One call to flag: I kept main's section placement (right after the minimal-server example) to stay parallel with typescript-adk.md, rather than your branch's placement (under ## AgentBuilder). If you prefer the AgentBuilder spot, say so and I'll move both pages together. The rest of the merge (overrides with adkKeyNote/adkExampleModel, configuration.md, supported-providers.md, and the main housekeeping in AGENTS/README/CHANGELOG/release.yml) merged correctly - no other artifacts.


2. CI docs-drift check - confirmed not present today

.github/workflows/ci.yml runs only lint:md, format:check, and build. Neither bun test nor task generate:check is wired into any workflow - so there is currently no guard against the generated docs drifting from the schema.

An honest caveat: even a drift check wouldn't have caught this particular merge - artifact #1 produced identical output (no drift), and #2 slipped past injectRegion's findIndex (it only rewrites the first region, so generate was a no-op and git diff came back empty). So I closed that specific hole:

  • c12c683 - injectRegion now counts markers and throws when a key has more than one region, turning that silent trap into a hard task generate failure. Exported it and added regression tests (suite is now 10, was 8).

I can't commit the workflow change myself (the GitHub App can't modify .github/workflows/). Here's the drop-in job for ci.yml - it mirrors task generate:check without needing go-task:

  drift:
    name: Docs drift
    runs-on: ubuntu-24.04
    steps:
      - uses: actions/[email protected]
      - uses: oven-sh/setup-bun@v2
        with:
          bun-version-file: .bun-version
      - run: bun install --frozen-lockfile
      - name: Provider-docs regression tests (offline)
        run: bun test
      - name: Fail on schema drift
        run: |
          bun scripts/generate-provider-docs.mjs
          bunx prettier --write supported-providers.md configuration.md rust-adk.md typescript-adk.md
          git diff --exit-code -- supported-providers.md configuration.md rust-adk.md typescript-adk.md \
            || { echo 'Provider docs drifted from openapi.yaml - run `task generate` and commit.'; exit 1; }

Notes: the drift step needs outbound network to fetch the schema (inference-gateway/schemas@main; set SCHEMA_REF to a tag/SHA for reproducibility). If you'd rather stay fully offline, just add the bun test step to the existing lint job - it now also asserts single-region integrity via the new guard. I verified the drift check is green today: generating from the bundled fixture is idempotent (empty diff).


Verification (all green on the branch head)

bun test          -> 10 pass, 0 fail   (was 8; +2 injectRegion guard tests)
bun run lint:md   -> exit 0
bun run format:check -> All matched files use Prettier code style!
bun run build     -> build complete
generate (offline, fixture) -> idempotent, 0 drift; guard does not fire on the clean tree

Commits pushed: 42e8469 (dedupe generator fn) - 4e1f67a (dedupe rust-adk section) - c12c683 (guard + tests)

• branch docs/issue-343-20260706-0001

inference-gateway-maintainer Bot and others added 4 commits July 6, 2026 11:20
The main-into-branch merge kept both parents' copies of
renderAdkProviderTable (a duplicate export - illegal ESM that
bun happens to tolerate, with the second definition silently
winning). Collapse to one function that keeps main's adkKeyNote
handling and reuses the shared formatTable helper. Output is
byte-identical, so the committed ADK tables are unchanged and
all 8 generator tests still pass.
The main-into-branch merge left rust-adk.md with two
"Switching providers and models" sections: the branch's
(under AgentBuilder) and main's #347 canonical one (after the
minimal server). Because they sat at non-overlapping lines git
auto-merged both with no conflict marker, so the manual
resolution never saw it, and the regression test only checks
the first GENERATED region so it stayed green. Keep main's
canonical section (parallel with typescript-adk.md, table in
sync with the overrides) and drop the duplicate, preserving the
requested NVIDIA note (trimmed to avoid repeating the base-URL
guidance already above it).
injectRegion used findIndex, so a file with two same-key
GENERATED regions (as this merge produced in rust-adk.md) would
have only its first region rewritten and the stale duplicate
left in place - an empty diff that task generate:check reports
as clean. Count the markers and throw when a key has more than
one region, turning that silent merge trap into a hard failure.
Export injectRegion and cover both paths in the regression
tests (now 10).
@edenreich
edenreich merged commit a329e43 into main Jul 6, 2026
1 check passed
@edenreich
edenreich deleted the docs/issue-343-20260706-0001 branch July 6, 2026 12:10
inference-gateway-releaser Bot added a commit that referenced this pull request Jul 9, 2026
## [0.9.0](0.8.0...0.9.0) (2026-07-09)

### ✨ Features

* generate ADK provider tables from the schema ([#347](#347)) ([aece944](aece944)), closes [#346](#346)

### 👷 CI

* **claude:** centralize claude.yml via reusable workflow ([#372](#372)) ([9a41158](9a41158))
* **infer:** centralize infer.yml via reusable workflow ([#367](#367)) ([47d5fb2](47d5fb2))
* **infer:** centralize infer.yml via reusable workflow ([#368](#368)) ([305d621](305d621))

### 📚 Documentation

* add Wait tool documentation to CLI reference ([#371](#371)) ([8018c50](8018c50)), references [inference-gateway/cli#792](inference-gateway/cli#792)
* add Z-AI provider documentation ([#363](#363)) ([3c3db53](3c3db53))
* document agent.skills.max_chars, line-boundary truncation, and date-only system prompt ([#359](#359)) ([73d49b5](73d49b5))
* document infer chat --session-id flag ([#351](#351)) ([d6b3cf6](d6b3cf6))
* document infer-action system prompt override semantics ([#357](#357)) ([58c8bc4](58c8bc4))
* **github-action:** add zai-api-key input to the inputs table ([#366](#366)) ([a129831](a129831))
* remove Claude Code subscription mode documentation ([#374](#374)) ([442a9fa](442a9fa)), references [inference-gateway/cli#812](inference-gateway/cli#812)
* **rust-adk:** add NVIDIA provider to Rust ADK docs ([#345](#345)) ([a329e43](a329e43)), references [#347](#347)
* update memory documentation for per-project fact organization and entry caps ([#350](#350)) ([8dca0cd](8dca0cd)), closes [#348](#348)

### 🔧 Miscellaneous

* **deps:** bump claude-code 2.1.197 -> 2.1.201 ([#353](#353)) ([5f714de](5f714de))
* **deps:** bump claude-code-action v1.0.165 -> v1.0.169 ([#370](#370)) ([293e9b8](293e9b8))
* **deps:** bump infer CLI v0.130.1 -> v0.133.0, infer-action v0.24.0 -> v0.26.0 ([#354](#354)) ([824a288](824a288))
* **deps:** bump infer CLI v0.133.0 -> v0.133.1, infer-action v0.27.0 -> v0.27.1 ([#360](#360)) ([03ec147](03ec147))
* **deps:** bump infer CLI v0.133.1 -> v0.137.0, infer-action v0.27.1 -> v0.29.0 ([#361](#361)) ([e7bec3e](e7bec3e))
* **deps:** bump infer CLI v0.137.0 -> v0.138.0, infer-action v0.29.0 -> v0.30.1 ([#365](#365)) ([02be4c8](02be4c8))
* **deps:** bump infer CLI v0.138.0 -> v0.140.1 ([#375](#375)) ([2fd4097](2fd4097))
* **deps:** bump infer-action v0.26.0 -> v0.26.1 ([#356](#356)) ([17f74f8](17f74f8))
* **deps:** bump infer-action v0.26.1 -> v0.27.0 ([#358](#358)) ([89c944b](89c944b))
* enable debug mode in infer.yml workflow ([9e373c6](9e373c6))
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DOCS] Add NVIDIA provider to Rust ADK provider docs

1 participant