# woedem24/azure-llm-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/woedem24/azure-llm-pipeline
- Repository: https://github.com/woedem24/azure-llm-pipeline

## Overview

This is an event-driven Azure document-analysis pipeline: a text-file upload triggers processing, GPT-4o produces structured analysis, Cosmos DB stores it, and an HTTP endpoint retrieves recent results. The sampled function source shows validation, retry classification, secret/client construction, and database operations. Terraform is documented as provisioning infrastructure, but its resource relationships were not sampled, so they are not mapped here.

Main entry points: [`function_app.py`](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py) (Client builders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingestion["Ingestion &amp; API"]
  node_blob_handler["Blob trigger handler<br/>[function_app.py]"]
  node_validation["Document validation<br/>[function_app.py]"]
  node_results_api["Results HTTP endpoint<br/>[function_app.py]"]
end

subgraph group_analysis["AI Analysis"]
  node_analysis_fn["Document analysis<br/>[function_app.py]"]
end

subgraph group_integrations["Cloud Integrations"]
  node_blobstore[("Input Blob Storage")]
  node_client_builders["Client builders<br/>[function_app.py]"]
  node_secret_access["Secret access<br/>[function_app.py]"]
  node_keyvault[("Azure Key Vault")]
  node_openai["Azure OpenAI"]
end

subgraph group_state["Result Storage"]
  node_cosmos_writer["Result writer<br/>[function_app.py]"]
  node_cosmos_reader["Results query<br/>[function_app.py]"]
  node_cosmos[("Azure Cosmos DB")]
end

node_uploader(("File uploader"))
node_api_user(("Results consumer"))

node_uploader -->|"uploads file"| node_blobstore
node_blobstore -->|"triggers"| node_blob_handler
node_blob_handler -->|"reads and validates"| node_validation
node_validation -->|"calls"| node_analysis_fn
node_analysis_fn -->|"builds client via"| node_client_builders
node_client_builders -->|"fetches credentials via"| node_secret_access
node_secret_access -->|"reads secrets"| node_keyvault
node_analysis_fn -->|"requests analysis"| node_openai
node_blob_handler -->|"persists analysis via"| node_cosmos_writer
node_cosmos_writer -->|"gets container via"| node_client_builders
node_cosmos_writer -->|"upserts result"| node_cosmos
node_api_user -->|"requests results"| node_results_api
node_results_api -->|"queries via"| node_cosmos_reader
node_cosmos_reader -->|"gets container via"| node_client_builders
node_cosmos_reader -->|"queries partition"| node_cosmos
node_results_api -->|"returns JSON"| node_api_user

click node_blob_handler "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_validation "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_analysis_fn "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_client_builders "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_secret_access "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_cosmos_writer "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_cosmos_reader "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py"
click node_results_api "https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.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_blob_handler,node_validation,node_results_api toneBlue
class node_analysis_fn toneAmber
class node_blobstore,node_client_builders,node_secret_access,node_keyvault,node_openai toneMint
class node_cosmos_writer,node_cosmos_reader,node_cosmos toneRose
class node_uploader,node_api_user toneIndigo
```

## Components

### Ingestion & API

- [Blob trigger handler](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- [Document validation](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- [Results HTTP endpoint](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`

### AI Analysis

- [Document analysis](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`

### Cloud Integrations

- **Input Blob Storage**
- [Client builders](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- [Secret access](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- **Azure Key Vault**
- **Azure OpenAI**

### Result Storage

- [Result writer](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- [Results query](https://github.com/woedem24/azure-llm-pipeline/blob/main/function_app.py): `function_app.py`
- **Azure Cosmos DB**

### Other components

- **File uploader**
- **Results consumer**

## Connections

- File uploader → Input Blob Storage: uploads file (evidence: `README.md`)
- Input Blob Storage → Blob trigger handler: triggers (evidence: `function_app.py`)
- Blob trigger handler → Document validation: reads and validates (evidence: `function_app.py`)
- Document validation → Document analysis: calls (evidence: `function_app.py`)
- Document analysis → Client builders: builds client via (evidence: `function_app.py`)
- Client builders → Secret access: fetches credentials via (evidence: `function_app.py`)
- Secret access → Azure Key Vault: reads secrets (evidence: `function_app.py`)
- Document analysis → Azure OpenAI: requests analysis (evidence: `function_app.py`)
- Blob trigger handler → Result writer: persists analysis via (evidence: `function_app.py`)
- Result writer → Client builders: gets container via (evidence: `function_app.py`)
- Result writer → Azure Cosmos DB: upserts result (evidence: `function_app.py`)
- Results consumer → Results HTTP endpoint: requests results (evidence: `README.md`)
- Results HTTP endpoint → Results query: queries via (evidence: `function_app.py`)
- Results query → Client builders: gets container via (evidence: `function_app.py`)
- Results query → Azure Cosmos DB: queries partition (evidence: `function_app.py`)
- Results HTTP endpoint → Results consumer: returns JSON (evidence: `function_app.py`)
