Skip to main content
EVOKORE// SKILLS / CONTRIBUTING
vercel/aimarkdownsha 1C10F93CAE0B

CONTRIBUTING

contribution guide

Contributing to the Vercel AI SDK

Thanks for your interest in contributing to the Vercel AI SDK! This guide covers everything you need to know.

Development Setup

Prerequisites

  • Node.js 18+
  • pnpm 9+

Getting Started

git clone https://github.com/vercel/ai.git
cd ai
pnpm install
pnpm build

Running Tests

# All tests
pnpm test

# Specific package
pnpm test --filter=ai

# Watch mode
pnpm test --filter=ai -- --watch

Repository Structure

This is a monorepo managed with pnpm workspaces and Turborepo:

  • packages/ai/ — Core AI SDK (ai package)
  • packages/provider/ — Provider interface and utilities
  • packages/openai/ — OpenAI provider (@ai-sdk/openai)
  • packages/anthropic/ — Anthropic provider (@ai-sdk/anthropic)
  • packages/google/ — Google provider (@ai-sdk/google)
  • examples/ — Example applications
  • content/docs/ — Documentation (MDX)

Contribution Guidelines

Types of Contributions

  • Bug fixes: Always welcome, please include a test case
  • New providers: Follow the provider interface in packages/provider/
  • Documentation: Improvements to docs, examples, and guides
  • Performance: Streaming and parsing optimizations

Pull Request Process

  1. Create a branch from main
  2. Write or update tests
  3. Ensure pnpm build and pnpm test pass
  4. Add a changeset: pnpm changeset
  5. Submit your PR with a clear description

Code Standards

  • TypeScript strict mode
  • ESLint + Prettier formatting
  • No any types (use unknown and narrow)
  • Comprehensive JSDoc on public APIs
  • Unit tests for all utility functions

Provider Development

To add a new provider:

  1. Create a package in packages/<provider-name>/
  2. Implement the LanguageModel interface from @ai-sdk/provider
  3. Add streaming support via ReadableStream
  4. Include integration tests with API mocking
  5. Add documentation in content/docs/providers/

Changesets

We use Changesets for version management:

pnpm changeset
# Select the packages affected
# Choose the semver bump type
# Write a changelog entry

License

By contributing, you agree that your contributions will be licensed under the Apache License 2.0.