Skip to content

[DOCS] Generate provider-derived docs from the canonical openapi.yaml (task generate) #339

Closed

Description

@inference-gateway-maintainer

Summary

Adding a provider to the gateway currently means hand-editing several docs pages that all restate the same facts already encoded in the canonical openapi.yaml (inference-gateway/schemas). This is a request to add a task generate step to this repo that regenerates the provider-derived sections from that schema, so onboarding a new provider becomes task generate + review instead of N manual edits kept in sync by hand.

Follow-up from PR #338 (NVIDIA) and #332 (MiniMax): each was a purely mechanical restatement of provider data that already lives in the schema.

Source of truth

inference-gateway/schemas/openapi.yaml already models every provider under components.schemas.Provider:

  • enum - the canonical provider id list (openai, anthropic, ... minimax, nvidia).
  • x-provider-configs.<id> - per-provider config carrying everything the docs restate:
    • url - default API base URL
    • auth_type - bearer | xheader | none
    • supports_vision - boolean
    • endpoints - models/chat method + path

What is derivable today (and where it is hand-maintained)

Schema field Docs location (hand-maintained today)
enum id + display name supported-providers.md Available Providers table; the uppercase PROVIDER list; per-provider example headings
auth_type supported-providers.md "Auth" column (bearer -> Bearer Token, xheader -> X-Header, none -> Optional API key)
url supported-providers.md "Default URL" column; configuration.md *_API_URL defaults in the <script setup> block
supports_vision supported-providers.md "Vision Support" column + "Providers with Vision Support" list
id -> env vars configuration.md *_API_URL / *_API_KEY rows
id -> action input github-action.md <provider>-api-key Inputs rows

Adding one provider today touches all three pages; drift between them is easy and invisible.

Proposed approach

  • Add a Taskfile.yml to this repo with a generate task (there is none today).
  • task generate fetches the canonical openapi.yaml pinned to a schema commit/tag, then renders the provider-derived sections. The ADKs already follow this pattern - see typescript-adk.md: generated types are "regenerated via pnpm generate:types and pinned to a specific schema commit."
  • Prefer injecting into marked regions (e.g. <!-- BEGIN GENERATED: providers --> / <!-- END GENERATED -->) rather than owning whole pages, since these pages are mostly hand-authored prose. configuration.md already isolates its table data in a top-of-file <script setup> const, a natural generation target.
  • Wire a drift check into CI. The org already has an sdk-drift label ("Drift detected against canonical OpenAPI schema"); the same idea here would fail the build when a schema change outdates the docs instead of letting them silently rot.

Not in the schema (stays hand-authored, or needs a schema extension)

  • Per-provider vision model lists ("Nemotron, Llama, DeepSeek, ...") and the example model ids in curl snippets.
  • Prose notes (e.g. the Google /v1beta/openai note, the NVIDIA-vs-Groq note).
  • Display-name / casing map: enum ids are lowercase/snake (nvidia, minimax, ollama_cloud) but the docs render NVIDIA, MiniMax, Ollama Cloud - a small override map is needed.
  • The github-action.md *-api-key inputs are owned by inference-gateway/infer-action, not the schema; generating that row assumes the upstream input exists (the exact dependency that blocked [DOCS] Document nvidia-api-key input in github-action.md once infer-action supports it #329).

Acceptance criteria

  • task generate regenerates the provider table(s), the *_API_URL / *_API_KEY rows, and the *-api-key action-input rows from the pinned canonical openapi.yaml.
  • Running it after a provider is added to the schema produces the same edits a human would have made by hand.
  • CI flags drift between the committed docs and the schema.

Affected pages: supported-providers.md, configuration.md, github-action.md. Related: PR #338, #332, #329, #337; schema source inference-gateway/schemas/openapi.yaml.

Activity

  1. added
    documentation
    enhancement
    on Jul 5, 2026
  2. edenreich commented on Jul 5, 2026

    @edenreich
    Contributor

    @claude Can you implement it?

  3. moved this from In progress to Done in 2026on Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationenhancement

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions