Skip to content

kometolabs/ai-sdk-comparison

Repository files navigation

AI SDK Comparison

Code examples implemented with different AI frameworks, such as Vercel AI SDK, Firebase Genkit and Langchain.js.

The main aim is to compare the frameworks and decide which one to choose for next projects.

All of the examples use the same model (Anthropic Claude Sonnet 3.5) for cleaner comparison.

Check out @kkomelin's companion post on his blog.

Installation

Clone the repo:

git clone git@github.com:kometolabs/ai-sdk-comparison.git
cd ai-sdk-comparison

Install dependencies:

pnpm i

Usage

Simple non-interactive example without tools plugged:

# src/vercel.simple.ts
pnpm vercel:simple
# src/genkit.simple.ts
pnpm genkit:simple
# src/langchain.simple.ts
pnpm langchain:simple

Simple non-interactive example with a Temperature tool plugged:

# src/vercel.tool.ts
pnpm vercel:tool
# src/genkit.tool.ts
pnpm genkit:tool
# src/langchain.tool.ts
pnpm langchain:tool

Interactive Chat example with a Temperature tool plugged:

# src/vercel.chat.ts
pnpm vercel:chat
# src/genkit.chat.ts
pnpm genkit:chat
# src/langchain.chat.ts
pnpm langchain:chat

Ask something like this to run the temperature tool:

What's the temperature in New York?

Contribute

If you see ways to improve the examples, e.g. adapt them to the latest framework updates, shoot a PR.