# microsoft/jarvis architecture

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

- Interactive diagram: https://gitdiagram.com/microsoft/jarvis
- Repository: https://github.com/microsoft/jarvis

## Overview

JARVIS is a research repository containing three related but distinct products: HuggingGPT orchestrates language-model planning and expert-model execution; EasyTool evaluates LLM-based tool use across several benchmarks; TaskBench generates and evaluates task-automation benchmark data. The principal HuggingGPT workflow runs from a user request through planning, model selection, execution, and response generation. README documents those stages and the web/server modes; sampled code confirms parts of dispatch, model calls, and TaskBench graph sampling. Some links are documented rather than visible in sampled implementation, so they cite the README.

Main entry points: [`hugginggpt/server/awesome_chat.py`](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py) (Web API), [`easytool/main.py`](https://github.com/microsoft/jarvis/blob/main/easytool/main.py) (Benchmark entry), [`easytool/easytool/util.py`](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/util.py) (Data utilities), [`hugginggpt/web/src/views/home.vue`](https://github.com/microsoft/jarvis/blob/main/hugginggpt/web/src/views/home.vue) (Web client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_hggpt["HuggingGPT"]
  node_web["Web client<br/>[home.vue]"]
  node_api["Web API<br/>[awesome_chat.py]"]
  node_planning["Task planning<br/>[awesome_chat.py]"]
  node_selection["Model selection<br/>[awesome_chat.py]"]
  node_execution["Expert execution<br/>[awesome_chat.py]"]
  node_response["Response generation<br/>[awesome_chat.py]"]
  node_localmodels["Local model server<br/>[models_server.py]"]
  node_gradio["Gradio demo<br/>[run_gradio_demo.py]"]
  node_cli["CLI mode<br/>[awesome_chat.py]"]
end

subgraph group_easytool["EasyTool"]
  node_funcqa["FuncQA runner<br/>[funcQA.py]"]
  node_toolbench["ToolBench runner<br/>[toolbench.py]"]
  node_retrieve["Tool retrieval"]
  node_restbench["RestBench runner<br/>[restbench.py]"]
  node_easyentry["Benchmark entry<br/>[main.py]"]
  node_easyutil["Data utilities<br/>[util.py]"]
  node_math["Math functions<br/>[math.py]"]
  node_dataproc["Data processing<br/>[data_process.py]"]
end

subgraph group_taskbench["TaskBench"]
  node_engine["Data engine<br/>[data_engine.py]"]
  node_sampler["Graph sampler<br/>[graph_sampler.py]"]
  node_graphgen["Graph generation<br/>[generate_graph.py]"]
  node_format["Data formatting<br/>[format_data.py]"]
  node_inference["Benchmark inference<br/>[inference.py]"]
  node_evaluation["Evaluation<br/>[evaluate.py]"]
  node_visualize["Graph visualization<br/>[visualize_graph.py]"]
end

node_user(("User"))
node_llm{{"ChatGPT service"}}
node_hf{{"Hugging Face models"}}

node_user -->|"submits request"| node_web
node_web -->|"sends request"| node_api
node_user -->|"submits request"| node_api
node_api -->|"starts planning"| node_planning
node_planning -->|"plans tasks"| node_llm
node_api -->|"selects models"| node_selection
node_selection -->|"chooses models"| node_llm
node_api -->|"dispatches tasks"| node_execution
node_execution -->|"invokes models"| node_hf
node_execution -.->|"uses local endpoints"| node_localmodels
node_api -->|"generates response"| node_response
node_response -->|"integrates results"| node_llm
node_api -->|"supports CLI"| node_cli
node_user -->|"uses demo"| node_gradio
node_easyentry -->|"dispatches task"| node_funcqa
node_easyentry -->|"dispatches task"| node_toolbench
node_easyentry -->|"dispatches task"| node_retrieve
node_easyentry -->|"dispatches task"| node_restbench
node_easyentry -->|"imports helpers"| node_easyutil
node_funcqa -->|"uses helpers"| node_easyutil
node_toolbench -->|"uses helpers"| node_easyutil
node_retrieve -->|"uses helpers"| node_easyutil
node_restbench -->|"uses helpers"| node_easyutil
node_engine -->|"samples subgraph"| node_sampler

click node_web "https://github.com/microsoft/jarvis/blob/main/hugginggpt/web/src/views/home.vue"
click node_api "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_planning "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_selection "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_execution "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_response "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_localmodels "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/models_server.py"
click node_gradio "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/run_gradio_demo.py"
click node_cli "https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py"
click node_funcqa "https://github.com/microsoft/jarvis/blob/main/easytool/easytool/funcQA.py"
click node_toolbench "https://github.com/microsoft/jarvis/blob/main/easytool/easytool/toolbench.py"
click node_retrieve "https://github.com/microsoft/jarvis/blob/main/easytool/easytool/toolbench_retrieve.py"
click node_restbench "https://github.com/microsoft/jarvis/blob/main/easytool/easytool/restbench.py"
click node_easyentry "https://github.com/microsoft/jarvis/blob/main/easytool/main.py"
click node_easyutil "https://github.com/microsoft/jarvis/blob/main/easytool/easytool/util.py"
click node_math "https://github.com/microsoft/jarvis/blob/main/easytool/data_funcqa/funchub/math.py"
click node_dataproc "https://github.com/microsoft/jarvis/blob/main/easytool/data_process.py"
click node_engine "https://github.com/microsoft/jarvis/blob/main/taskbench/data_engine.py"
click node_sampler "https://github.com/microsoft/jarvis/blob/main/taskbench/graph_sampler.py"
click node_graphgen "https://github.com/microsoft/jarvis/blob/main/taskbench/generate_graph.py"
click node_format "https://github.com/microsoft/jarvis/blob/main/taskbench/format_data.py"
click node_inference "https://github.com/microsoft/jarvis/blob/main/taskbench/inference.py"
click node_evaluation "https://github.com/microsoft/jarvis/blob/main/taskbench/evaluate.py"
click node_visualize "https://github.com/microsoft/jarvis/blob/main/taskbench/visualize_graph.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_web,node_api,node_planning,node_selection,node_execution,node_response,node_localmodels,node_gradio,node_cli,node_user toneBlue
class node_funcqa,node_toolbench,node_retrieve,node_restbench,node_easyentry,node_easyutil,node_math,node_dataproc toneAmber
class node_engine,node_sampler,node_graphgen,node_format,node_inference,node_evaluation,node_visualize toneMint
class node_llm,node_hf toneIndigo
```

## Components

### HuggingGPT

- [Web client](https://github.com/microsoft/jarvis/blob/main/hugginggpt/web/src/views/home.vue): `hugginggpt/web/src/views/home.vue`
- [Web API](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`
- [Task planning](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`
- [Model selection](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`
- [Expert execution](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`
- [Response generation](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`
- [Local model server](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/models_server.py): `hugginggpt/server/models_server.py`
- [Gradio demo](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/run_gradio_demo.py): `hugginggpt/server/run_gradio_demo.py`
- [CLI mode](https://github.com/microsoft/jarvis/blob/main/hugginggpt/server/awesome_chat.py): `hugginggpt/server/awesome_chat.py`

### EasyTool

- [FuncQA runner](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/funcQA.py): `easytool/easytool/funcQA.py`
- [ToolBench runner](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/toolbench.py): `easytool/easytool/toolbench.py`
- [Tool retrieval](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/toolbench_retrieve.py): `easytool/easytool/toolbench_retrieve.py`
- [RestBench runner](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/restbench.py): `easytool/easytool/restbench.py`
- [Benchmark entry](https://github.com/microsoft/jarvis/blob/main/easytool/main.py): `easytool/main.py`
- [Data utilities](https://github.com/microsoft/jarvis/blob/main/easytool/easytool/util.py): `easytool/easytool/util.py`
- [Math functions](https://github.com/microsoft/jarvis/blob/main/easytool/data_funcqa/funchub/math.py): `easytool/data_funcqa/funchub/math.py`
- [Data processing](https://github.com/microsoft/jarvis/blob/main/easytool/data_process.py): `easytool/data_process.py`

### TaskBench

- [Data engine](https://github.com/microsoft/jarvis/blob/main/taskbench/data_engine.py): `taskbench/data_engine.py`
- [Graph sampler](https://github.com/microsoft/jarvis/blob/main/taskbench/graph_sampler.py): `taskbench/graph_sampler.py`
- [Graph generation](https://github.com/microsoft/jarvis/blob/main/taskbench/generate_graph.py): `taskbench/generate_graph.py`
- [Data formatting](https://github.com/microsoft/jarvis/blob/main/taskbench/format_data.py): `taskbench/format_data.py`
- [Benchmark inference](https://github.com/microsoft/jarvis/blob/main/taskbench/inference.py): `taskbench/inference.py`
- [Evaluation](https://github.com/microsoft/jarvis/blob/main/taskbench/evaluate.py): `taskbench/evaluate.py`
- [Graph visualization](https://github.com/microsoft/jarvis/blob/main/taskbench/visualize_graph.py): `taskbench/visualize_graph.py`

### Other components

- **User**
- **ChatGPT service**
- **Hugging Face models**

## Connections

- User → Web client: submits request
- Web client → Web API: sends request
- User → Web API: submits request
- Web API → Task planning: starts planning (evidence: `hugginggpt/server/awesome_chat.py`)
- Task planning → ChatGPT service: plans tasks
- Web API → Model selection: selects models (evidence: `hugginggpt/server/awesome_chat.py`)
- Model selection → ChatGPT service: chooses models
- Web API → Expert execution: dispatches tasks (evidence: `hugginggpt/server/awesome_chat.py`)
- Expert execution → Hugging Face models: invokes models (evidence: `hugginggpt/server/awesome_chat.py`)
- Expert execution → Local model server: uses local endpoints
- Web API → Response generation: generates response (evidence: `hugginggpt/server/awesome_chat.py`)
- Response generation → ChatGPT service: integrates results
- Web API → CLI mode: supports CLI (evidence: `hugginggpt/server/awesome_chat.py`)
- User → Gradio demo: uses demo
- Benchmark entry → FuncQA runner: dispatches task (evidence: `easytool/main.py`)
- Benchmark entry → ToolBench runner: dispatches task (evidence: `easytool/main.py`)
- Benchmark entry → Tool retrieval: dispatches task (evidence: `easytool/main.py`)
- Benchmark entry → RestBench runner: dispatches task (evidence: `easytool/main.py`)
- Benchmark entry → Data utilities: imports helpers (evidence: `easytool/main.py`)
- FuncQA runner → Data utilities: uses helpers (evidence: `easytool/easytool/funcQA.py`)
- ToolBench runner → Data utilities: uses helpers (evidence: `easytool/easytool/toolbench.py`)
- Tool retrieval → Data utilities: uses helpers (evidence: `easytool/easytool/toolbench_retrieve.py`)
- RestBench runner → Data utilities: uses helpers (evidence: `easytool/easytool/restbench.py`)
- Data engine → Graph sampler: samples subgraph (evidence: `taskbench/data_engine.py`)
