workspace { !identifiers hierarchical name "ZDF QS - alle Systeme" model { // --- Definition of people --- user = person "ZDFD Employee" "Editorial or technical users inside ZDFD." "editor, yellow" // --- Definition of software-systems --- mediathek = softwareSystem "Mediathek" "GPT Platform - Custom GPT UI" "Service API, owned, Google Cloud Platform - Developer Portal" { ollama = container "Ollama Deployments" { tags "Google Cloud Platform - Kubernetes Engine" ollama_cpu = component "Ollama CPU Instance" { tags "Google Cloud Platform - Kubernetes Engine" description "A low performance ollama k8s deployment. Is tagged as CPU_OLLAMA in kubernetes for task scheduling. Base load deployment - never scales to zero. Currently used until 8B parameters." } ollama_gpu = component "Ollama GPU Instance" { tags "Google Cloud Platform - Kubernetes Engine" description "A high performance ollama k8s deployment. Is tagged as GPU_OLLAMA in kubernetes for task scheduling. Always tries to scale to zero asap. Uses g2-standard-4 for a maximum of 32B parameters." } load_balancer = component "K8S Loadbalancer (K8S Service)" { tags "Google Cloud Platform - Cloud Load Balancing" description "Standard cloud lb connected with custom entrypoint (via networkpolicy), manages ollama loadbalancing by using custom metadata labels of ollama pods / deployments" this -> ollama_cpu "delivers labeled requests" this -> ollama_gpu "delivers labeled requests" } } webui = container "Open WebUI (Frontend)" { tags "Google Cloud Platform - Kubernetes Engine" ui = component "Open WebUI" { tags "Google Cloud Platform - Kubernetes Engine" description "WebUI runs in a low performance CPU pod." } db = component "Database" { tags "Google Cloud Platform - Kubernetes Engine, Database" description "Postgres database - currently hosted in kubernetes, could move to Cloud SQL." ui -> this "stores and loads data" } ingress = component "Traefik Ingress" { tags "Google Cloud Platform - Cloud Load Balancing" description "Traefik ingress for external requests, Open WebUI is its only endpoint" this -> ui "serves requests and tcp connections" } } } sso = softwareSystem "Single Sign On" "SSO System (usually keycloak or some kind of SSO-Provider like Azure EntraID)" "Service API, owned, Google Cloud Platform - Developer Portal" { app = container "Login App Deployment (e.g. Keycloak)" { tags "Google Cloud Platform - Google Kubernetes Engine" description "Has user information and handles SignUp and SignIn - required personal information for SignUp can be any valid company email-address, no further personal data is being acquired." authentication = component "Authentication Component" { description "Checks if a users login request is eligible by password, passkey or OIDC" } logout = component "Logout Component" { description "Sets user token on a blacklist, deletes token from browser and forwards to logout page" } signup = component "SignUp Component" { description "Verifies the email address by sending a one-time-link" } } } // --- User Setup --- // Editor user -> mediathek "Einloggen - Videos schauen - nerven" // user -> ollama_webui "edits models and interacts with them" // ollama_webui.webui.ui -> ollama_webui.ollama.load_balancer "accesses ollama api" // ollama_webui.webui.ui -> sso.app.authentication "authenticates users against sso" // ollama_webui.webui.ui -> sso.app.signup "signs up new users using sso" // sso.app.logout -> ollama_webui.webui.ui "blacklists access_tokens on logout" // -> "blacklists access_tokens on logout" } views { properties { "mermaid.url" "https://mermaid.ink" "mermaid.format" "png" } systemLandscape "systemLandscape_OllamaWebUI" { include * } systemContext mediathek "systemContext_Mediathek" { include * // autolayout lr } container mediathek "containers_Mediathek" { include * // autolayout lr } // component ollama_webui.ollama "component_ollama_webui_ollama" { // include * // } // component ollama_webui.webui "component_ollama_webui_ui" { // include * // } // container sso "containers_sso" { // include * // } // component sso.app "components_sso" { // include * // } image sso.app.authentication { mermaid modules/sso/keycloak/auth_flow.mmd title "Sequence diagram for LoginFlow" } image sso.app.signup { mermaid modules/sso/keycloak/registration_flow.mmd title "Sequence diagram for SignUpFlow" } styles { element "Person" { shape Person } element "Service API" { shape hexagon } element "Database" { shape cylinder } element "ms" { background #0062FF } element "yellow" { background #FA7D19 } element "foreign" { background #A3A3A3 } element "user" { background #001AC5 color #ffffff } } themes https://static.structurizr.com/themes/microsoft-azure-2023.01.24/theme.json https://static.structurizr.com/themes/google-cloud-platform-v1.5/theme.json } }