Abstract
As Large Language Models (LLMs) are rapidly integrated into software, developers lack a standardized blueprint for building secure, scalable, and modular systems. This paper proposes a preliminary "Reference Architecture" (RA) for LLM-integrated systems, dividing them into four functional layers and two cross-cutting sidecars. By mapping three real-world open-source tools to this framework, the authors provide a practical guide for designing, evaluating, and scaling future AI applications.
Introduction
While building a quick prototype using an LLM API is easy, deploying a robust, production-ready LLM application is incredibly complex. Developers must juggle unique challenges like prompt injection, non-deterministic outputs, context window management, and strict privacy regulations (like GDPR or the EU AI Act).
In traditional software engineering, developers rely on Reference Architectures (RAs)—standardized blueprints—to ensure best practices, reduce costs, and guarantee interoperability. However, because the LLM field is so new, no commonly accepted RA exists for LLM-integrated systems. This absence often results in monolithic, hard-to-maintain systems. This paper attempts to fill that gap by proposing a foundational software architecture tailored specifically to the requirements of LLMs.
Methodology
The authors employed a hybrid approach combining academic research with practical industry experience. First, they conducted a literature review across major academic databases to identify existing LLM software architectures. From this, they identified 10 critical "architectural concerns" unique to LLMs, such as data handling, fairness, and customizability. They then designed a preliminary functional RA focused on software components (APIs, databases, microservices). Finally, they validated the architecture by mapping the components of three distinct, real-world open-source LLM systems—MaxKB, Continue, and InternVL—onto their proposed blueprint.
The Proposed Reference Architecture
The resulting architecture consists of four horizontal layers and two vertical "sidecars" that provide cross-cutting functionality across the entire stack.
The Four Functional Layers
- Presentation Layer: Handles user interfaces (UIs) and external connectors (APIs/SDKs/Third-party integrations).
- Application Logic Layer: Contains middleware for request validation and orchestrators for managing complex workflows.
- LLM Integration Layer: The core of the system, including pre-processing (tokenization, prompt engineering), the LLMs themselves, task-specific adapters (like LoRA), and post-processing (filtering, formatting).
- Data Management Layer: Manages vector databases for Retrieval-Augmented Generation (RAG), interaction memory for chat context, and model/adapter checkpoints.
Cross-Cutting Sidecars
Security, compliance, and monitoring are integrated via Guardrail and Monitoring sidecars. This design allows the system to catch malicious prompts at the UI level, enforce data privacy at the storage level, and track performance metrics across the entire pipeline.
Validation and Case Studies
To prove the architecture's utility, the authors mapped three popular open-source systems to the RA: MaxKB (a RAG-based QA system), Continue (an AI coding assistant), and InternVL (a multi-modal system).
The mapping exercise demonstrated that despite their different use cases, all three systems cleanly fit the proposed architecture. For instance, Continue's codebase vectors mapped perfectly to the Data Management layer, while its PostHog telemetry aligned with the Monitoring sidecar. This suggests the RA successfully captures the fundamental "anatomy" of modern LLM applications.
Conclusion and Future Work
The proposed Reference Architecture provides a much-needed foundation for standardizing LLM-integrated systems. By isolating the LLM Integration layer, it promotes modularity, allowing developers to swap models or update adapters without disrupting the entire system.
However, the authors acknowledge that the field is nascent, and their literature review yielded few primary studies. Future work will involve a broader review of "grey literature" (industry blogs and whitepapers), expert surveys to refine the RA, and expansion into specific technical and compliance views aligned with international standards like ISO/IEC/IEEE.
Summary updated