Skip to content

Conversation

@gr2m
Copy link
Collaborator

@gr2m gr2m commented Oct 9, 2025

Background

Summary

  • replaced examples/ai-core/src/benchmark/anthropic-load-time.ts with examples/ai-core/src/benchmark/provider-load-time.ts for provider-agnostic bechmarks with average from 10 isolated imports
  • updated schemas for Google to use lazy schemas
  • import time improved by 12.5% (22.3ms ➡️ 19.5ms)

Manual Verification

cd examples/ai-core
pnpm tsx /Users/gr2m/code/vercel/ai/examples/ai-core/src/benchmark/provider-load-time.ts google

Searched for z.infer() in packages/google - no results

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • n/a Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • Formatting issues have been fixed (run pnpm prettier-fix in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

…ipt that calculates average based on 10 runs
@gr2m gr2m changed the title chore(provider/google): lazy schema loading fix(provider/google): lazy schema loading Oct 9, 2025
@gr2m gr2m marked this pull request as ready for review October 9, 2025 21:28
@gr2m gr2m added the backport label Oct 9, 2025
@gr2m gr2m merged commit ee50cc5 into main Oct 10, 2025
14 checks passed
@gr2m gr2m deleted the 9340-lazy-load-schemas-for-ai-sdkgoogle-provider branch October 10, 2025 04:23
vercel-ai-sdk bot pushed a commit that referenced this pull request Oct 10, 2025
@vercel-ai-sdk vercel-ai-sdk bot removed the backport label Oct 10, 2025
@vercel-ai-sdk
Copy link
Contributor

vercel-ai-sdk bot commented Oct 10, 2025

⚠️ Backport to release-v5.0 created but has conflicts: #9354

gr2m added a commit that referenced this pull request Oct 10, 2025
This is an automated backport of #9341 to the release-v5.0 branch.

---------

Co-authored-by: Gregor Martynus <[email protected]>
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.

Lazy-load schemas for ai-sdk/google provider

2 participants