# datawhalechina/jev-cookbook architecture

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

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

## Overview

Jev Cookbook is a Chinese, notebook-oriented learning repository for building systems around typed System One decisions. Its principal learner workflow progresses from Choice/Score/Noul primitives and architecture patterns to hands-on recipes, then into applied projects and evaluation; optional paths cover agent integration and local-model fine-tuning. The map also captures the Python SDK, which exposes typed synchronous and asynchronous clients over HTTP. Chapter-level links follow the README’s learning path; source-level links are limited to relationships visible in the supplied excerpts and index.

Main entry points: [`main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py) (HTTP Transport), [`main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py`](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py) (Sync Client), [`main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py`](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py) (Async Client), [`main/01_认识Jev`](https://github.com/datawhalechina/jev-cookbook/tree/main/main/01_%E8%AE%A4%E8%AF%86Jev) (Introduction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learn["Core Learning"]
  node_intro["Introduction"]
  node_foundations["Core Concepts"]
  node_patterns["Architecture Patterns"]
  node_recipes["Cookbook Recipes"]
  node_knowledge["Knowledge Collection"]
end

subgraph group_applied["Applied Projects"]
  node_smart_home["Smart Home"]
  node_games["Games And Apps"]
end

subgraph group_research["Research And Evaluation"]
  node_eval["Model Evaluation<br/>[runner.py]"]
  node_jev_mem["Jev-Mem Research"]
end

subgraph group_ecosystem["Agents And Models"]
  node_pi_agent["Pi Integration"]
  node_dsh_agent["DSH Integration"]
  node_local_data["Local Data"]
  node_local_tuning["Local Fine-Tuning"]
  node_local_service["Local Model Service<br/>[rl_agent_api.py]"]
end

subgraph group_sdk["Python SDK"]
  node_sdk_sync["Sync Client<br/>[client.py]"]
  node_sdk_async["Async Client<br/>[client.py]"]
  node_sdk_transport["HTTP Transport<br/>[transport.py]"]
  node_sdk_types["Typed Answers<br/>[response_types.py]"]
  node_sdk_config["SDK Configuration<br/>[config.py]"]
  node_sdk_json["JSON Codec<br/>[json.py]"]
  node_sdk_retry["Retry Policy<br/>[retry.py]"]
end

node_learner(("Learner"))
node_api{{"TypeSafe API"}}

node_learner -->|"starts with"| node_intro
node_intro -->|"continues to"| node_foundations
node_foundations -->|"continues to"| node_patterns
node_patterns -->|"applies concepts"| node_recipes
node_learner -->|"explores"| node_smart_home
node_learner -->|"runs benchmarks"| node_eval
node_learner -->|"explores projects"| node_games
node_learner -->|"studies integration"| node_pi_agent
node_learner -->|"studies integration"| node_dsh_agent
node_learner -->|"builds dataset"| node_local_data
node_local_data -->|"feeds training"| node_local_tuning
node_local_tuning -->|"leads to serving"| node_local_service
node_learner -->|"consults reference"| node_knowledge
node_sdk_sync -->|"dispatches requests"| node_sdk_transport
node_sdk_async -->|"dispatches requests"| node_sdk_transport
node_sdk_sync -->|"resolves options"| node_sdk_config
node_sdk_async -->|"resolves options"| node_sdk_config
node_sdk_transport -->|"encodes bodies"| node_sdk_json
node_sdk_transport -->|"parses responses"| node_sdk_types
node_sdk_transport -->|"applies retries"| node_sdk_retry
node_sdk_transport -->|"sends HTTP"| node_api

click node_intro "https://github.com/datawhalechina/jev-cookbook/tree/main/main/01_%E8%AE%A4%E8%AF%86Jev"
click node_foundations "https://github.com/datawhalechina/jev-cookbook/tree/main/main/02_%E6%A0%B8%E5%BF%83%E6%A6%82%E5%BF%B5"
click node_patterns "https://github.com/datawhalechina/jev-cookbook/tree/main/main/03_%E6%9E%B6%E6%9E%84%E6%A8%A1%E5%BC%8F"
click node_recipes "https://github.com/datawhalechina/jev-cookbook/tree/main/main/04_%E5%AE%9E%E6%88%98%E6%8C%87%E5%8D%97"
click node_smart_home "https://github.com/datawhalechina/jev-cookbook/tree/main/main/05_%E6%99%BA%E8%83%BD%E5%AE%B6%E5%B1%85%E5%AE%9E%E9%AA%8C"
click node_eval "https://github.com/datawhalechina/jev-cookbook/blob/main/main/06_%E6%A8%A1%E5%9E%8B%E8%AF%84%E6%B5%8B/llm_eval/llm_eval/runner.py"
click node_games "https://github.com/datawhalechina/jev-cookbook/tree/main/main/07_%E5%AE%9E%E6%88%98%E5%BA%94%E7%94%A8/app"
click node_jev_mem "https://github.com/datawhalechina/jev-cookbook/tree/main/main/08_%E5%89%8D%E6%B2%BF%E7%A0%94%E7%A9%B6"
click node_pi_agent "https://github.com/datawhalechina/jev-cookbook/blob/main/main/09_Agent%E9%9B%86%E6%88%90/pi_jev_demo/pi_jev_demo_extension.ts"
click node_dsh_agent "https://github.com/datawhalechina/jev-cookbook/tree/main/apps/dsh-jev-decision/src"
click node_local_data "https://github.com/datawhalechina/jev-cookbook/tree/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/data_generation"
click node_local_tuning "https://github.com/datawhalechina/jev-cookbook/blob/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/finetune_reviewed_jsonl.py"
click node_local_service "https://github.com/datawhalechina/jev-cookbook/blob/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/models/rl_agent_api.py"
click node_knowledge "https://github.com/datawhalechina/jev-cookbook/tree/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook"
click node_sdk_sync "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py"
click node_sdk_async "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py"
click node_sdk_transport "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py"
click node_sdk_types "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/response_types.py"
click node_sdk_config "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/config.py"
click node_sdk_json "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/json.py"
click node_sdk_retry "https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/retry.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_intro,node_foundations,node_patterns,node_recipes,node_knowledge toneBlue
class node_smart_home,node_games toneAmber
class node_eval,node_jev_mem,node_api toneMint
class node_pi_agent,node_dsh_agent,node_local_data,node_local_tuning,node_local_service toneRose
class node_sdk_sync,node_sdk_async,node_sdk_transport,node_sdk_types,node_sdk_config,node_sdk_json,node_sdk_retry,node_learner toneIndigo
```

## Components

### Core Learning

- [Introduction](https://github.com/datawhalechina/jev-cookbook/tree/main/main/01_%E8%AE%A4%E8%AF%86Jev): `main/01_认识Jev`
- [Core Concepts](https://github.com/datawhalechina/jev-cookbook/tree/main/main/02_%E6%A0%B8%E5%BF%83%E6%A6%82%E5%BF%B5): `main/02_核心概念`
- [Architecture Patterns](https://github.com/datawhalechina/jev-cookbook/tree/main/main/03_%E6%9E%B6%E6%9E%84%E6%A8%A1%E5%BC%8F): `main/03_架构模式`
- [Cookbook Recipes](https://github.com/datawhalechina/jev-cookbook/tree/main/main/04_%E5%AE%9E%E6%88%98%E6%8C%87%E5%8D%97): `main/04_实战指南`
- [Knowledge Collection](https://github.com/datawhalechina/jev-cookbook/tree/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook): `main/11_知识库/jev-cookbook`

### Applied Projects

- [Smart Home](https://github.com/datawhalechina/jev-cookbook/tree/main/main/05_%E6%99%BA%E8%83%BD%E5%AE%B6%E5%B1%85%E5%AE%9E%E9%AA%8C): `main/05_智能家居实验`
- [Games And Apps](https://github.com/datawhalechina/jev-cookbook/tree/main/main/07_%E5%AE%9E%E6%88%98%E5%BA%94%E7%94%A8/app): `main/07_实战应用/app`

### Research And Evaluation

- [Model Evaluation](https://github.com/datawhalechina/jev-cookbook/blob/main/main/06_%E6%A8%A1%E5%9E%8B%E8%AF%84%E6%B5%8B/llm_eval/llm_eval/runner.py): `main/06_模型评测/llm_eval/llm_eval/runner.py`
- [Jev-Mem Research](https://github.com/datawhalechina/jev-cookbook/tree/main/main/08_%E5%89%8D%E6%B2%BF%E7%A0%94%E7%A9%B6): `main/08_前沿研究`

### Agents And Models

- [Pi Integration](https://github.com/datawhalechina/jev-cookbook/blob/main/main/09_Agent%E9%9B%86%E6%88%90/pi_jev_demo/pi_jev_demo_extension.ts): `main/09_Agent集成/pi_jev_demo/pi_jev_demo_extension.ts`
- [DSH Integration](https://github.com/datawhalechina/jev-cookbook/tree/main/apps/dsh-jev-decision/src): `apps/dsh-jev-decision/src`
- [Local Data](https://github.com/datawhalechina/jev-cookbook/tree/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/data_generation): `main/10_本地模型/data_generation`
- [Local Fine-Tuning](https://github.com/datawhalechina/jev-cookbook/blob/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/finetune_reviewed_jsonl.py): `main/10_本地模型/finetune_reviewed_jsonl.py`
- [Local Model Service](https://github.com/datawhalechina/jev-cookbook/blob/main/main/10_%E6%9C%AC%E5%9C%B0%E6%A8%A1%E5%9E%8B/models/rl_agent_api.py): `main/10_本地模型/models/rl_agent_api.py`

### Python SDK

- [Sync Client](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py`
- [Async Client](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py`
- [HTTP Transport](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`
- [Typed Answers](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/response_types.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/response_types.py`
- [SDK Configuration](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/config.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/config.py`
- [JSON Codec](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/json.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/json.py`
- [Retry Policy](https://github.com/datawhalechina/jev-cookbook/blob/main/main/11_%E7%9F%A5%E8%AF%86%E5%BA%93/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/retry.py): `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/retry.py`

### Other components

- **Learner**
- **TypeSafe API**

## Connections

- Learner → Introduction: starts with (evidence: `README.md`)
- Introduction → Core Concepts: continues to (evidence: `README.md`)
- Core Concepts → Architecture Patterns: continues to (evidence: `README.md`)
- Architecture Patterns → Cookbook Recipes: applies concepts (evidence: `README.md`)
- Learner → Smart Home: explores (evidence: `README.md`)
- Learner → Model Evaluation: runs benchmarks (evidence: `README.md`)
- Learner → Games And Apps: explores projects (evidence: `README.md`)
- Learner → Pi Integration: studies integration (evidence: `README.md`)
- Learner → DSH Integration: studies integration (evidence: `README.md`)
- Learner → Local Data: builds dataset (evidence: `README.md`)
- Local Data → Local Fine-Tuning: feeds training (evidence: `README.md`)
- Local Fine-Tuning → Local Model Service: leads to serving (evidence: `README.md`)
- Learner → Knowledge Collection: consults reference (evidence: `README.md`)
- Sync Client → HTTP Transport: dispatches requests (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py`)
- Async Client → HTTP Transport: dispatches requests (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py`)
- Sync Client → SDK Configuration: resolves options (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/sync/client.py`)
- Async Client → SDK Configuration: resolves options (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/client/aio/client.py`)
- HTTP Transport → JSON Codec: encodes bodies (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`)
- HTTP Transport → Typed Answers: parses responses (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`)
- HTTP Transport → Retry Policy: applies retries (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`)
- HTTP Transport → TypeSafe API: sends HTTP (evidence: `main/11_知识库/jev-cookbook/09-typesafe-sdk-python/code/src/typesafe_sdk/_core/transport.py`)
