GitHub - DataForScience/LLMs
LLMs for Science
Educational notebooks exploring production-grade agentic systems and LLMs pipelines from first principles. Learn the core patterns behind tools like Claude Code, Cursor's agent mode, and autonomous research assistants by implementing them yourself.
These notebooks teach you to build the scaffolding that transforms an LLM from a text generator into a truly useful everyday tool.
What You'll Learn
Notebook 1: Basic Agentic Harness
Build a minimal but complete harness from scratch — the foundation of any autonomous agent system.
Core concepts:
- The five components of a harness's core state (goal, trace, memory, budget, status)
- Implementing a control loop that drives an LLM through multi-step tasks
- Defining typed tools the LLM can call safely
- Validating LLM-proposed actions against schemas before execution
- Inspecting execution traces for debugging
What you'll build: A single-agent harness that solves multi-step research tasks by repeatedly composing context, asking the LLM what to do next, executing tool calls, and updating state until the goal is met.
Notebooks
- 01 - Basic Agentic Harness.ipynb — Start here to understand the fundamentals
Setup
1) Install dependencies (recommended: uv)
- Install
uv(if needed):
curl -LsSf https://astral.sh/uv/install.sh | sh- Create an environment and install dependencies:
git clone https://github.com/DataForScience/LLMs.git cd LLMs uv venv source .venv/bin/activate # Windows: .venv\Scripts\activate uv sync
2) API Keys (Optional)
The notebooks run end-to-end in mock mode without any API keys. They include rule-based mock LLM providers that are smart enough to drive the demos.
To use real LLM APIs, set your Anthropic API key:
export ANTHROPIC_API_KEY=sk-ant-...Then change BACKEND = "mock" to BACKEND = "anthropic" in the notebook.
3) Launch notebooks
Repository Structure
LLMs/
├── 01 - Basic Agentic Harness.ipynb # Notebook 1: Fundamentals
├── Template.ipynb # Blank template for experiments
├── data/ # Logos and assets
│ ├── D4Sci_logo_ball.png
│ ├── D4Sci_logo_full.png
│ └── bgoncalves.png
├── d4sci.mplstyle # Custom matplotlib style
├── pyproject.toml # Dependency manifest (for `uv sync`)
├── uv.lock # Lock file for reproducible builds
└── LICENSE # MIT License
Learning Path
- Start with Notebook 1 (
01 - Basic Agentic Harness.ipynb) to understand the core concepts
Key Features
- Fully reproducible — Deterministic outputs for teaching and debugging
- Production-ready patterns — Learn the same techniques used in Claude Code, Cursor, and Devin
- Hands-on implementation — Build everything from scratch to understand every design decision
Questions?
Reach out at info@data4sci.com or open an issue if something isn't working.