# ghazalkhalighinejad/multimodalqa architecture

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

- Interactive diagram: https://gitdiagram.com/ghazalkhalighinejad/multimodalqa
- Repository: https://github.com/ghazalkhalighinejad/multimodalqa

## Overview

ChemQA is presented as a chemistry multiple-choice benchmark dataset with scripts for evaluating LLMs. The principal workflow in the sampled runner loads and filters a dataset, builds image-question prompts, dispatches model calls, checks answers against labels, and writes per-model results and accuracy. Provider adapters cover several text and vision models; local Llama adapters exist but are not wired into this runner in the shown code. The README describes a ChemQA dataset on Hugging Face, while eval.py loads SciBench; unsampled details are not inferred.

Main entry points: [`eval.py`](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/eval.py) (Evaluation runner), [`api/gpt4.py`](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gpt4.py) (GPT adapter), [`api/gemini.py`](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gemini.py) (Gemini adapter), [`api/claude3.py`](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/claude3.py) (Claude adapter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runner["Evaluation runner"]
  node_eval["Evaluation runner<br/>[eval.py]"]
end

subgraph group_providers["Model adapters"]
  node_gpt["GPT adapter<br/>[gpt4.py]"]
  node_gemini["Gemini adapter<br/>[gemini.py]"]
  node_claude["Claude adapter<br/>[claude3.py]"]
  node_together["Together adapter<br/>[together_api.py]"]
  node_llava["LLaVA adapter<br/>[llava.py]"]
  node_llama7["Llama 7B adapter<br/>[llama2_7b.py]"]
  node_llama13["Llama 13B adapter<br/>[llama2_13b.py]"]
  node_llama70["Llama 70B adapter<br/>[llama2_70b.py]"]
end

subgraph group_artifacts["Benchmark artifacts"]
  node_results["Per-model results"]
  node_accuracy["Accuracy reports"]
end

node_user(("Benchmark user"))
node_dataset[("SciBench validation set")]
node_hf[("Hugging Face")]

node_user -->|"runs evaluation"| node_eval
node_eval -->|"loads and filters"| node_dataset
node_hf -->|"hosts dataset"| node_dataset
node_eval -->|"dispatches calls"| node_gpt
node_eval -->|"dispatches calls"| node_gemini
node_eval -->|"dispatches calls"| node_claude
node_eval -->|"dispatches calls"| node_together
node_eval -->|"dispatches calls"| node_llava
node_eval -->|"writes responses"| node_results
node_eval -->|"writes score"| node_accuracy

click node_eval "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/eval.py"
click node_gpt "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gpt4.py"
click node_gemini "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gemini.py"
click node_claude "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/claude3.py"
click node_together "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/together_api.py"
click node_llava "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llava.py"
click node_llama7 "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_7b.py"
click node_llama13 "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_13b.py"
click node_llama70 "https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_70b.py"
click node_results "https://github.com/ghazalkhalighinejad/multimodalqa/tree/main/chemistry_benchmark"
click node_accuracy "https://github.com/ghazalkhalighinejad/multimodalqa/tree/main/chemistry_benchmark"

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_eval,node_user toneBlue
class node_gpt,node_gemini,node_claude,node_together,node_llava,node_llama7,node_llama13,node_llama70,node_dataset,node_hf toneAmber
class node_results,node_accuracy toneMint
```

## Components

### Evaluation runner

- [Evaluation runner](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/eval.py): `eval.py`

### Model adapters

- [GPT adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gpt4.py): `api/gpt4.py`
- [Gemini adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/gemini.py): `api/gemini.py`
- [Claude adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/claude3.py): `api/claude3.py`
- [Together adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/together_api.py): `api/together_api.py`
- [LLaVA adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llava.py): `api/llava.py`
- [Llama 7B adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_7b.py): `api/llama2_7b.py`
- [Llama 13B adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_13b.py): `api/llama2_13b.py`
- [Llama 70B adapter](https://github.com/ghazalkhalighinejad/multimodalqa/blob/main/api/llama2_70b.py): `api/llama2_70b.py`

### Benchmark artifacts

- [Per-model results](https://github.com/ghazalkhalighinejad/multimodalqa/tree/main/chemistry_benchmark): `chemistry_benchmark`
- [Accuracy reports](https://github.com/ghazalkhalighinejad/multimodalqa/tree/main/chemistry_benchmark): `chemistry_benchmark`

### Other components

- **Benchmark user**
- **SciBench validation set**
- **Hugging Face**

## Connections

- Benchmark user → Evaluation runner: runs evaluation (evidence: `eval.py`)
- Evaluation runner → SciBench validation set: loads and filters (evidence: `eval.py`)
- Hugging Face → SciBench validation set: hosts dataset (evidence: `README.md`)
- Evaluation runner → GPT adapter: dispatches calls (evidence: `eval.py`)
- Evaluation runner → Gemini adapter: dispatches calls (evidence: `eval.py`)
- Evaluation runner → Claude adapter: dispatches calls (evidence: `eval.py`)
- Evaluation runner → Together adapter: dispatches calls (evidence: `eval.py`)
- Evaluation runner → LLaVA adapter: dispatches calls (evidence: `eval.py`)
- Evaluation runner → Per-model results: writes responses (evidence: `eval.py`)
- Evaluation runner → Accuracy reports: writes score (evidence: `eval.py`)
