# zai-org/glm-v architecture

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

- Interactive diagram: https://gitdiagram.com/zai-org/glm-v
- Repository: https://github.com/zai-org/glm-v

## Overview

GLM-V is a vision-language model project whose model algorithms are implemented in external Transformers code; this tree chiefly contains inference interfaces, a reward system, and specialized skills. A user-facing workflow is to submit a multimodal request through an inference interface or skill and receive a generated result. The reward subsystem evaluates model answers against ground truth through task-specific verifiers, with optional LLM judging. The README documents grounding and GUI-agent capabilities. Some skill and inference relationships are unclear from the sampled sources, so those connections are omitted.

Main entry points: [`glmv_reward/src/glmv_reward/reward_system.py`](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/reward_system.py) (Reward orchestration), [`skills/glmv-grounding/scripts/glm_grounding_cli.py`](https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/glm_grounding_cli.py) (Grounding workflow), [`glmv_reward/src/glmv_reward/verifiers/__init__.py`](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/verifiers/__init__.py) (Verifier registry), [`glmv_reward/src/glmv_reward/verifiers`](https://github.com/zai-org/glm-v/tree/main/glmv_reward/src/glmv_reward/verifiers) (Domain verifiers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inference["Inference interfaces"]
  node_cli_infer["Inference CLI<br/>[trans_infer_cli.py]"]
  node_gradio_infer["Inference UI"]
  node_bench["Inference benchmark"]
  node_html_detect["HTML detector<br/>[html_detector.py]"]
end

subgraph group_reward["Reward evaluation"]
  node_reward_system["Reward orchestration<br/>[reward_system.py]"]
  node_reward_config["Reward configuration<br/>[reward_system.py]"]
  node_verifier_configs["Verifier configs"]
  node_verifier_registry["Verifier registry<br/>[__init__.py]"]
  node_base_verifier["Verifier base<br/>[_base_verifier.py]"]
  node_domain_verifiers["Domain verifiers"]
  node_text_utils["Text utilities<br/>[text.py]"]
  node_llm_judge["LLM judge client<br/>[llm.py]"]
end

subgraph group_vision["Vision skills"]
  node_grounding_cli["Grounding workflow"]
  node_box_utils["Box utilities<br/>[utils_boxes.py]"]
  node_detection_utils["Detection utilities<br/>[utils_detection.py]"]
  node_video_utils["Video utilities<br/>[utils_video.py]"]
  node_caption["Image captioning<br/>[glmv_caption.py]"]
  node_gui_android["Android GUI agent<br/>[AndroidWorld.py]"]
  node_gui_os["OS GUI agent<br/>[OSWorld.py]"]
  node_gui_web["Web GUI agent<br/>[WebVoyager.py]"]
end

subgraph group_workflows["Task skills"]
  node_doc_writing["Document writing"]
  node_pdf_ppt["PDF to slides<br/>[generate_slide.py]"]
  node_pdf_web["PDF to web<br/>[generate_web.py]"]
  node_prd_app["PRD to app<br/>[render_page.py]"]
  node_prompt_gen["Prompt generation<br/>[prompt_gen.py]"]
  node_resume_screen["Resume screening<br/>[resume_screen.py]"]
  node_stock_fetch["Stock analysis<br/>[fetch_all.py]"]
  node_stock_chart["Text charts<br/>[text_chart.py]"]
end

node_user(("User"))
node_vlm_service{{"GLM-V service"}}

node_user -->|"submits request"| node_cli_infer
node_user -->|"submits request"| node_gradio_infer
node_cli_infer -.->|"requests inference"| node_vlm_service
node_gradio_infer -.->|"requests inference"| node_vlm_service
node_bench -.->|"benchmarks inference"| node_vlm_service
node_user -->|"requests grounding"| node_grounding_cli
node_user -->|"runs GUI task"| node_gui_android
node_user -->|"runs GUI task"| node_gui_os
node_user -->|"runs GUI task"| node_gui_web
node_grounding_cli -->|"uses"| node_box_utils
node_grounding_cli -->|"uses"| node_detection_utils
node_grounding_cli -->|"uses"| node_video_utils
node_stock_fetch -->|"uses"| node_stock_chart
node_user -.->|"requests scoring"| node_reward_system
node_reward_system -->|"loads config"| node_reward_config
node_reward_system -->|"resolves settings"| node_verifier_configs
node_reward_system -->|"gets verifier"| node_verifier_registry
node_verifier_registry -->|"uses base"| node_base_verifier
node_verifier_registry -->|"registers"| node_domain_verifiers
node_domain_verifiers -->|"extracts answers"| node_text_utils
node_domain_verifiers -->|"requests fallback"| node_llm_judge
node_reward_config -->|"types configs"| node_verifier_configs

click node_cli_infer "https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_cli.py"
click node_gradio_infer "https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_gradio.py"
click node_bench "https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_bench.py"
click node_html_detect "https://github.com/zai-org/glm-v/blob/main/inference/html_detector.py"
click node_reward_system "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/reward_system.py"
click node_reward_config "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/configs/reward_system.py"
click node_verifier_configs "https://github.com/zai-org/glm-v/tree/main/glmv_reward/src/glmv_reward/configs/verifiers"
click node_verifier_registry "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/verifiers/__init__.py"
click node_base_verifier "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/verifiers/_base_verifier.py"
click node_domain_verifiers "https://github.com/zai-org/glm-v/tree/main/glmv_reward/src/glmv_reward/verifiers"
click node_text_utils "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/utils/text.py"
click node_llm_judge "https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/utils/llm.py"
click node_grounding_cli "https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/glm_grounding_cli.py"
click node_box_utils "https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_boxes.py"
click node_detection_utils "https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_detection.py"
click node_video_utils "https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_video.py"
click node_caption "https://github.com/zai-org/glm-v/blob/main/skills/glmv-caption/scripts/glmv_caption.py"
click node_gui_android "https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/AndroidWorld.py"
click node_gui_os "https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/OSWorld.py"
click node_gui_web "https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/WebVoyager.py"
click node_doc_writing "https://github.com/zai-org/glm-v/blob/main/skills/glmv-doc-based-writing/scripts/doc_based_writing.py"
click node_pdf_ppt "https://github.com/zai-org/glm-v/blob/main/skills/glmv-pdf-to-ppt/scripts/generate_slide.py"
click node_pdf_web "https://github.com/zai-org/glm-v/blob/main/skills/glmv-pdf-to-web/scripts/generate_web.py"
click node_prd_app "https://github.com/zai-org/glm-v/blob/main/skills/glmv-prd-to-app/scripts/render_page.py"
click node_prompt_gen "https://github.com/zai-org/glm-v/blob/main/skills/glmv-prompt-gen/scripts/prompt_gen.py"
click node_resume_screen "https://github.com/zai-org/glm-v/blob/main/skills/glmv-resume-screen/scripts/resume_screen.py"
click node_stock_fetch "https://github.com/zai-org/glm-v/blob/main/skills/glmv-stock-analyst/scripts/fetch_all.py"
click node_stock_chart "https://github.com/zai-org/glm-v/blob/main/skills/glmv-stock-analyst/scripts/text_chart.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_cli_infer,node_gradio_infer,node_bench,node_html_detect,node_user toneBlue
class node_reward_system,node_reward_config,node_verifier_configs,node_verifier_registry,node_base_verifier,node_domain_verifiers,node_text_utils,node_llm_judge toneAmber
class node_grounding_cli,node_box_utils,node_detection_utils,node_video_utils,node_caption,node_gui_android,node_gui_os,node_gui_web toneMint
class node_doc_writing,node_pdf_ppt,node_pdf_web,node_prd_app,node_prompt_gen,node_resume_screen,node_stock_fetch,node_stock_chart toneRose
class node_vlm_service toneIndigo
```

## Components

### Inference interfaces

- [Inference CLI](https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_cli.py): `inference/trans_infer_cli.py`
- [Inference UI](https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_gradio.py): `inference/trans_infer_gradio.py`
- [Inference benchmark](https://github.com/zai-org/glm-v/blob/main/inference/trans_infer_bench.py): `inference/trans_infer_bench.py`
- [HTML detector](https://github.com/zai-org/glm-v/blob/main/inference/html_detector.py): `inference/html_detector.py`

### Reward evaluation

- [Reward orchestration](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/reward_system.py): `glmv_reward/src/glmv_reward/reward_system.py`
- [Reward configuration](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/configs/reward_system.py): `glmv_reward/src/glmv_reward/configs/reward_system.py`
- [Verifier configs](https://github.com/zai-org/glm-v/tree/main/glmv_reward/src/glmv_reward/configs/verifiers): `glmv_reward/src/glmv_reward/configs/verifiers`
- [Verifier registry](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/verifiers/__init__.py): `glmv_reward/src/glmv_reward/verifiers/__init__.py`
- [Verifier base](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/verifiers/_base_verifier.py): `glmv_reward/src/glmv_reward/verifiers/_base_verifier.py`
- [Domain verifiers](https://github.com/zai-org/glm-v/tree/main/glmv_reward/src/glmv_reward/verifiers): `glmv_reward/src/glmv_reward/verifiers`
- [Text utilities](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/utils/text.py): `glmv_reward/src/glmv_reward/utils/text.py`
- [LLM judge client](https://github.com/zai-org/glm-v/blob/main/glmv_reward/src/glmv_reward/utils/llm.py): `glmv_reward/src/glmv_reward/utils/llm.py`

### Vision skills

- [Grounding workflow](https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/glm_grounding_cli.py): `skills/glmv-grounding/scripts/glm_grounding_cli.py`
- [Box utilities](https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_boxes.py): `skills/glmv-grounding/scripts/utils_boxes.py`
- [Detection utilities](https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_detection.py): `skills/glmv-grounding/scripts/utils_detection.py`
- [Video utilities](https://github.com/zai-org/glm-v/blob/main/skills/glmv-grounding/scripts/utils_video.py): `skills/glmv-grounding/scripts/utils_video.py`
- [Image captioning](https://github.com/zai-org/glm-v/blob/main/skills/glmv-caption/scripts/glmv_caption.py): `skills/glmv-caption/scripts/glmv_caption.py`
- [Android GUI agent](https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/AndroidWorld.py): `glmv_reward/scripts/gui_agent/AndroidWorld.py`
- [OS GUI agent](https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/OSWorld.py): `glmv_reward/scripts/gui_agent/OSWorld.py`
- [Web GUI agent](https://github.com/zai-org/glm-v/blob/main/glmv_reward/scripts/gui_agent/WebVoyager.py): `glmv_reward/scripts/gui_agent/WebVoyager.py`

### Task skills

- [Document writing](https://github.com/zai-org/glm-v/blob/main/skills/glmv-doc-based-writing/scripts/doc_based_writing.py): `skills/glmv-doc-based-writing/scripts/doc_based_writing.py`
- [PDF to slides](https://github.com/zai-org/glm-v/blob/main/skills/glmv-pdf-to-ppt/scripts/generate_slide.py): `skills/glmv-pdf-to-ppt/scripts/generate_slide.py`
- [PDF to web](https://github.com/zai-org/glm-v/blob/main/skills/glmv-pdf-to-web/scripts/generate_web.py): `skills/glmv-pdf-to-web/scripts/generate_web.py`
- [PRD to app](https://github.com/zai-org/glm-v/blob/main/skills/glmv-prd-to-app/scripts/render_page.py): `skills/glmv-prd-to-app/scripts/render_page.py`
- [Prompt generation](https://github.com/zai-org/glm-v/blob/main/skills/glmv-prompt-gen/scripts/prompt_gen.py): `skills/glmv-prompt-gen/scripts/prompt_gen.py`
- [Resume screening](https://github.com/zai-org/glm-v/blob/main/skills/glmv-resume-screen/scripts/resume_screen.py): `skills/glmv-resume-screen/scripts/resume_screen.py`
- [Stock analysis](https://github.com/zai-org/glm-v/blob/main/skills/glmv-stock-analyst/scripts/fetch_all.py): `skills/glmv-stock-analyst/scripts/fetch_all.py`
- [Text charts](https://github.com/zai-org/glm-v/blob/main/skills/glmv-stock-analyst/scripts/text_chart.py): `skills/glmv-stock-analyst/scripts/text_chart.py`

### Other components

- **User**
- **GLM-V service**

## Connections

- User → Inference CLI: submits request
- User → Inference UI: submits request
- Inference CLI → GLM-V service: requests inference
- Inference UI → GLM-V service: requests inference
- Inference benchmark → GLM-V service: benchmarks inference
- User → Grounding workflow: requests grounding
- User → Android GUI agent: runs GUI task
- User → OS GUI agent: runs GUI task
- User → Web GUI agent: runs GUI task
- Grounding workflow → Box utilities: uses (evidence: `skills/glmv-grounding/scripts/glm_grounding_cli.py`)
- Grounding workflow → Detection utilities: uses (evidence: `skills/glmv-grounding/scripts/glm_grounding_cli.py`)
- Grounding workflow → Video utilities: uses (evidence: `skills/glmv-grounding/scripts/glm_grounding_cli.py`)
- Stock analysis → Text charts: uses (evidence: `skills/glmv-stock-analyst/scripts/fetch_all.py`)
- User → Reward orchestration: requests scoring
- Reward orchestration → Reward configuration: loads config (evidence: `glmv_reward/src/glmv_reward/reward_system.py`)
- Reward orchestration → Verifier configs: resolves settings (evidence: `glmv_reward/src/glmv_reward/reward_system.py`)
- Reward orchestration → Verifier registry: gets verifier (evidence: `glmv_reward/src/glmv_reward/reward_system.py`)
- Verifier registry → Verifier base: uses base (evidence: `glmv_reward/src/glmv_reward/verifiers/__init__.py`)
- Verifier registry → Domain verifiers: registers (evidence: `glmv_reward/src/glmv_reward/verifiers/__init__.py`)
- Domain verifiers → Text utilities: extracts answers (evidence: `glmv_reward/src/glmv_reward/verifiers/chart_verifier.py`)
- Domain verifiers → LLM judge client: requests fallback (evidence: `glmv_reward/src/glmv_reward/verifiers/math_verifier.py`)
- Reward configuration → Verifier configs: types configs (evidence: `glmv_reward/src/glmv_reward/configs/reward_system.py`)
