# datawhalechina/llm-cookbook architecture

> Architecture diagram of the GitHub repository datawhalechina/llm-cookbook, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/datawhalechina/llm-cookbook
- Repository: https://github.com/datawhalechina/llm-cookbook

## Overview

LLM Cookbook is a Chinese-oriented, hands-on curriculum for developers learning LLM application development—not a single runtime application. A learner follows foundational prompt and API-system courses, then explores LangChain and personal-data RAG, with electives for interfaces, retrieval, evaluation, agents, and fine-tuning. The map captures documented course capabilities and a few sampled runtime helpers. Notebook internals and most elective implementations were not inspected, so their internal calls are omitted.

Main entry points: [`README.md`](https://github.com/datawhalechina/llm-cookbook/blob/main/README.md) (LLM Cookbook), [`content/选修-Finetuning Large Language Models/config/configuration.py`](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration.py) (Configuration), [`content/选修-Finetuning Large Language Models/utilities.py`](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/utilities.py) (Training utilities), [`content/选修-Finetuning Large Language Models/config/configuration_set.py`](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration_set.py) (Config composition)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundations["LLM foundations"]
  node_curriculum["LLM Cookbook<br/>[README.md]"]
  node_prompt_course["Prompt engineering"]
end

subgraph group_applications["Application development"]
  node_api_systems["ChatGPT API systems"]
  node_langchain_apps["LangChain apps"]
  node_agent_tools["Tools and agents"]
end

subgraph group_retrieval["Retrieval and RAG"]
  node_personal_data["Personal-data chat"]
  node_semantic_search["Semantic search"]
  node_chroma_retrieval["Chroma retrieval"]
  node_advanced_rag["Advanced RAG"]
end

subgraph group_electives["Advanced electives"]
  node_advanced_prompt["Advanced prompting"]
  node_gradio_apps["Gradio applications"]
  node_genai_eval["GenAI evaluation"]
  node_finetuning["LLM fine-tuning"]
end

subgraph group_runtime["Sampled runtime helpers"]
  node_api_helpers["API examples<br/>[utils_zh.py]"]
  node_eval_helpers["Diffusion utilities<br/>[utilities.py]"]
  node_finetune_utils["Training utilities<br/>[utilities.py]"]
  node_finetune_config["Configuration<br/>[configuration.py]"]
  node_config_set["Config composition"]
  node_config_helpers["Config helpers<br/>[helpers.py]"]
  node_image_ui["Image caption UI<br/>[image_demo.py]"]
  node_image_caption["Image caption client<br/>[image2text_chat.py]"]
end

node_learner(("Developer learner"))

node_learner -->|"studies"| node_curriculum
node_curriculum -->|"starts with"| node_prompt_course
node_curriculum -->|"teaches"| node_api_systems
node_curriculum -->|"teaches"| node_langchain_apps
node_curriculum -->|"extends to"| node_personal_data
node_curriculum -->|"offers elective"| node_advanced_prompt
node_curriculum -->|"offers elective"| node_gradio_apps
node_curriculum -->|"offers elective"| node_genai_eval
node_curriculum -->|"offers elective"| node_finetuning
node_curriculum -->|"offers elective"| node_semantic_search
node_curriculum -->|"offers elective"| node_chroma_retrieval
node_curriculum -->|"offers elective"| node_advanced_rag
node_curriculum -->|"offers elective"| node_agent_tools
node_finetune_utils -->|"imports"| node_finetune_config
node_config_set -->|"uses"| node_finetune_config
node_finetune_config -->|"uses"| node_config_helpers
node_image_ui -->|"calls"| node_image_caption

click node_curriculum "https://github.com/datawhalechina/llm-cookbook/blob/main/README.md"
click node_prompt_course "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%B8%80-Prompt%20Engineering%20For%20Developers"
click node_api_systems "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%BA%8C-Building%20Systems%20with%20the%20ChatGPT%20API"
click node_langchain_apps "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%B8%89-LangChain%20for%20LLM%20Application%20Development"
click node_personal_data "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E5%9B%9B-LangChain%20Chat%20with%20Your%20Data"
click node_advanced_prompt "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Advanced%20Prompting"
click node_gradio_apps "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Building%20Generative%20AI%20Applications%20with%20Gradio"
click node_genai_eval "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Evaluating%20and%20Debugging%20Generative%20AI"
click node_finetuning "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models"
click node_semantic_search "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Large%20Language%20Models%20with%20Semantic%20Search"
click node_chroma_retrieval "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Advanced%20Retrieval%20for%20AI%20with%20Chroma"
click node_advanced_rag "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Building%20and%20Evaluating%20Advanced%20RAG%20Applications"
click node_agent_tools "https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Functions%2C%20Tools%20and%20Agents%20with%20LangChain"
click node_api_helpers "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E5%BF%85%E4%BF%AE%E4%BA%8C-Building%20Systems%20with%20the%20ChatGPT%20API/utils_zh.py"
click node_eval_helpers "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Evaluating%20and%20Debugging%20Generative%20AI/utilities.py"
click node_finetune_utils "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/utilities.py"
click node_finetune_config "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration.py"
click node_config_set "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration_set.py"
click node_config_helpers "https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/helpers.py"
click node_image_ui "https://github.com/datawhalechina/llm-cookbook/blob/main/utils/image_demo.py"
click node_image_caption "https://github.com/datawhalechina/llm-cookbook/blob/main/utils/image2text_chat.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_curriculum,node_prompt_course toneBlue
class node_api_systems,node_langchain_apps,node_agent_tools toneAmber
class node_personal_data,node_semantic_search,node_chroma_retrieval,node_advanced_rag toneMint
class node_advanced_prompt,node_gradio_apps,node_genai_eval,node_finetuning toneRose
class node_api_helpers,node_eval_helpers,node_finetune_utils,node_finetune_config,node_config_set,node_config_helpers,node_image_ui,node_image_caption,node_learner toneIndigo
```

## Components

### LLM foundations

- [LLM Cookbook](https://github.com/datawhalechina/llm-cookbook/blob/main/README.md): `README.md`
- [Prompt engineering](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%B8%80-Prompt%20Engineering%20For%20Developers): `content/必修一-Prompt Engineering For Developers`

### Application development

- [ChatGPT API systems](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%BA%8C-Building%20Systems%20with%20the%20ChatGPT%20API): `content/必修二-Building Systems with the ChatGPT API`
- [LangChain apps](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E4%B8%89-LangChain%20for%20LLM%20Application%20Development): `content/必修三-LangChain for LLM Application Development`
- [Tools and agents](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Functions%2C%20Tools%20and%20Agents%20with%20LangChain): `content/选修-Functions, Tools and Agents with LangChain`

### Retrieval and RAG

- [Personal-data chat](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E5%BF%85%E4%BF%AE%E5%9B%9B-LangChain%20Chat%20with%20Your%20Data): `content/必修四-LangChain Chat with Your Data`
- [Semantic search](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Large%20Language%20Models%20with%20Semantic%20Search): `content/选修-Large Language Models with Semantic Search`
- [Chroma retrieval](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Advanced%20Retrieval%20for%20AI%20with%20Chroma): `content/选修-Advanced Retrieval for AI with Chroma`
- [Advanced RAG](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Building%20and%20Evaluating%20Advanced%20RAG%20Applications): `content/选修-Building and Evaluating Advanced RAG Applications`

### Advanced electives

- [Advanced prompting](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Advanced%20Prompting): `content/选修-Advanced Prompting`
- [Gradio applications](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Building%20Generative%20AI%20Applications%20with%20Gradio): `content/选修-Building Generative AI Applications with Gradio`
- [GenAI evaluation](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Evaluating%20and%20Debugging%20Generative%20AI): `content/选修-Evaluating and Debugging Generative AI`
- [LLM fine-tuning](https://github.com/datawhalechina/llm-cookbook/tree/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models): `content/选修-Finetuning Large Language Models`

### Sampled runtime helpers

- [API examples](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E5%BF%85%E4%BF%AE%E4%BA%8C-Building%20Systems%20with%20the%20ChatGPT%20API/utils_zh.py): `content/必修二-Building Systems with the ChatGPT API/utils_zh.py`
- [Diffusion utilities](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Evaluating%20and%20Debugging%20Generative%20AI/utilities.py): `content/选修-Evaluating and Debugging Generative AI/utilities.py`
- [Training utilities](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/utilities.py): `content/选修-Finetuning Large Language Models/utilities.py`
- [Configuration](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration.py): `content/选修-Finetuning Large Language Models/config/configuration.py`
- [Config composition](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/configuration_set.py): `content/选修-Finetuning Large Language Models/config/configuration_set.py`
- [Config helpers](https://github.com/datawhalechina/llm-cookbook/blob/main/content/%E9%80%89%E4%BF%AE-Finetuning%20Large%20Language%20Models/config/helpers.py): `content/选修-Finetuning Large Language Models/config/helpers.py`
- [Image caption UI](https://github.com/datawhalechina/llm-cookbook/blob/main/utils/image_demo.py): `utils/image_demo.py`
- [Image caption client](https://github.com/datawhalechina/llm-cookbook/blob/main/utils/image2text_chat.py): `utils/image2text_chat.py`

### Other components

- **Developer learner**

## Connections

- Developer learner → LLM Cookbook: studies (evidence: `README.md`)
- LLM Cookbook → Prompt engineering: starts with (evidence: `README.md`)
- LLM Cookbook → ChatGPT API systems: teaches (evidence: `README.md`)
- LLM Cookbook → LangChain apps: teaches (evidence: `README.md`)
- LLM Cookbook → Personal-data chat: extends to (evidence: `README.md`)
- LLM Cookbook → Advanced prompting: offers elective (evidence: `README.md`)
- LLM Cookbook → Gradio applications: offers elective (evidence: `README.md`)
- LLM Cookbook → GenAI evaluation: offers elective (evidence: `README.md`)
- LLM Cookbook → LLM fine-tuning: offers elective (evidence: `README.md`)
- LLM Cookbook → Semantic search: offers elective (evidence: `README.md`)
- LLM Cookbook → Chroma retrieval: offers elective (evidence: `README.md`)
- LLM Cookbook → Advanced RAG: offers elective (evidence: `README.md`)
- LLM Cookbook → Tools and agents: offers elective (evidence: `README.md`)
- Training utilities → Configuration: imports (evidence: `content/选修-Finetuning Large Language Models/utilities.py`)
- Config composition → Configuration: uses (evidence: `content/选修-Finetuning Large Language Models/config/configuration_set.py`)
- Configuration → Config helpers: uses (evidence: `content/选修-Finetuning Large Language Models/config/configuration.py`)
- Image caption UI → Image caption client: calls (evidence: `utils/image_demo.py`)
