We deeply appreciate your interest in contributing to our repository! Whether you're reporting bugs, suggesting enhancements, improving docs, or submitting pull requests, your contributions help improve the project for everyone.
If you've encountered a bug in the project, we encourage you to report it to us. Please follow these steps:
- Check the Issue Tracker: Before submitting a new bug report, please check our issue tracker to see if the bug has already been reported. If it has, you can add to the existing report.
- Create a New Issue: If the bug hasn't been reported, create a new issue. Provide a clear title and a detailed description of the bug. Include any relevant logs, error messages, and steps to reproduce the issue.
- Label Your Issue: If possible, label your issue as a
bugso it's easier for maintainers to identify.
We're always looking for suggestions to make our project better. If you have an idea for an enhancement, please:
- Check the Issue Tracker: Similar to bug reports, please check if someone else has already suggested the enhancement. If so, feel free to add your thoughts to the existing issue.
- Create a New Issue: If your enhancement hasn't been suggested yet, create a new issue. Provide a detailed description of your suggested enhancement and how it would benefit the project.
Documentation is crucial for understanding and using our project effectively.
You can find the content of our docs under content.
To fix smaller typos, you can edit the code directly in GitHub or use Github.dev (press . in Github).
If you want to make larger changes, please check out the Code Contributions section below. It also explains how to fix prettier issues that you might encounter during your docs changes.
We welcome your contributions to our code and documentation. Here's how you can contribute:
AI SDK development requires PNPM v9 (lockfile version) or higher and Node v22.
To set up the repository on your local machine, follow these steps:
- Fork the Repository: Make a copy of the repository to your GitHub account.
- Clone the Repository: Clone the repository to your local machine, e.g. using
git clone. - Install Node: If you haven't already, install Node v22.
- Install pnpm: If you haven't already, install pnpm v10. You can do this by running
npm install -g pnpm@10if you're using npm. Alternatively, if you're using Homebrew (Mac), you can runbrew install pnpm. For more see the pnpm site. - Install Dependencies: Navigate to the project directory and run
pnpm installto install all necessary dependencies. - Build the Project: Run
pnpm buildin the root to build all packages.
cd examples/ai-core(for AI SDK Core, or another example folder)- AI SDK Core examples: run e.g.
pnpm tsx src/stream-text/openai.ts - Other framework examples: run
pnpm devand go to the browser url
To build the package that you're working on, run pnpm build or pnpm build:watch in the package folder.
This command updates the dist folder with the new version of the package.
Once built, the new code is picked up by the examples.
To test the package that you're working on, run pnpm test in the package folder.
You do not need to rebuild your package to test it (only dependencies need to be built).
Some packages like ai also have more details tests and watch mode, see their package.json for more information.
Please run pnpm update-references in workspace root to update the references section in the tsconfig.json file.
We greatly appreciate your pull requests. Here are the steps to submit them:
-
Create a New Branch: Initiate your changes in a fresh branch. It's recommended to name the branch in a manner that signifies the changes you're implementing.
-
Add a patch changeset: If you're updating any packages and want to ensure they're released, add a patch changeset to your branch by running
pnpm changesetin the workspace root.- Please do not use minor or major changesets, we'll let you know when you need to use a different changeset type than patch.
- You don't need to select any of the
examples/*packages, as they are not released.
-
Add a codemod: If the change introduces a deprecation or a breaking change, add a codemod if possible. See how to contribute codemods
-
Commit Your Changes: Ensure your commits are succinct and clear, detailing what modifications have been made and the reasons behind them. We don't require a specific commit message format, but please be descriptive.
-
Fix prettier issues: Run
pnpm prettier-fixto fix any formatting issues in your code. -
Push the Changes to Your GitHub Repository: After committing your changes, push them to your GitHub repository.
-
Open a Pull Request: Propose your changes for review. Furnish a lucid title and description of your contributions. Make sure to link any relevant issues your PR resolves. We use the following PR title format:
fix(package-name): descriptionorfeat(package-name): descriptionorchore(package-name): descriptionetc.
-
Respond to Feedback: Stay receptive to and address any feedback or alteration requests from the project maintainers.
Thank you for contributing to the AI SDK! Your efforts help us improve the project for everyone.
We have additional contributor documentation in the contributing/ folder.