Reading the repo
Opening the box…
Reading the repo
Opening the box…
How to install on Windows
The AI Toolkit for TypeScript. From the creators of Next.js, the AI SDK is a free open-source library for building AI-powered applications and agents
Saved setup from 3 h ago
Will it work on Windows?
Heads-upBuilding it yourself? It also needs 74 settings in .env (53 secret).
CONTRIBUTING.mdWe deeply appreciate your interest in contributing to our repository! Whether you're reporting bugs, suggesting enhancements, improving docs, sharing community projects, building provider integrations, or submitting pull requests, your contributions help improve the project for everyone.
We use our own specialized agents to work on open issues, including bug fixes and feature implementations. Maintainers and automated workflows also review new issues, triage reports, and reproduce bugs.
Because of this, the most helpful contribution is often a high-quality issue rather than a complete pull request. Clear bug reports, minimal reproductions, failing tests, precise documentation feedback, and thoughtful feature requests help us understand the problem and make better fixes for everyone.
We discourage opening pull requests to fix bug reports or implement feature requests authored by someone else. An exception is a pull request that adds useful context best expressed with code, such as a minimal reproduction, a failing test, or a focused example that clarifies the expected behavior. Please link the issue and explain what new context your code provides.
Pull requests are still welcome, especially when they:
You do not need to send a full implementation for maintainers to value your contribution. When an issue leads to a bug fix pull request, we will credit the issue author with co-authorship where appropriate. Pull request authors will also be credited when their work adds valuable input to resolving a bug report or improves the quality of the fix.
We know this transition may feel different from how open source contribution has traditionally worked. We value our community and all the ways people help AI SDK grow. If this process creates friction or frustration, please open a feedback issue and tell us what is not working.
If you're interested in becoming a contributor or committer, we encourage you to use the AI SDK extensively in real projects and report issues you encounter through real-life usage. Sharing concrete use cases, clear bug reports, and feature requests grounded in that experience helps us understand what matters to users and improve the SDK.
If you've encountered a bug in the project, we encourage you to report it to us. Please follow these steps:
We're always looking for suggestions to make our project better. If you have an idea for an enhancement, please:
Use the feedback issue type for community feedback, process feedback, or ideas about how to make AI SDK a better project to use and contribute to. This is the best place to tell us how the move toward more automated maintenance is affecting you.
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 v11 and Node v22.13, v24, or v26.
To set up the repository on your local machine, follow these steps:
git clone.npm install -g pnpm@11 if you're using npm. Alternatively, if you're using Homebrew (Mac), you can run brew install pnpm. For more see the pnpm site.pnpm install to install all necessary dependencies. This also sets up Git hooks via Husky.pnpm build in the root to build all packages.If you work on multiple branches in parallel using git worktrees, run pnpm worktree:setup from the root of a newly created worktree. This symlinks the .env files (root, examples/ai-functions, and examples/ai-e2e-next) from your main worktree into the new one and runs pnpm install.
Tip: consider automating this so you don't have to remember it on every new worktree — for example, by wrapping git worktree add in a shell alias/function that cds into the new directory and runs pnpm worktree:setup, or by invoking it from a post-checkout hook (which fires on git worktree add).
cd examples/ai-functions (for AI SDK Core, or another example folder)pnpm tsx src/stream-text/openai.ts
OPENAI_API_KEYpnpm dev and go to the browser urlTo 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.
We greatly appreciate focused pull requests. Before investing in an implementation, please review how we value contributions and open or improve an issue first. Please avoid submitting fixes or feature implementations for issues you did not author, unless the purpose of the pull request is to add useful context best expressed with code. Our specialized agents work on open issues, and we will credit high-quality reports that lead to fixes.
Pull requests are most helpful when they include documentation fixes, reproduction examples, failing tests, or small focused changes that make the issue clearer.
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 update any packages, add a patch changeset to your branch by running pnpm changeset in the workspace root.
examples/* packages, as they are not released. But, if you change a README.md, create a changeset so that the package's documentation on npm's website is updated.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.
Sign Your Commits: All commits must be signed. Pull requests with unsigned commits cannot be merged.
Pre-commit hooks: A pre-commit hook automatically formats your staged files using lint-staged when you commit. If you stage any package.json changes, pnpm install runs automatically to keep the lockfile in sync. If you need to skip these hooks (e.g., for work-in-progress commits), set ARTISANAL_MODE=1 before committing: ARTISANAL_MODE=1 git commit -m "message".
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): description orfeat(package-name): description orchore(package-name): description etc.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.
Then run powershell -ExecutionPolicy Bypass -File .\setup.ps1. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: winget install Git.Git
git clone https://github.com/vercel/ai.git cd ai
Node.js ^22.13.0 || ^24.0.0 || ^26.0.0
winget install CoreyButler.NVMforWindows nvm install 22 nvm use 22
corepack enable pnpm install
pnpm dev
pnpm test
No reports for Windows yet.
GitManual AI Agent reads the 15 key files and writes a step-by-step guide for Windows. Once written, it's saved for everyone.