[PR #9898] docs: add modalities configuration for custom providers #13265

Open
opened 2026-02-16 18:18:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/9898

State: open
Merged: No


docs: add modalities configuration for custom providers

Summary

Adds documentation for the modalities property that enables vision and multimodal support in custom OpenAI-compatible providers.

Problem

The modalities configuration property exists in the codebase and works correctly, but is not documented anywhere. This causes users to:

  • Believe vision/multimodal support is unavailable for custom providers
  • Try incorrect properties like supportsImageInput or capabilities.vision
  • Create duplicate issues asking how to enable image support
  • Potentially abandon OpenCode for other tools

Solution

Added a new "Multimodal Support" section to the custom provider documentation that:

  • Documents the modalities property with a clear example
  • Lists all supported input/output modalities (text, audio, image, video, pdf)
  • Explains validation behavior when modalities are not configured
  • Provides a practical example showing image input configuration

Changes

  • File: packages/web/src/content/docs/providers.mdx
  • Location: Added after the existing custom provider example, before the Troubleshooting section
  • Format: Follows the existing documentation style with code examples and tips

Testing

  • Configuration property exists in schema: packages/opencode/src/provider/models.ts:53-58
  • Used in capability detection: packages/opencode/src/provider/provider.ts:769-773
  • Covered by tests: packages/opencode/test/provider/provider.test.ts:1254-1257
  • Verified working with real-world custom provider (TaxHawk API)

Example Configuration

{
  "provider": {
    "myprovider": {
      "npm": "@ai-sdk/openai-compatible",
      "models": {
        "my-vision-model": {
          "name": "My Vision Model",
          "modalities": {
            "input": ["text", "image"],
            "output": ["text"]
          }
        }
      }
    }
  }
}

Related

  • PR #5531 mentions multimodal support for @ai-sdk/openai-compatible
  • Test coverage: test/provider/provider.test.ts:1241-1280

Impact

This documentation will:

  • Reduce support burden from users asking about vision support
  • Improve discoverability of existing features
  • Help users configure multimodal providers correctly on first try
  • Prevent duplicate issues and confusion
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/9898 **State:** open **Merged:** No --- # docs: add modalities configuration for custom providers ## Summary Adds documentation for the `modalities` property that enables vision and multimodal support in custom OpenAI-compatible providers. ## Problem The `modalities` configuration property exists in the codebase and works correctly, but is not documented anywhere. This causes users to: - Believe vision/multimodal support is unavailable for custom providers - Try incorrect properties like `supportsImageInput` or `capabilities.vision` - Create duplicate issues asking how to enable image support - Potentially abandon OpenCode for other tools ## Solution Added a new "Multimodal Support" section to the custom provider documentation that: - Documents the `modalities` property with a clear example - Lists all supported input/output modalities (`text`, `audio`, `image`, `video`, `pdf`) - Explains validation behavior when modalities are not configured - Provides a practical example showing image input configuration ## Changes - **File**: `packages/web/src/content/docs/providers.mdx` - **Location**: Added after the existing custom provider example, before the Troubleshooting section - **Format**: Follows the existing documentation style with code examples and tips ## Testing - ✅ Configuration property exists in schema: `packages/opencode/src/provider/models.ts:53-58` - ✅ Used in capability detection: `packages/opencode/src/provider/provider.ts:769-773` - ✅ Covered by tests: `packages/opencode/test/provider/provider.test.ts:1254-1257` - ✅ Verified working with real-world custom provider (TaxHawk API) ## Example Configuration ```json { "provider": { "myprovider": { "npm": "@ai-sdk/openai-compatible", "models": { "my-vision-model": { "name": "My Vision Model", "modalities": { "input": ["text", "image"], "output": ["text"] } } } } } } ``` ## Related - PR #5531 mentions multimodal support for `@ai-sdk/openai-compatible` - Test coverage: `test/provider/provider.test.ts:1241-1280` ## Impact This documentation will: - Reduce support burden from users asking about vision support - Improve discoverability of existing features - Help users configure multimodal providers correctly on first try - Prevent duplicate issues and confusion
yindo added the pull-request label 2026-02-16 18:18:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13265