Back to directory

LLMs for Science

A set of educational Jupyter notebooks that teach the core patterns behind tools like Claude Code and Cursor's agent mode by having the learner build an agentic harness, a small language model and an MCP server from first principles.

LLMs for Science

The notebooks progress from a basic agentic harness, covering the components of an agent's core state, a control loop that drives an LLM through multi-step tasks, typed tool definitions, schema validation of proposed actions, and inspectable execution traces, through building a small language model from scratch, to an advanced harness with production-grade patterns, an evaluation suite that turns a single successful run into measured pass rates, cost and failure-mode distributions, and finally a from-scratch MCP server that hands real data to an agent.

Every notebook runs offline end to end on a rule-based mock backend, so no API key is required, and the harness and MCP server built across the later notebooks are also kept as reusable modules and scripts rather than only inline code.

It is written mainly as Jupyter notebooks and released under the MIT license.

More in Tutorials

See all 478
  • BootLife

    github.com

    Conway's Game of Life implemented to run directly from a 512-byte x86 boot sector in assembly, using VGA memory itself as the simulation grid.

  • A technical blog post deriving the Y combinator as a composition of combinator birds in an array language, and examining how eager evaluation changes fixed-point recursion compared with the usual lazy telling.

  • System Design Atlas

    atlas-sysdes.vercel.app

    A free reference of worked system design problems with interactive architecture diagrams, covering ranked designs such as a feed, a chat app, a URL shortener, and a rate limiter, plus pages on the technologies behind them.