# trypromptly/llmstack architecture

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

- Interactive diagram: https://gitdiagram.com/trypromptly/llmstack
- Repository: https://github.com/trypromptly/llmstack

## Overview

#### Purpose and entry points
LLMStack is a self-hostable, multi-tenant no-code platform for composing and publishing LLM agents, workflows, chatbots, and data-backed applications. The Python/Django backend starts through `manage.py` or the installed CLI at `llmstack/cli.py`; ASGI/WSGI server entry points are `llmstack/server/asgi.py` and `llmstack/server/wsgi.py`. The React client begins at `llmstack/client/src/index.js`; its production assets are served via the Django deployment.

#### Platform boundary and delivery
Django centralizes settings, URL routing, request adapters, WebSocket consumers, and rate limiting in `llmstack/server/settings.py`, `llmstack/server/urls.py`, and `llmstack/server/consumers.py`. REST-oriented domain apps expose APIs through their `apis.py`/`urls.py` layers. The browser client is a separate Node/React build (`llmstack/client/package.json`, `llmstack/client/src/App.js`) with Nginx/Docker packaging in `docker/app/Dockerfile` and `docker/app/nginx.conf`.

#### App definitions, publishing, and invocation
The `apps` domain persists app definitions, versioned data/assets, sessions, access controls, and integration settings in `llmstack/apps/models.py`. It accepts API/UI configuration and YAML imports through `llmstack/apps/apis.py` and `llmstack/apps/yaml_loader.py`. App types define externally facing interaction modes—agent, chat, web, workflow, Slack, Discord, Twilio, and voice—in `llmstack/apps/types/app_type_interface.py`, `llmstack/apps/types/agent.py`, and `llmstack/apps/types/workflow.py`. Store publishing/template distribution is a distinct boundary in `llmstack/app_store/models.py` and `llmstack/app_store/generator.py`.

#### Execution engine and streaming
An app run is coordinated as an actor-style pipeline: `llmstack/apps/runner/app_runner.py` initiates execution, `llmstack/apps/runner/app_coordinator.py` manages the run, and input/agent/output actors process stages in `llmstack/apps/runner/input_actor.py`, `llmstack/apps/runner/agent_actor.py`, and `llmstack/apps/runner/output_actor.py`. The `play` subsystem provides messages and output streaming (`llmstack/play/messages.py`, `llmstack/play/output_stream.py`). Run history and provider usage are persisted by processor models (`llmstack/processors/models.py`).

#### Processor/provider integration boundary
Composable processors isolate external API contracts behind provider implementations and a common interface: `llmstack/processors/providers/api_processor_interface.py`, `llmstack/processors/providers/config.py`, and `llmstack/common/blocks/base/processor.py`. Implementations cover LLMs and multimodal APIs (for example OpenAI, Anthropic, Google), communication channels (Slack, Discord, Twilio), web/API tooling, and vector stores. Representative paths are `llmstack/processors/providers/openai/chat_completions.py`, `llmstack/processors/providers/anthropic/messages.py`, and `llmstack/processors/providers/promptly/web_browser.py`.

#### Data ingestion and retrieval
The data domain persists datasources and entries, then runs source → transformation → destination pipelines via `llmstack/data/models.py`, `llmstack/data/pipeline.py`, and `llmstack/data/tasks.py`. Sources span uploaded files, websites, Google Drive, databases, and text (`llmstack/data/sources/files/pdf.py`, `llmstack/data/sources/website/url.py`, `llmstack/data/sources/google/gdrive_file.py`). Transformations split/extract/embed content; destinations include relational stores and Chroma, Pinecone, Qdrant, and Weaviate vector stores (`llmstack/data/transformations/llamindex/embeddings_generator.py`, `llmstack/data/destinations/vector_stores/vector_store.py`).

#### Tenancy, credentials, and asynchronous infrastructure
Organizations and user-scoped/provider configuration form the tenancy and credential boundary in `llmstack/organizations/models.py`, `llmstack/base/models.py`, and `llmstack/connections/models.py`; connection handlers support API key, basic, bearer, OAuth2, and web login flows. Jobs/schedules are persisted and dispatched through `llmstack/jobs/models.py`, `llmstack/jobs/jobs.py`, and `llmstack/jobs/adhoc.py`, with a required background Docker runner packaged in `runner/Dockerfile`. Docker Compose definitions are `llmstack/docker-compose.yml` and `docker/docker-compose.dev.yml`.

