Skip to content
Building an LLM in NodeJS book cover

Building an LLM in NodeJS

The from-scratch guide to building large language models in NodeJS and TypeScript.

Learn how large language models actually work by building one from scratch in Node.js and TypeScript.

No black boxes

We’ll build every layer, from attention mechanisms to the training loop.

From scratch

Dataset, dataloader, attention, transformer block, GPT, and the training loop built up chapter by chapter.

Runnable

Every chapter has a runnable entry point in the @node-llm/chapters package, all on GitHub.

Interactive

Soon

Live WebGPU demos from the @node-llm/playground package are embedded throughout.