惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Thoughts while building

OpenFreeMap survived 100,000 requests per second Investigating AI Manipulation in Viral Chinese Paraglider Video The curious case of the packageManager field in package.json 2nd stage of the AI age: AI Labs Need Your Data TIL: Get file list from eslint, biome and ruff TIL: CSS-in-JS modules for SolidJS TIL: Auth provider updates Understanding Round Robin DNS First month of OpenFreeMap Is there now a generation of users who never worked with files? Comparing Auth from Supabase, Firebase, Auth.js, Ory, Clerk and others
TIL: Vercel AI SDK - the bloat king
Zsolt Ero · 2024-12-11 · via Thoughts while building

I was looking for a simple universal JS lib that could handle OpenAI/Anthropic/Google responses without having to install each client lib. Considering all these do is JSON requests, those client libs are actually quite big - for example, OpenAI is 87 kB on its own (bundled with Vite), though Google is only 25 kB.

From what I've seen, there's one universal library from Vercel called AI SDK. It has 870k weekly downloads on NPM and a fancy package name: just "ai" (I wonder how much that one cost).

It's split into 2 packages, and the "Core" one sounds promising! So how much does this "Core" add to the bundle when using it for just a single OpenAI request?

A whopping 186 kB! For a tool that simply calls an OpenAI endpoint. What is basically just a JSON request.

I really don't get Vercel and the whole ecosystem they built with VC money. Everything they do is the most overcomplicated, architecture-astronaut level stuff. Like here, just the "packages" subdir is 73 thousand lines of code. For a JSON API wrapper!

I mean, the "bad guys" story would be: let's create extremely bloated JS libs so that you'll pick our solutions which allow you to run these on our servers. But I really don't think this is the case - it's just that Vercel's company culture is all about overcomplicating everything.

I've read from many devs that you choose Vercel for the amazing DX, but I just really don't see that DX. Luckily, I haven't had to refactor Next.js codebases every year, but even from what I've seen, everything they do is the opposite of great DX.

Anyway, back to my original quest - I haven't found any minimalistic, universal JS lib that supports streaming from multiple providers, so I'll be writing it myself using the low-level "eventsource-parser" lib.

Has anyone found anything for this purpose?

Discussion about this post

Ready for more?