# kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai architecture

> Architecture diagram of the GitHub repository kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai
- Repository: https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai

## Overview

This repository is a small web workshop demonstrating prompt guardrails around LLM generation. A user submits a prompt through the browser; the FastAPI endpoint validates it, calls the model integration, checks the generated text, and returns either a block or a safe response for display. The source index shows the model module is referenced but absent from the supplied tree, so it is represented as an external integration. The template and stylesheet are present in the tree, but their contents were not sampled.

Main entry points: [`app.py`](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/app.py) (FastAPI application), [`static/script.js`](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/static/script.js) (Browser interaction), [`templates/index.html`](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/templates/index.html) (Workshop page), [`guardrails.py`](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/guardrails.py) (Input checks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_page["Workshop page<br/>[index.html]"]
  node_browser["Browser interaction<br/>[script.js]"]
  node_styles["Page styling<br/>[style.css]"]
end

subgraph group_runtime["Guardrail runtime"]
  node_api["FastAPI application<br/>[app.py]"]
  node_input["Input checks<br/>[guardrails.py]"]
  node_model["Gemini generation"]
  node_output["Output checks"]
end

node_user(("User"))

node_user -->|"uses"| node_page
node_api -->|"renders"| node_page
node_browser -->|"posts prompt"| node_api
node_api -->|"checks input"| node_input
node_api -.->|"generates response"| node_model
node_api -->|"checks output"| node_output
node_browser -->|"displays result"| node_user

click node_page "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/templates/index.html"
click node_browser "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/static/script.js"
click node_styles "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/static/style.css"
click node_api "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/app.py"
click node_input "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/guardrails.py"
click node_output "https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/output_guardrails.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_page,node_browser,node_styles,node_user toneBlue
class node_api,node_input,node_model,node_output toneAmber
```

## Components

### Web interface

- [Workshop page](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/templates/index.html): `templates/index.html`
- [Browser interaction](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/static/script.js): `static/script.js`
- [Page styling](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/static/style.css): `static/style.css`

### Guardrail runtime

- [FastAPI application](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/app.py): `app.py`
- [Input checks](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/guardrails.py): `guardrails.py`
- **Gemini generation**
- [Output checks](https://github.com/kodigitaccount/llm-guardrails_-enterprise-ai_-responsible-ai/blob/main/output_guardrails.py): `output_guardrails.py`

### Other components

- **User**

## Connections

- User → Workshop page: uses
- FastAPI application → Workshop page: renders (evidence: `app.py`)
- Browser interaction → FastAPI application: posts prompt (evidence: `static/script.js`)
- FastAPI application → Input checks: checks input (evidence: `app.py`)
- FastAPI application → Gemini generation: generates response (evidence: `app.py`)
- FastAPI application → Output checks: checks output (evidence: `app.py`)
- Browser interaction → User: displays result (evidence: `static/script.js`)
