# paddlepaddle/paddlex architecture

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

- Interactive diagram: https://gitdiagram.com/paddlepaddle/paddlex
- Repository: https://github.com/paddlepaddle/paddlex

## Overview

PaddleX is a low-code toolkit for developing and running AI model pipelines, with capabilities spanning model training, inference, and deployment. A representative document workflow accepts an image or document, preprocesses it, extracts text and structure, and produces parsed or task-specific results; other pipelines cover vision, speech, and time-series tasks. The sampled pipeline code confirms several subpipeline relationships, while deployment links and many model capabilities are documented or visible in the tree but their implementations were not sampled.

Main entry points: [`paddlex/inference/pipelines/layout_parsing/pipeline_v2.py`](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py) (Layout Parsing), [`paddlex/inference/pipelines/ocr/pipeline.py`](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/ocr/pipeline.py) (OCR Pipeline), [`paddlex/inference/pipelines/doc_preprocessor/pipeline.py`](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/doc_preprocessor/pipeline.py) (Document Preprocessor), [`paddlex/inference/pipelines/pp_doctranslation/pipeline.py`](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/pp_doctranslation/pipeline.py) (Document Translation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference Pipelines"]
  node_task_pipelines["Task Pipelines"]
  node_pipeline_options["Pipeline Arguments"]
end

subgraph group_document["Document AI"]
  node_doc_preprocessor["Document Preprocessor<br/>[pipeline.py]"]
  node_ocr["OCR Pipeline<br/>[pipeline.py]"]
  node_layout["Layout Parsing<br/>[pipeline_v2.py]"]
  node_table["Table Recognition<br/>[pipeline_v2.py]"]
  node_formula["Formula Recognition<br/>[pipeline.py]"]
  node_seal["Seal Recognition<br/>[pipeline.py]"]
  node_chatocr["ChatOCR Extraction<br/>[pipeline_v4.py]"]
  node_translation["Document Translation<br/>[pipeline.py]"]
  node_ocr_vl["OCR Vision-Language<br/>[pipeline.py]"]
end

subgraph group_runtime["Runtime and Training"]
  node_engine["Train and Predict Engine<br/>[engine.py]"]
  node_ultra_infer["High-performance Runtime<br/>[runtime.py]"]
end

subgraph group_deployment["Deployment"]
  node_hps_client["HPS Clients"]
  node_hps_models["HPS Model Services"]
  node_hps_server["HPS Server Support"]
end

node_developer(("Developer"))
node_document_input(("Document Input"))
node_external_llm(("LLM Service"))

node_developer -->|"configures and runs"| node_engine
node_engine -->|"predicts with"| node_task_pipelines
node_document_input -->|"submits document"| node_doc_preprocessor
node_document_input -->|"submits image"| node_ocr
node_ocr -->|"creates subpipeline"| node_doc_preprocessor
node_formula -->|"creates subpipeline"| node_doc_preprocessor
node_layout -->|"creates subpipeline"| node_seal
node_layout -->|"creates subpipeline"| node_table
node_layout -->|"uses text results"| node_ocr
node_translation -->|"creates parser"| node_layout
node_chatocr -.->|"uses chat service"| node_external_llm
node_translation -.->|"requests translation"| node_external_llm
node_developer -->|"sets options"| node_pipeline_options
node_developer -->|"calls deployed pipeline"| node_hps_client
node_hps_client -->|"sends requests"| node_hps_models
node_hps_server -->|"serves models"| node_hps_models
node_task_pipelines -.->|"uses inference runtime"| node_ultra_infer

click node_doc_preprocessor "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/doc_preprocessor/pipeline.py"
click node_ocr "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/ocr/pipeline.py"
click node_layout "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py"
click node_table "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/table_recognition/pipeline_v2.py"
click node_formula "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/formula_recognition/pipeline.py"
click node_seal "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/seal_recognition/pipeline.py"
click node_chatocr "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py"
click node_translation "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/pp_doctranslation/pipeline.py"
click node_ocr_vl "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/paddleocr_vl/pipeline.py"
click node_task_pipelines "https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines"
click node_pipeline_options "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/utils/pipeline_arguments.py"
click node_engine "https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/engine.py"
click node_ultra_infer "https://github.com/paddlepaddle/paddlex/blob/release/3.7/deploy/ultra-infer/python/ultra_infer/runtime.py"
click node_hps_client "https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines"
click node_hps_models "https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines"
click node_hps_server "https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/server_env/paddlex-hps-server/src/paddlex_hps_server"

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_task_pipelines,node_pipeline_options toneBlue
class node_doc_preprocessor,node_ocr,node_layout,node_table,node_formula,node_seal,node_chatocr,node_translation,node_ocr_vl toneAmber
class node_engine,node_ultra_infer toneMint
class node_hps_client,node_hps_models,node_hps_server toneRose
class node_developer,node_document_input,node_external_llm toneIndigo
```

## Components

### Inference Pipelines

- [Task Pipelines](https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines): `deploy/hps/sdk/pipelines`
- [Pipeline Arguments](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/utils/pipeline_arguments.py): `paddlex/utils/pipeline_arguments.py`

### Document AI

- [Document Preprocessor](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/doc_preprocessor/pipeline.py): `paddlex/inference/pipelines/doc_preprocessor/pipeline.py`
- [OCR Pipeline](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/ocr/pipeline.py): `paddlex/inference/pipelines/ocr/pipeline.py`
- [Layout Parsing](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/layout_parsing/pipeline_v2.py): `paddlex/inference/pipelines/layout_parsing/pipeline_v2.py`
- [Table Recognition](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/table_recognition/pipeline_v2.py): `paddlex/inference/pipelines/table_recognition/pipeline_v2.py`
- [Formula Recognition](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/formula_recognition/pipeline.py): `paddlex/inference/pipelines/formula_recognition/pipeline.py`
- [Seal Recognition](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/seal_recognition/pipeline.py): `paddlex/inference/pipelines/seal_recognition/pipeline.py`
- [ChatOCR Extraction](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py): `paddlex/inference/pipelines/pp_chatocr/pipeline_v4.py`
- [Document Translation](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/pp_doctranslation/pipeline.py): `paddlex/inference/pipelines/pp_doctranslation/pipeline.py`
- [OCR Vision-Language](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/inference/pipelines/paddleocr_vl/pipeline.py): `paddlex/inference/pipelines/paddleocr_vl/pipeline.py`

### Runtime and Training

- [Train and Predict Engine](https://github.com/paddlepaddle/paddlex/blob/release/3.7/paddlex/engine.py): `paddlex/engine.py`
- [High-performance Runtime](https://github.com/paddlepaddle/paddlex/blob/release/3.7/deploy/ultra-infer/python/ultra_infer/runtime.py): `deploy/ultra-infer/python/ultra_infer/runtime.py`

### Deployment

- [HPS Clients](https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines): `deploy/hps/sdk/pipelines`
- [HPS Model Services](https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/sdk/pipelines): `deploy/hps/sdk/pipelines`
- [HPS Server Support](https://github.com/paddlepaddle/paddlex/tree/release/3.7/deploy/hps/server_env/paddlex-hps-server/src/paddlex_hps_server): `deploy/hps/server_env/paddlex-hps-server/src/paddlex_hps_server`

### Other components

- **Developer**
- **Document Input**
- **LLM Service**

## Connections

- Developer → Train and Predict Engine: configures and runs
- Train and Predict Engine → Task Pipelines: predicts with
- Document Input → Document Preprocessor: submits document
- Document Input → OCR Pipeline: submits image
- OCR Pipeline → Document Preprocessor: creates subpipeline
- Formula Recognition → Document Preprocessor: creates subpipeline
- Layout Parsing → Seal Recognition: creates subpipeline
- Layout Parsing → Table Recognition: creates subpipeline
- Layout Parsing → OCR Pipeline: uses text results
- Document Translation → Layout Parsing: creates parser
- ChatOCR Extraction → LLM Service: uses chat service
- Document Translation → LLM Service: requests translation
- Developer → Pipeline Arguments: sets options
- Developer → HPS Clients: calls deployed pipeline
- HPS Clients → HPS Model Services: sends requests
- HPS Server Support → HPS Model Services: serves models
- Task Pipelines → High-performance Runtime: uses inference runtime
