# priyankshu-07/vox architecture

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

- Interactive diagram: https://gitdiagram.com/priyankshu-07/vox
- Repository: https://github.com/priyankshu-07/vox

## Overview

VOX is an offline Hinglish delivery-command NLU product. Its primary workflow is partner text input in the frontend, local HTTP prediction through FastAPI, intent classification plus deterministic slot extraction, and a contextual response displayed with confidence and slots. The repository also contains a training/evaluation pipeline for the Bi-GRU model and its tokenizer. README documents a benchmark endpoint and voice-oriented use; the sampled UI only simulates voice input, and route details beyond the sampled endpoints are not verified.

Main entry points: [`backend/services/inference_service.py`](https://github.com/priyankshu-07/vox/blob/main/backend/services/inference_service.py) (Inference engine), [`backend/api/routes.py`](https://github.com/priyankshu-07/vox/blob/main/backend/api/routes.py) (Prediction API), [`ml_pipeline/dataset.py`](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/dataset.py) (Intent dataset), [`ml_pipeline/train.py`](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/train.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Partner interface"]
  node_dashboard["Command dashboard<br/>[App.tsx]"]
end

subgraph group_backend["Inference API"]
  node_api["Prediction API<br/>[routes.py]"]
  node_schema["Prediction schema<br/>[predict.py]"]
  node_engine["Inference engine"]
  node_slots["Slot extraction<br/>[slot_extractor.py]"]
  node_responses["Response generation"]
  node_main["FastAPI app<br/>[main.py]"]
end

subgraph group_ml["Model pipeline"]
  node_generator["Synthetic data<br/>[data_generator.py]"]
  node_dataset["Intent dataset<br/>[dataset.py]"]
  node_tokenizer["Word tokenizer<br/>[tokenizer.py]"]
  node_model["Bi-GRU classifier<br/>[model.py]"]
  node_training["Model training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[evaluate.py]"]
  node_localinfer["Pipeline inference<br/>[inference.py]"]
  node_artifacts[("Model artifacts")]
end

subgraph group_ops["API support"]
  node_exceptions["Exception handlers<br/>[exceptions.py]"]
  node_logger["Structured logging<br/>[logger.py]"]
end

node_partner(("Delivery partner"))
node_backendservice(("Backend service"))

node_partner -->|"enters command"| node_dashboard
node_dashboard -->|"posts text"| node_api
node_api -->|"validates and shapes"| node_schema
node_api -->|"invokes prediction"| node_engine
node_engine -->|"extracts slots"| node_slots
node_engine -->|"generates response"| node_responses
node_main -->|"mounts routes"| node_api
node_main -->|"registers handlers"| node_exceptions
node_main -->|"logs requests"| node_logger
node_engine -->|"logs inference"| node_logger
node_engine -->|"raises failures"| node_exceptions
node_engine -->|"loads ONNX and vocabulary"| node_artifacts
node_api -->|"returns prediction"| node_dashboard
node_generator -.->|"supplies training corpus"| node_dataset
node_dataset -->|"encodes examples"| node_tokenizer
node_training -->|"uses training data"| node_dataset
node_training -->|"uses vocabulary"| node_tokenizer
node_training -->|"trains classifier"| node_model
node_evaluation -->|"loads examples"| node_dataset
node_evaluation -->|"uses vocabulary"| node_tokenizer
node_evaluation -->|"evaluates classifier"| node_model
node_localinfer -->|"encodes input"| node_tokenizer
node_localinfer -->|"runs inference"| node_model
node_localinfer -->|"uses intent map"| node_dataset
node_training -.->|"exports model artifacts"| node_artifacts
node_backendservice -.->|"sends local HTTP requests"| node_api

click node_dashboard "https://github.com/priyankshu-07/vox/blob/main/frontend/src/App.tsx"
click node_api "https://github.com/priyankshu-07/vox/blob/main/backend/api/routes.py"
click node_schema "https://github.com/priyankshu-07/vox/blob/main/backend/schemas/predict.py"
click node_engine "https://github.com/priyankshu-07/vox/blob/main/backend/services/inference_service.py"
click node_slots "https://github.com/priyankshu-07/vox/blob/main/backend/services/slot_extractor.py"
click node_responses "https://github.com/priyankshu-07/vox/blob/main/backend/services/response_generator.py"
click node_main "https://github.com/priyankshu-07/vox/blob/main/backend/main.py"
click node_exceptions "https://github.com/priyankshu-07/vox/blob/main/backend/core/exceptions.py"
click node_logger "https://github.com/priyankshu-07/vox/blob/main/backend/core/logger.py"
click node_generator "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/data_generator.py"
click node_dataset "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/dataset.py"
click node_tokenizer "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/tokenizer.py"
click node_model "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/model.py"
click node_training "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/train.py"
click node_evaluation "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/evaluate.py"
click node_localinfer "https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/inference.py"
click node_artifacts "https://github.com/priyankshu-07/vox/tree/main/model"

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_dashboard toneBlue
class node_api,node_schema,node_engine,node_slots,node_responses,node_main toneAmber
class node_generator,node_dataset,node_tokenizer,node_model,node_training,node_evaluation,node_localinfer,node_artifacts toneMint
class node_exceptions,node_logger toneRose
class node_partner,node_backendservice toneIndigo
```

## Components

### Partner interface

- [Command dashboard](https://github.com/priyankshu-07/vox/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`

### Inference API

- [Prediction API](https://github.com/priyankshu-07/vox/blob/main/backend/api/routes.py): `backend/api/routes.py`
- [Prediction schema](https://github.com/priyankshu-07/vox/blob/main/backend/schemas/predict.py): `backend/schemas/predict.py`
- [Inference engine](https://github.com/priyankshu-07/vox/blob/main/backend/services/inference_service.py): `backend/services/inference_service.py`
- [Slot extraction](https://github.com/priyankshu-07/vox/blob/main/backend/services/slot_extractor.py): `backend/services/slot_extractor.py`
- [Response generation](https://github.com/priyankshu-07/vox/blob/main/backend/services/response_generator.py): `backend/services/response_generator.py`
- [FastAPI app](https://github.com/priyankshu-07/vox/blob/main/backend/main.py): `backend/main.py`

### Model pipeline

- [Synthetic data](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/data_generator.py): `ml_pipeline/data_generator.py`
- [Intent dataset](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/dataset.py): `ml_pipeline/dataset.py`
- [Word tokenizer](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/tokenizer.py): `ml_pipeline/tokenizer.py`
- [Bi-GRU classifier](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/model.py): `ml_pipeline/model.py`
- [Model training](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/train.py): `ml_pipeline/train.py`
- [Model evaluation](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/evaluate.py): `ml_pipeline/evaluate.py`
- [Pipeline inference](https://github.com/priyankshu-07/vox/blob/main/ml_pipeline/inference.py): `ml_pipeline/inference.py`
- [Model artifacts](https://github.com/priyankshu-07/vox/tree/main/model): `model`

### API support

- [Exception handlers](https://github.com/priyankshu-07/vox/blob/main/backend/core/exceptions.py): `backend/core/exceptions.py`
- [Structured logging](https://github.com/priyankshu-07/vox/blob/main/backend/core/logger.py): `backend/core/logger.py`

### Other components

- **Delivery partner**
- **Backend service**

## Connections

- Delivery partner → Command dashboard: enters command (evidence: `README.md`)
- Command dashboard → Prediction API: posts text (evidence: `frontend/src/App.tsx`)
- Prediction API → Prediction schema: validates and shapes (evidence: `backend/api/routes.py`)
- Prediction API → Inference engine: invokes prediction (evidence: `backend/api/routes.py`)
- Inference engine → Slot extraction: extracts slots (evidence: `backend/services/inference_service.py`)
- Inference engine → Response generation: generates response (evidence: `backend/services/inference_service.py`)
- FastAPI app → Prediction API: mounts routes (evidence: `backend/main.py`)
- FastAPI app → Exception handlers: registers handlers (evidence: `backend/main.py`)
- FastAPI app → Structured logging: logs requests (evidence: `backend/main.py`)
- Inference engine → Structured logging: logs inference (evidence: `backend/services/inference_service.py`)
- Inference engine → Exception handlers: raises failures (evidence: `backend/services/inference_service.py`)
- Inference engine → Model artifacts: loads ONNX and vocabulary (evidence: `backend/services/inference_service.py`)
- Prediction API → Command dashboard: returns prediction (evidence: `README.md`)
- Synthetic data → Intent dataset: supplies training corpus
- Intent dataset → Word tokenizer: encodes examples (evidence: `ml_pipeline/dataset.py`)
- Model training → Intent dataset: uses training data (evidence: `ml_pipeline/train.py`)
- Model training → Word tokenizer: uses vocabulary (evidence: `ml_pipeline/train.py`)
- Model training → Bi-GRU classifier: trains classifier (evidence: `ml_pipeline/train.py`)
- Model evaluation → Intent dataset: loads examples (evidence: `ml_pipeline/evaluate.py`)
- Model evaluation → Word tokenizer: uses vocabulary (evidence: `ml_pipeline/evaluate.py`)
- Model evaluation → Bi-GRU classifier: evaluates classifier (evidence: `ml_pipeline/evaluate.py`)
- Pipeline inference → Word tokenizer: encodes input (evidence: `ml_pipeline/inference.py`)
- Pipeline inference → Bi-GRU classifier: runs inference (evidence: `ml_pipeline/inference.py`)
- Pipeline inference → Intent dataset: uses intent map (evidence: `ml_pipeline/inference.py`)
- Model training → Model artifacts: exports model artifacts
- Backend service → Prediction API: sends local HTTP requests
