Multi-Tenant SaaS: Which Architecture Would You Choose? [D]
Our take
The question posed by /u/Fickle_Degree_2728 highlights a common and increasingly complex challenge in building robust, user-centric RAG-powered applications. The core dilemma—balancing domain-specific knowledge with user-private data—is a critical consideration for any SaaS platform handling sensitive information, especially in regions like Sri Lanka where localized knowledge is paramount. Their leaning towards Option 1, a shared global knowledge base complemented by user-specific RAG, shows a practical understanding of the resource demands of fine-tuning. This approach mirrors the scaling strategies many are adopting, recognizing that building and maintaining a constantly updated, domain-specific LLM is a significant undertaking. Understanding GPU Inference Workloads [Understanding GPU Inference Workloads] is crucial here; the choice of architecture will profoundly impact the required compute resources and associated costs, especially as the platform scales to thousands of users. The consideration of scalability is key, and a shared RAG, while demanding in its own right, often proves more manageable in this respect than a fully customized, per-user model.
The debate between Option 1 (shared RAG) and Option 2 (fine-tuned open-source LLM) isn’t a simple one. Fine-tuning, as the author rightly observes, introduces substantial overhead in terms of time, expertise, and cost. While a Sri Lankan/domain-specific fine-tune could, theoretically, lead to more accurate responses within that context, the reality is that maintaining a fine-tuned model requires a continuous cycle of data gathering, retraining, and validation. Furthermore, the potential for catastrophic forgetting—where the model loses general knowledge while specializing—is a real concern. The author’s hesitation about fine-tuning is justified; it’s often a more complex solution than it initially appears. As demonstrated in "Built & Trained a Transformer from Scratch in Pure PyTorch for English-to-Tamil Machine Translation [Built & Trained a Transformer from Scratch in Pure PyTorch for English-to-Tamil Machine Translation]", even seemingly straightforward fine-tuning projects can quickly become intricate, requiring deep technical proficiency. The simpler path of a well-curated, global RAG, supplemented by user-specific data, offers a more pragmatic starting point.
However, a truly robust solution likely involves a hybrid approach. While a globally managed RAG may serve as the initial foundation, incorporating elements of fine-tuning—perhaps on a smaller, more targeted dataset—could significantly enhance performance. This could involve periodically fine-tuning a smaller auxiliary model on a specific subset of Sri Lankan data to augment the global knowledge base, rather than fully fine-tuning the primary LLM. Crucially, ensuring proper citations and sourcing is non-negotiable. Implementing a robust provenance tracking system is essential for building user trust and ensuring the accuracy of responses, regardless of the architecture chosen. The challenge isn't solely about providing *an* answer, but providing a *verifiable* answer. This aligns with the broader trends in AI safety and transparency, highlighted by the need for robust CICD / KAFKA / KUBERNETES / Interview questions (MLE) [CICD / KAFKA / KUBERNETES / Interview questions (MLE)]. As LLMs become increasingly integrated into critical workflows, the ability to trace the origin and validity of their outputs becomes paramount.
Ultimately, the optimal architecture will depend on a careful assessment of the platform’s specific needs, resources, and long-term goals. Starting with Option 1 – a well-managed global RAG with user-specific augmentation – provides a solid foundation for scalability and reduces the initial investment in specialized expertise. The key lies in continuous monitoring and iterative improvement, incorporating elements of fine-tuning as needed to address specific knowledge gaps. The real question to watch is whether the increasing availability of specialized, pre-trained models—perhaps trained on large datasets of Sri Lankan text—will eventually make fine-tuning a more viable and cost-effective option in the near future, shifting the balance away from purely shared knowledge bases.
NOTE -> I expect answer from people who actually have experience and strong understanding of these. please give something beneficial.
I'm building a SaaS platform in Sri Lanka that handles documents and other sensitive data.
Each user can upload their own documents and information, and the platform uses RAG to answer questions based on that user's data. That part makes sense to me.
My main concern is what happens when the user hasn't uploaded enough information. I still want the LLM to provide accurate answers using reliable information from the internet (or from a curated knowledge base), with proper citations.
These are the two architectures I'm considering:
Option 1:
Base LLM (OpenAI/Anthropic via Azure AI Foundry or Amazon Bedrock) ↓ Platform RAG (global knowledge base managed by us) ↓ User-specific RAG In this approach, we maintain a global knowledge base that we (the platform admins) curate and update. Every user can access this shared knowledge, while their own uploaded documents are searched through their personal RAG.
Option 2:
Open-source LLM ↓ Fine-tuned on Sri Lankan/domain-specific data ↓ User-specific RAG Here, we fine-tune an open-source model using Sri Lankan or domain-specific data, and each user still has their own RAG for their private documents.
My concerns are:
- Is fine-tuning actually the right solution here, or is it unnecessary?
- Is a global/shared RAG a better approach than fine-tuning?
- How would you design this architecture if you wanted:
- Accurate answers from domain knowledge
- User-private document search
- Citations/sources
- Good scalability for thousands of users
I'm leaning toward Option 1 because fine-tuning seems expensive, time-consuming, and I have no experience with it yet. However, I'm not sure if I'm thinking about this correctly.
I'd really appreciate hearing how others would approach this problem.
[link] [comments]
Read on the original site
Open the publisher's page for the full experience