Skip to content

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

Merged
rekram1-node merged 1 commit intoanomalyco:devfrom
vercel:fix-reranking-type-upstream
Apr 16, 2026
Merged

fix(vercel): accept reranking model type from API#1466
rekram1-node merged 1 commit intoanomalyco:devfrom
vercel:fix-reranking-type-upstream

Conversation

@R-Taneja
Copy link
Copy Markdown
Collaborator

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 so anyone else running the script gets the fix too.

Test plan

  • Run bun run vercel:generate --new-only --dry-run and confirm it completes without the invalid_enum_value error.
  • Confirm no new TOML files are generated for reranking models under providers/vercel/models/.

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.
@rekram1-node rekram1-node merged commit 7680a1d into anomalyco:dev Apr 16, 2026
1 check passed
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.

2 participants