Main entry points: [`llmstack/apps/models.py`](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/models.py) (App definitions), [`llmstack/apps/runner/app_coordinator.py`](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/runner/app_coordinator.py) (Actor pipeline), [`llmstack/apps/apis.py`](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/apis.py) (App API & import), [`llmstack/server/settings.py`](https://github.com/trypromptly/llmstack/blob/main/llmstack/server/settings.py) (Django server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client &amp; Delivery"]
  node_react_client["React client<br/>React application<br/>[App.js]"]
end

subgraph group_platform["Platform Core"]
  node_django_server["Django server<br/>ASGI/WSGI platform<br/>[settings.py]"]
  node_app_api["App API &amp; import<br/>domain API<br/>[apis.py]"]
  node_app_models[("App definitions<br/>versioned app model<br/>[models.py]")]
  node_app_types["Interaction types<br/>app-type contracts"]
  node_app_store["App store<br/>publishing boundary<br/>[generator.py]"]
end

subgraph group_execution["App Execution"]
  node_app_runner["App runner<br/>run initiator<br/>[app_runner.py]"]
  node_actor_pipeline["Actor pipeline<br/>execution coordinator<br/>[app_coordinator.py]"]
  node_play_stream["Play streaming<br/>message stream<br/>[output_stream.py]"]
  node_processor_history[("Run history &amp; usage<br/>processor records<br/>[models.py]")]
end

subgraph group_integration["Data &amp; Integrations"]
  node_processor_contract["Processor contracts<br/>provider abstraction"]
  node_provider_implementations["Provider implementations<br/>external adapters"]
  node_data_models[("Datasources &amp; entries<br/>data catalog<br/>[models.py]")]
  node_ingestion_pipeline["Ingestion pipeline<br/>source-transform-destination<br/>[pipeline.py]"]
  node_vector_destinations[("Vector destinations<br/>retrieval storage<br/>[vector_store.py]")]
end

subgraph group_operations["Tenant &amp; Background"]
  node_tenant_connections[("Tenancy &amp; credentials<br/>organization connections<br/>[models.py]")]
  node_jobs["Jobs &amp; schedules<br/>background dispatch<br/>[jobs.py]"]
  node_background_runner["Background runner<br/>Docker worker"]
end

node_react_client -->|"HTTP / WebSocket"| node_django_server
node_django_server -->|"routes requests"| node_app_api
node_app_api -->|"creates and updates"| node_app_models
node_app_models -->|"selects interaction mode"| node_app_types
node_app_models -->|"publishes templates"| node_app_store
node_app_api -->|"invokes app"| node_app_runner
node_app_runner -->|"starts run"| node_actor_pipeline
node_actor_pipeline -->|"streams output"| node_play_stream
node_play_stream -->|"WebSocket delivery"| node_django_server
node_actor_pipeline -->|"executes processors"| node_processor_contract
node_processor_contract -->|"dispatches provider calls"| node_provider_implementations
node_actor_pipeline -->|"records runs and usage"| node_processor_history
node_tenant_connections -->|"supplies provider credentials"| node_processor_contract
node_data_models -->|"drives ingestion"| node_ingestion_pipeline
node_ingestion_pipeline -->|"writes embeddings"| node_vector_destinations
node_app_models -->|"configures data-backed apps"| node_data_models
node_jobs -->|"dispatches work"| node_background_runner
node_background_runner -->|"runs async ingestion"| node_ingestion_pipeline
node_tenant_connections -->|"scopes access"| node_app_models

click node_react_client "https://github.com/trypromptly/llmstack/blob/main/llmstack/client/src/App.js"
click node_django_server "https://github.com/trypromptly/llmstack/blob/main/llmstack/server/settings.py"
click node_app_api "https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/apis.py"
click node_app_models "https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/models.py"
click node_app_types "https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/types/app_type_interface.py"
click node_app_store "https://github.com/trypromptly/llmstack/blob/main/llmstack/app_store/generator.py"
click node_app_runner "https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/runner/app_runner.py"
click node_actor_pipeline "https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/runner/app_coordinator.py"
click node_play_stream "https://github.com/trypromptly/llmstack/blob/main/llmstack/play/output_stream.py"
click node_processor_history "https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/models.py"
click node_processor_contract "https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/providers/api_processor_interface.py"
click node_provider_implementations "https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/providers/openai/chat_completions.py"
click node_data_models "https://github.com/trypromptly/llmstack/blob/main/llmstack/data/models.py"
click node_ingestion_pipeline "https://github.com/trypromptly/llmstack/blob/main/llmstack/data/pipeline.py"
click node_vector_destinations "https://github.com/trypromptly/llmstack/blob/main/llmstack/data/destinations/vector_stores/vector_store.py"
click node_tenant_connections "https://github.com/trypromptly/llmstack/blob/main/llmstack/connections/models.py"
click node_jobs "https://github.com/trypromptly/llmstack/blob/main/llmstack/jobs/jobs.py"
click node_background_runner "https://github.com/trypromptly/llmstack/blob/main/runner/Dockerfile"

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_react_client toneBlue
class node_django_server,node_app_api,node_app_models,node_app_types,node_app_store toneAmber
class node_app_runner,node_actor_pipeline,node_play_stream,node_processor_history toneMint
class node_processor_contract,node_provider_implementations,node_data_models,node_ingestion_pipeline,node_vector_destinations toneRose
class node_tenant_connections,node_jobs,node_background_runner toneIndigo
```

## Components

### Client & Delivery

- [React client](https://github.com/trypromptly/llmstack/blob/main/llmstack/client/src/App.js): React application · `llmstack/client/src/App.js`

### Platform Core

- [Django server](https://github.com/trypromptly/llmstack/blob/main/llmstack/server/settings.py): ASGI/WSGI platform · Central settings, HTTP routing, WebSockets, and rate limiting. · `llmstack/server/settings.py`
- [App API & import](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/apis.py): domain API · Accepts UI/API configuration and YAML app definitions. · `llmstack/apps/apis.py`
- [App definitions](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/models.py): versioned app model · Apps, assets, sessions, access controls, and integration settings. · `llmstack/apps/models.py`
- [Interaction types](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/types/app_type_interface.py): app-type contracts · Agent, chat, web, workflow, and channel-facing modes. · `llmstack/apps/types/app_type_interface.py`
- [App store](https://github.com/trypromptly/llmstack/blob/main/llmstack/app_store/generator.py): publishing boundary · Publishes and distributes templates. · `llmstack/app_store/generator.py`

### App Execution

- [App runner](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/runner/app_runner.py): run initiator · `llmstack/apps/runner/app_runner.py`
- [Actor pipeline](https://github.com/trypromptly/llmstack/blob/main/llmstack/apps/runner/app_coordinator.py): execution coordinator · Coordinates input, agent, and output actor stages. · `llmstack/apps/runner/app_coordinator.py`
- [Play streaming](https://github.com/trypromptly/llmstack/blob/main/llmstack/play/output_stream.py): message stream · Carries run messages and streamed output. · `llmstack/play/output_stream.py`
- [Run history & usage](https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/models.py): processor records · `llmstack/processors/models.py`

### Data & Integrations

- [Processor contracts](https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/providers/api_processor_interface.py): provider abstraction · Common interface and provider configuration boundary. · `llmstack/processors/providers/api_processor_interface.py`
- [Provider implementations](https://github.com/trypromptly/llmstack/blob/main/llmstack/processors/providers/openai/chat_completions.py): external adapters · LLM, multimodal, channel, web/API, and vector-store providers. · `llmstack/processors/providers/openai/chat_completions.py`
- [Datasources & entries](https://github.com/trypromptly/llmstack/blob/main/llmstack/data/models.py): data catalog · `llmstack/data/models.py`
- [Ingestion pipeline](https://github.com/trypromptly/llmstack/blob/main/llmstack/data/pipeline.py): source-transform-destination · Runs ingestion, extraction, chunking, and embedding stages. · `llmstack/data/pipeline.py`
- [Vector destinations](https://github.com/trypromptly/llmstack/blob/main/llmstack/data/destinations/vector_stores/vector_store.py): retrieval storage · Relational and vector-store destinations. · `llmstack/data/destinations/vector_stores/vector_store.py`

### Tenant & Background

- [Tenancy & credentials](https://github.com/trypromptly/llmstack/blob/main/llmstack/connections/models.py): organization connections · Organization-scoped users and provider authentication connections. · `llmstack/connections/models.py`
- [Jobs & schedules](https://github.com/trypromptly/llmstack/blob/main/llmstack/jobs/jobs.py): background dispatch · Persists and dispatches scheduled and ad hoc work. · `llmstack/jobs/jobs.py`
- [Background runner](https://github.com/trypromptly/llmstack/blob/main/runner/Dockerfile): Docker worker · Required container runtime for asynchronous jobs. · `runner/Dockerfile`

## Connections

- React client → Django server: HTTP / WebSocket
- Django server → App API & import: routes requests
- App API & import → App definitions: creates and updates
- App definitions → Interaction types: selects interaction mode
- App definitions → App store: publishes templates
- App API & import → App runner: invokes app
- App runner → Actor pipeline: starts run
- Actor pipeline → Play streaming: streams output
- Play streaming → Django server: WebSocket delivery
- Actor pipeline → Processor contracts: executes processors
- Processor contracts → Provider implementations: dispatches provider calls
- Actor pipeline → Run history & usage: records runs and usage
- Tenancy & credentials → Processor contracts: supplies provider credentials
- Datasources & entries → Ingestion pipeline: drives ingestion
- Ingestion pipeline → Vector destinations: writes embeddings
- App definitions → Datasources & entries: configures data-backed apps
- Jobs & schedules → Background runner: dispatches work
- Background runner → Ingestion pipeline: runs async ingestion
- Tenancy & credentials → App definitions: scopes access
