Skip to content

fix(vercel): accept reranking model type from API#1465

Closed
R-Taneja wants to merge 1 commit intoanomalyco:devfrom
R-Taneja:fix-reranking-type-upstream
Closed

fix(vercel): accept reranking model type from API#1465
R-Taneja wants to merge 1 commit intoanomalyco:devfrom
R-Taneja:fix-reranking-type-upstream

Conversation

@R-Taneja
Copy link
Copy Markdown
Collaborator

@R-Taneja R-Taneja commented Apr 16, 2026

Summary

The Vercel AI Gateway API at https://ai-gateway.vercel.sh/v1/models now returns models with type: "reranking", which isn't in the Zod enum used by packages/core/script/generate-vercel.ts. Running the script today fails with:

Invalid enum value. Expected 'language' | 'embedding' | 'image' | 'video', received 'reranking'

This PR:

  • Adds reranking to the ModelType enum so parsing succeeds.
  • Skips reranking models in the main loop — same pattern already used for image / video, since OpenCode doesn't consume them.

The same fix was already merged into the Vercel fork as vercel#5; opening this against upstream.

The Vercel AI Gateway API now returns models with type "reranking",
which caused the generate-vercel script to fail schema validation.

Add "reranking" to the ModelType enum and skip these models in the
main loop, matching the existing pattern for image/video types that
OpenCode does not consume.
@R-Taneja
Copy link
Copy Markdown
Collaborator Author

Reopening from vercel/models.dev fork instead — see new PR.

@R-Taneja R-Taneja closed this Apr 16, 2026
@R-Taneja R-Taneja deleted the fix-reranking-type-upstream branch April 16, 2026 18:08
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