Skip to content

Conversation

MyPrototypeWhat
Copy link

@MyPrototypeWhat MyPrototypeWhat commented Sep 18, 2025

Problem

The OpenRouterProvider class was incorrectly extending LanguageModelV2, which is inconsistent with the pattern used by other AI SDK providers. All other provider classes in the ecosystem properly extend ProviderV2 and their createXxx functions return their own XxxProvider instances.

Solution

  • Changed OpenRouterProvider to extend ProviderV2 instead of LanguageModelV2
  • This aligns the OpenRouter provider with the standard provider architecture used throughout the AI SDK ecosystem

Impact

  • ✅ Maintains consistency with other AI SDK providers
  • ✅ Follows the established provider pattern where providers extend ProviderV2
  • ✅ No breaking changes to the public API
  • ✅ Improved type safety and IntelliSense support

Change:

export interface OpenRouterProvider extends LanguageModelV2 
// ⬇️
export interface OpenRouterProvider extends ProviderV2

@MyPrototypeWhat MyPrototypeWhat changed the title fix: OpenRouterProvider extends ProviderV2 fix: OpenRouterProvider should extend ProviderV2 instead of LanguageModelV2 Sep 18, 2025
Sign up for free to 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