Skip to content

Construct model providers table automatically #19

@zastrowm

Description

@zastrowm

Overview

Currently the model providers overview page contains a table of model providers, hardcoded in text. Instead of doing that, generate it dynamically by querying the docs collection and extracting entries with integrationType: 'model-provider' frontmatter/entry data.


Implementation Requirements

Based on clarification discussion and repository analysis:

Technical Approach

  • Framework: Astro/Starlight documentation site
  • Filtering: Use frontmatter-based filtering with new integrationType field

Frontmatter Field

  • Add new integrationType field to content schema in src/content.config.ts
  • Value: 'model-provider' for model provider pages
  • All model provider pages must be updated with this frontmatter field

Language Support Detection

  • Use existing languages frontmatter field convention:
    • languages: Python = Python-only support
    • No languages field = Both Python and TypeScript support
  • No new fields needed for language detection

Community Provider Handling

  • Include community providers in the generated table
  • Visually distinguish them from official providers (separate section or badge)
  • Community providers are identified by having community: true in frontmatter

Sort Order

  • Sort providers alphabetically by title (non-community first)

Special Cases

  • Custom Providers page: Include in the generated table
  • Index page: Automatically exclude from the list (it's the overview page itself)

Files to Create/Modify

Create:

  • src/components/ModelProvidersList.astro - New component to generate the table dynamically

Modify:

  • src/content.config.ts - Add integrationType field to docs schema
  • src/content/docs/user-guide/concepts/model-providers/index.mdx - Replace hardcoded table with component
  • src/content/docs/user-guide/concepts/model-providers/*.mdx - Add integrationType: 'model-provider' frontmatter to all provider pages (18 files)

Tests:

  • Add tests for the new ModelProvidersList.astro component

Model Provider Pages to Update (18 files)

  1. amazon-bedrock.mdx
  2. amazon-nova.mdx
  3. anthropic.mdx
  4. clova-studio.mdx
  5. cohere.mdx
  6. custom_model_provider.mdx
  7. fireworksai.mdx
  8. gemini.mdx
  9. litellm.mdx
  10. llamaapi.mdx
  11. llamacpp.mdx
  12. mistral.mdx
  13. nebius-token-factory.mdx
  14. ollama.mdx
  15. openai.mdx
  16. sagemaker.mdx
  17. writer.mdx
  18. xai.mdx

Acceptance Criteria

  • New integrationType field added to content schema
  • All model provider pages have integrationType: 'model-provider' frontmatter
  • ModelProvidersList.astro component created following existing patterns
  • Component correctly generates table with Provider, Python Support, TypeScript Support columns
  • Community providers are visually distinguished (badge or separate section)
  • Table is sorted alphabetically by provider name
  • Index page is excluded from the generated list
  • Custom Providers page is included in the table
  • Hardcoded table in index.mdx replaced with new component
  • Tests added for the new component
  • All existing tests pass
  • Site builds successfully with npm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions