You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: config provider-level npm override dropped for inherited models #41162
A config-level npm override for an existing provider (e.g. provider.synthetic.npm = "@ai-sdk/anthropic") is silently dropped for models inherited from models.dev. The config-merge parsed object in provider.ts never carries npm, and apiNpm is only recomputed for models explicitly declared in config.
Impact: inherited models keep their models.dev api.npm, so the request uses the overridden options.baseURL with the original SDK — producing mismatched SDK+URL 404s. Concrete failure: with provider.synthetic.npm = "@ai-sdk/anthropic" + options.baseURL = ".../anthropic/v1", opencode POSTs /chat/completions (openai-compatible SDK) to an Anthropic-compatible base URL → 404 API route not found.
Expected behavior
A provider-level npm in config should propagate to all inherited models (those not explicitly declared in provider.models), so the SDK matches the overridden endpoint.
This issue might be a duplicate of an existing issue. Please check:
Provider-level npm field silently ignored unless models is also configured #33888: Provider-level npm field silently ignored unless models is also configured — describes the same root cause (npm resolution only happens inside the provider.models loop, so inherited/discovered models keep their original SDK regardless of the provider-level npm override) and includes the same workaround (enumerate models explicitly).
Activity
github-actions commentedon Aug 8, 2026
This issue might be a duplicate of an existing issue. Please check:
npmfield silently ignored unlessmodelsis also configured #33888: Provider-levelnpmfield silently ignored unlessmodelsis also configured — describes the same root cause (npm resolution only happens inside theprovider.modelsloop, so inherited/discovered models keep their original SDK regardless of the provider-levelnpmoverride) and includes the same workaround (enumerate models explicitly).github-actions commentedon Oct 7, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.