Post

For v1, I wrote my own abstraction layer While I love the chainable + immutable + string-templates + type-safety combo, writing my own adapters was too time consuming So after using @mattpocock.com Evalite, I decided to keep my approach but switch the engine to Vercel's sdk as a peer dependency

0 reposts0 likes

This allows me to benefit from the countless integrations and tons of contributions to AI SDK while keeping my target level of developer experience Here's a quick tour of some of the features:

1️⃣ Immutability + Chaining I've always been a fan of superagent's clean immutable and chainable API allowing me to build upon a base instance of query github.com/ladjs/super... This was my target to replicate, but for LLMs and most of my libraries published under @synstack operate that way

github.comGitHub - ladjs/superagent: Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs. - ladjs/superagent

2️⃣ Type safety There's type safety at every level: 🔶 Tool definitions, filters, & outputs 🔶 Calling the llm with missing required parameters will trigger a TS error 🔶 Message template string values are type-safe as well Even my test coverage is mostly type testing for now github.com/pAIrprogio/...

github.comsynscript/packages/llm/src/completion.builder.test.ts at main · pAIrprogio/synscriptLibraries for immutable and chainable LLM compatible scripting - pAIrprogio/synscript

3️⃣ Template strings I hate the base JS template string because it breaks indentation So I wrote a separate library to fix that. 🔶 Trims text and removes extra indentation 🔶 Auto-resolves promises 🔶 Arrays to separate lines 🔶 Propagates nested indentation github.com/pAIrprogio/...