# vasundhara-331/novara---final-year-project architecture

> Architecture diagram of the GitHub repository vasundhara-331/novara---final-year-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/vasundhara-331/novara---final-year-project
- Repository: https://github.com/vasundhara-331/novara---final-year-project

## Overview

Novara is an enterprise LLM gateway with a governance dashboard. Callers authenticate and submit prompts through native or compatibility APIs; the gateway applies request controls and adaptive model routing before invoking an LLM provider, then tracks usage and audit activity for the dashboard. The README documents prompt compression, response caching, budgets, rate limits, and operational metrics. Some wiring is inferred only from documented capabilities because the relevant route, middleware, and optimization implementations were not sampled.

Main entry points: [`src/novara/api/app.py`](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/app.py) (FastAPI application), [`src/novara/middleware`](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/middleware) (Request controls), [`src/novara/gateway/litellm_client.py`](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/litellm_client.py) (Provider client), [`src/novara/auth/routes.py`](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/auth/routes.py) (Login and registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_api_app["FastAPI application<br/>[app.py]"]
  node_auth_routes["Login and registration<br/>[routes.py]"]
  node_chat_route["Native chat endpoint<br/>[chat.py]"]
  node_compat_routes["Compatibility endpoints"]
  node_admin_route["Admin endpoints<br/>[admin.py]"]
  node_auth_service["Credential validation<br/>[auth_service.py]"]
end

subgraph group_gateway["Gateway runtime"]
  node_gateway["Enterprise gateway"]
  node_pipeline["Request pipeline<br/>[pipeline.py]"]
  node_context["Request context<br/>[context.py]"]
  node_middleware["Request controls"]
  node_query_analysis["Prompt analysis<br/>[query_analyzer.py]"]
  node_optimization["Compression and cache"]
  node_llm_client["Provider client<br/>[litellm_client.py]"]
end

subgraph group_adaptive["Adaptive routing"]
  node_model_router["Model router<br/>[model_router.py]"]
  node_adie["ADIE decision engine"]
end

subgraph group_governance["Governance and state"]
  node_governance_routes["Usage and audit APIs<br/>[admin.py]"]
  node_services["Audit and usage services"]
  node_database[("Persistent state<br/>[session.py]")]
  node_models["Governance records"]
  node_metrics["Metrics and tracing"]
end

subgraph group_dashboard["Governance dashboard"]
  node_frontend_app["Dashboard application<br/>[App.jsx]"]
  node_frontend_auth["Dashboard session<br/>[AuthContext.jsx]"]
  node_frontend_api["Dashboard API client<br/>[client.js]"]
  node_frontend_pages["Governance views"]
end

node_caller(("API caller"))
node_provider{{"LLM providers"}}

node_caller -->|"sends requests"| node_api_app
node_api_app -->|"mounts routes"| node_auth_routes
node_api_app -->|"mounts routes"| node_chat_route
node_api_app -->|"mounts routes"| node_compat_routes
node_api_app -->|"mounts routes"| node_admin_route
node_auth_routes -->|"validates credentials"| node_auth_service
node_chat_route -->|"submits request"| node_gateway
node_compat_routes -->|"submits request"| node_gateway
node_gateway -->|"executes"| node_pipeline
node_pipeline -->|"dispatches context"| node_middleware
node_middleware -->|"analyzes prompt"| node_query_analysis
node_middleware -.->|"optimizes prompt"| node_optimization
node_middleware -->|"invokes generation"| node_llm_client
node_llm_client -->|"selects model"| node_model_router
node_model_router -->|"requests decision"| node_adie
node_llm_client -->|"sends completion"| node_provider
node_provider -->|"returns response"| node_llm_client
node_pipeline -->|"records activity"| node_services
node_auth_routes -->|"audits actions"| node_services
node_admin_route -->|"manages records"| node_database
node_services -->|"writes records"| node_database
node_database -->|"persists entities"| node_models
node_api_app -->|"exposes metrics"| node_metrics
node_frontend_app -->|"provides session"| node_frontend_auth
node_frontend_app -->|"renders views"| node_frontend_pages
node_frontend_pages -->|"requests dashboard data"| node_frontend_api
node_frontend_auth -->|"supplies credentials"| node_frontend_api
node_frontend_api -->|"calls API"| node_api_app
node_frontend_pages -->|"manages governance"| node_admin_route

click node_api_app "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/app.py"
click node_auth_routes "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/auth/routes.py"
click node_chat_route "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/chat.py"
click node_compat_routes "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/api/routes"
click node_admin_route "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/admin.py"
click node_auth_service "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/services/auth_service.py"
click node_gateway "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/enterprise_gateway.py"
click node_pipeline "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/pipeline.py"
click node_context "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/context.py"
click node_middleware "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/middleware"
click node_query_analysis "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/interfaces/query_analyzer.py"
click node_optimization "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/optimization"
click node_llm_client "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/litellm_client.py"
click node_model_router "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/model_router.py"
click node_adie "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/adie"
click node_governance_routes "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/admin.py"
click node_services "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/services"
click node_database "https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/database/session.py"
click node_models "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/models"
click node_metrics "https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/monitoring"
click node_frontend_app "https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/App.jsx"
click node_frontend_auth "https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/context/AuthContext.jsx"
click node_frontend_api "https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/api/client.js"
click node_frontend_pages "https://github.com/vasundhara-331/novara---final-year-project/tree/main/frontend/src/pages"

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_api_app,node_auth_routes,node_chat_route,node_compat_routes,node_admin_route,node_auth_service toneBlue
class node_gateway,node_pipeline,node_context,node_middleware,node_query_analysis,node_optimization,node_llm_client toneAmber
class node_model_router,node_adie,node_caller toneMint
class node_governance_routes,node_services,node_database,node_models,node_metrics toneRose
class node_frontend_app,node_frontend_auth,node_frontend_api,node_frontend_pages,node_provider toneIndigo
```

## Components

### API and identity

- [FastAPI application](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/app.py): `src/novara/api/app.py`
- [Login and registration](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/auth/routes.py): `src/novara/auth/routes.py`
- [Native chat endpoint](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/chat.py): `src/novara/api/routes/chat.py`
- [Compatibility endpoints](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/api/routes): `src/novara/api/routes`
- [Admin endpoints](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/admin.py): `src/novara/api/routes/admin.py`
- [Credential validation](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/services/auth_service.py): `src/novara/services/auth_service.py`

### Gateway runtime

- [Enterprise gateway](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/enterprise_gateway.py): `src/novara/gateway/enterprise_gateway.py`
- [Request pipeline](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/pipeline.py): `src/novara/gateway/pipeline.py`
- [Request context](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/context.py): `src/novara/gateway/context.py`
- [Request controls](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/middleware): `src/novara/middleware`
- [Prompt analysis](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/interfaces/query_analyzer.py): `src/novara/interfaces/query_analyzer.py`
- [Compression and cache](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/optimization): `src/novara/optimization`
- [Provider client](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/litellm_client.py): `src/novara/gateway/litellm_client.py`

### Adaptive routing

- [Model router](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/gateway/model_router.py): `src/novara/gateway/model_router.py`
- [ADIE decision engine](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/adie): `src/novara/adie`

### Governance and state

- [Usage and audit APIs](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/api/routes/admin.py): `src/novara/api/routes/admin.py`
- [Audit and usage services](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/services): `src/novara/services`
- [Persistent state](https://github.com/vasundhara-331/novara---final-year-project/blob/main/src/novara/database/session.py): `src/novara/database/session.py`
- [Governance records](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/models): `src/novara/models`
- [Metrics and tracing](https://github.com/vasundhara-331/novara---final-year-project/tree/main/src/novara/monitoring): `src/novara/monitoring`

### Governance dashboard

- [Dashboard application](https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Dashboard session](https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Dashboard API client](https://github.com/vasundhara-331/novara---final-year-project/blob/main/frontend/src/api/client.js): `frontend/src/api/client.js`
- [Governance views](https://github.com/vasundhara-331/novara---final-year-project/tree/main/frontend/src/pages): `frontend/src/pages`

### Other components

- **API caller**
- **LLM providers**

## Connections

- API caller → FastAPI application: sends requests
- FastAPI application → Login and registration: mounts routes
- FastAPI application → Native chat endpoint: mounts routes
- FastAPI application → Compatibility endpoints: mounts routes
- FastAPI application → Admin endpoints: mounts routes
- Login and registration → Credential validation: validates credentials
- Native chat endpoint → Enterprise gateway: submits request
- Compatibility endpoints → Enterprise gateway: submits request
- Enterprise gateway → Request pipeline: executes
- Request pipeline → Request controls: dispatches context
- Request controls → Prompt analysis: analyzes prompt
- Request controls → Compression and cache: optimizes prompt
- Request controls → Provider client: invokes generation
- Provider client → Model router: selects model
- Model router → ADIE decision engine: requests decision
- Provider client → LLM providers: sends completion
- LLM providers → Provider client: returns response
- Request pipeline → Audit and usage services: records activity
- Login and registration → Audit and usage services: audits actions
- Admin endpoints → Persistent state: manages records
- Audit and usage services → Persistent state: writes records
- Persistent state → Governance records: persists entities
- FastAPI application → Metrics and tracing: exposes metrics
- Dashboard application → Dashboard session: provides session
- Dashboard application → Governance views: renders views
- Governance views → Dashboard API client: requests dashboard data
- Dashboard session → Dashboard API client: supplies credentials
- Dashboard API client → FastAPI application: calls API
- Governance views → Admin endpoints: manages governance
