# tuttlebr/genai-perf-k6 architecture

> Architecture diagram of the GitHub repository tuttlebr/genai-perf-k6, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tuttlebr/genai-perf-k6
- Repository: https://github.com/tuttlebr/genai-perf-k6

## Overview

##### Project Purpose and Type
- The system is not a traditional full-stack web application but instead a specialized service for LLM inference deployed in a cloud-native/Kubernetes environment.
- Its primary goals include deploying an LLM service (using NVIDIA’s model containers), configuring resource constraints (especially for GPU-enabled nodes), and carrying out performance and load testing using Triton Inference Server SDK and Grafana K6.
- The environment variables outline the parameters for request payloads, token statistics, and performance metrics, while the README includes detailed Kubernetes/Helm instructions for deployment and performance test scripts.

##### Analysis of the File Structure
- Top-level directories and files such as .gitignore, .pre-commit-config.yaml, and README.md are standard; however, the key directories/files are:
- The “app” folder with the script.js, which is the k6 load testing script.
- docker-compose.yaml, which is used to run the performance tests (both the “triton-genai-perf” and “k6” tasks).
- The “nginx/templates” directory containing the default configuration template for Nginx, indicating that a reverse proxy or ingress controller is involved.
- The presence of a shell script (triton-genai-perf.sh) hints at performance testing automation with Triton’s inference benchmarks.

## Diagram (Mermaid)

```mermaid
graph TD
    A("Deployment & Configuration"):::config
    subgraph "Kubernetes Cluster"
        C("Nginx Ingress"):::ingress
        B("LLM Inference Service"):::service
    end
    subgraph "Performance Testing"
        G("Docker Compose"):::compose
        D("Triton GenAI-Perf"):::perf
        E("Grafana K6 Load Testing"):::perf
    end
    F("Monitoring Dashboard (Prometheus/Grafana)"):::monitoring

    A -->|"deploys"| B
    A -->|"configures"| C
    C -->|"routes"| B
    D -->|"testTraffic"| B
    E -->|"testTraffic"| B
    B -->|"metrics"| F
    G -->|"launches"| D
    G -->|"launches"| E

    click A "https://github.com/tuttlebr/genai-perf-k6/blob/main/README.md"
    click C "https://github.com/tuttlebr/genai-perf-k6/blob/main/nginx/templates/default.conf.template"
    click D "https://github.com/tuttlebr/genai-perf-k6/blob/main/triton-genai-perf.sh"
    click E "https://github.com/tuttlebr/genai-perf-k6/blob/main/app/script.js"
    click G "https://github.com/tuttlebr/genai-perf-k6/blob/main/docker-compose.yaml"

    classDef config fill:#FFD700,stroke:#333,stroke-width:2px;
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px;
    classDef ingress fill:#87CEEB,stroke:#333,stroke-width:2px;
    classDef perf fill:#FFB6C1,stroke:#333,stroke-width:2px;
    classDef monitoring fill:#D3D3D3,stroke:#333,stroke-width:2px;
    classDef compose fill:#FFA500,stroke:#333,stroke-width:2px;
```
