Ali Süleyman Topuz

Part III: Technical Foundation

Chapter 7: Technical Stack Evaluation

“The best technical stack for your AI transformation is not the most sophisticated one. It is the one your team can build on, operate reliably, and improve incrementally over the next three years.”


The Stack Decision

Every production AI system is built on a set of technical choices: which model, which orchestration approach, which retrieval infrastructure, which deployment pattern, which observability tooling. Individually, each of these choices is defensible. Together, they define the foundation on which everything else depends the platform that determines how fast the team can ship, how reliably the systems operate, and how much the operational overhead costs as the number of production AI systems grows.

The AI tooling landscape in 2026 is mature enough to support serious production work and still changing fast enough that decisions made without a clear framework get revisited expensively. There are dozens of vector databases, a growing number of orchestration frameworks, multiple frontier model providers, and a proliferating ecosystem of observability, evaluation, and prompt management tools each positioning itself as the essential component your stack cannot function without. Navigating this landscape requires a framework that cuts through the marketing noise and focuses on the criteria that actually determine whether a stack choice is right for your organization.

The central insight of this chapter is that AI stack evaluation is not primarily a technical exercise. It is a strategic exercise. The best technical stack is not the one that performs best in benchmarks it is the one that best fits the team’s current capability, the organization’s operational constraints, and the growth trajectory of the use cases the roadmap describes. A stack that a junior engineer can debug at 2 AM when a production system fails is worth more than a technically superior stack that requires a specialist. A vendor whose pricing model scales predictably with your usage is worth more than a cheaper vendor whose pricing cliff creates budget risk at scale.

This chapter walks through the five layers of an AI technical stack, describes how to evaluate each layer, and provides a framework for making the build-versus-buy decision for each component. It also covers the most common stack mistakes choices that look reasonable at the time and reveal their problems only after significant investment has been made in them.


The Five Layers of an AI Stack

An AI technical stack can be organized into five layers, each with distinct responsibilities and distinct evaluation criteria. Understanding the layers and how they interact is the prerequisite for making coherent component-level decisions.

Layer 1: Foundation models. The models that generate, classify, summarize, or reason over text. This includes the frontier models from major providers (used via API), open-weight models (deployed on your own infrastructure), and specialized models (fine-tuned for specific tasks). Foundation models are the capability layer they determine what is technically possible for each use case.

Layer 2: Orchestration and agent infrastructure. The code and frameworks that coordinate how models are called, how tools are invoked, how context is assembled and managed, and how multi-step workflows are executed. This layer translates high-level application requirements into sequences of model calls and tool invocations.

Layer 3: Retrieval infrastructure. The systems that store, index, and retrieve the organization-specific information that grounds AI responses in your specific context vector databases, embedding pipelines, document processing systems, and the retrieval logic that determines what context is provided to the model for each request.

Layer 4: Deployment and serving. The infrastructure that puts AI systems into production API layers, caching, rate limiting, load balancing, and the integration patterns that connect AI services to the core application.

Layer 5: Observability and evaluation. The systems that measure what AI systems are doing and how well they are doing it logging, monitoring, quality evaluation, cost tracking, and the feedback infrastructure that enables continuous improvement.

Each layer can be sourced from a different vendor, built in-house, or some combination. The choices at each layer interact with each other: a highly capable foundation model may require a more sophisticated orchestration layer to realize its full potential; a vector database choice constrains the embedding model options that make sense with it; an observability approach needs to be designed around the model and orchestration choices rather than added afterward. Thinking about the stack as layers rather than as individual tools makes these interactions visible.


Evaluating Foundation Models

Foundation model selection is the decision that most technology leaders spend the most time on and that matters less than they expect, for a reason that is counterintuitive until you have built a few production AI systems: for most B2B SaaS use cases, the quality difference between the top-tier models from major providers is smaller than the quality difference between a well-engineered prompt and a poorly engineered one. The model is an important variable it is not the most important variable.

That said, model selection deserves systematic evaluation rather than defaulting to whichever model received the most attention at the last AI conference. The criteria that matter most in a production context are:

Task-specific performance. General benchmark scores are a starting point, not a decision. The relevant performance is performance on your specific task, with your specific data, in your specific operational context. Before committing to a model for a production use case, evaluate it empirically on a representative sample of real inputs from your domain. A model that scores 8% higher on a general reasoning benchmark but produces responses that feel stilted in your product’s voice is not the better choice for a customer-facing use case.

Cost at production scale. Calculate the cost per request at your anticipated production volume, not the development volume. A model that is 40% more expensive per token than an alternative may still be the right choice if it produces outputs that require significantly less downstream processing. But the cost needs to be evaluated at scale a model that is affordable at 500 requests per day may be prohibitively expensive at 50,000.

Latency characteristics. Time-to-first-token and total response time matter differently depending on the use case. A batch classification system that processes tickets asynchronously has different latency requirements than an inline assistant that a user is waiting for in real time. Most frontier models have predictable latency profiles at normal usage levels, but latency spikes during provider outages or peak usage periods can degrade user experience in ways that are not visible in average latency metrics.

Context window size. The maximum amount of text the model can process in a single request constrains how much context can be provided for retrieval-augmented use cases. A use case that needs to reason over long documents may require a model with a larger context window than the default configuration of the most commonly used models. Context window size also affects cost directly larger contexts mean more input tokens per request.

Reliability and SLA. Production AI systems need to maintain quality and availability under real operating conditions, including provider outages, rate limiting, and model updates. Evaluate the reliability track record of each provider you are considering and understand their SLA commitments both the uptime guarantees and the response time guarantees at different pricing tiers.

Vendor lock-in risk. A model API that is available only from a single provider creates dependency that has real cost implications if that provider changes pricing, degrades quality, or exits the market. Where the performance difference is small, prefer providers with interoperable API designs or use orchestration patterns that make model substitution easy without major application refactoring.

For most B2B SaaS companies beginning AI transformation, a practical approach is to start with one of the top-tier frontier models from a major provider where reliability is high and the ecosystem of tooling support is mature and to evaluate open-weight alternatives once the use case is validated in production and the team has enough operational experience to manage the additional infrastructure responsibility.

One underappreciated dimension of model evaluation is the quality of the provider’s error and failure behavior. Model APIs fail they time out, they return malformed responses, they hit rate limits during peak usage periods. How a provider handles failures, and how easy it is to implement robust retry and fallback logic against their API, is a real operational consideration that does not appear in capability benchmarks. Test the failure behavior of any model provider you are seriously evaluating: deliberately introduce timeout conditions, submit malformed requests, and verify that the error responses are well-structured enough to support the retry and fallback logic your application will need. A provider that returns clear, structured error codes is significantly easier to build reliably against than one that returns ambiguous errors that require complex client-side handling.

The Multi-Model Strategy

As the number of production AI systems grows, a single-model strategy becomes increasingly constraining. Different use cases have different optimal price-performance profiles: a classification task that needs to be run on every incoming support ticket should use the cheapest model that meets the quality threshold, while a complex reasoning task that synthesizes information from multiple sources for a key customer decision may justify a frontier model. A mature AI stack uses multiple models, routing each request to the model best suited to its requirements.

Multi-model strategies require routing logic a layer in the orchestration that determines which model to use for each type of request and evaluation infrastructure that can measure quality across all deployed models. The investment in this infrastructure pays off as usage scales and cost optimization becomes a meaningful lever. Teams that build routing logic early, even when they are only using a single model, make the transition to a multi-model strategy significantly easier when the time comes.


Orchestration Frameworks

Orchestration frameworks sit between the application and the model layer, managing the complexity of multi-step AI workflows. For simple use cases a single model call that produces a single output no framework is needed. For use cases involving tool use, multi-step reasoning, retrieval integration, or parallel model calls, orchestration frameworks provide significant value.

The core functions of an orchestration framework are: managing the prompt assembly process (combining system instructions, retrieved context, conversation history, and user input into the correct format for the model), handling tool invocations (allowing the model to call external APIs, query databases, or run code as part of its reasoning process), managing state across multi-turn interactions, and providing error handling and retry logic for the inherent unreliability of external API calls.

Several mature frameworks are available as of 2026, each with different design philosophies and different trade-offs. Evaluating them requires asking: how well does it match the technical patterns required by your specific use cases? How actively maintained is it, and what is the community size? How much does it abstract versus expose the underlying model behavior? Frameworks that abstract too aggressively make debugging difficult when the system produces wrong outputs, understanding why requires understanding the framework’s internals as well as the model’s behavior. Frameworks that expose too little make simple use cases unnecessarily complex.

A useful evaluation approach is to prototype your highest-complexity planned use case with two frameworks and compare not just the initial implementation but the debugging experience when something goes wrong. The framework that makes failure modes visible and recoverable is worth more in production than the framework that is easier to get started with.

For teams at Score 2 or 3 on team capability, the recommendation is to start without a framework for the first use case and introduce one only when the complexity genuinely requires it. Writing explicit orchestration code even if it is more verbose than a framework equivalent forces the team to understand what is happening at each step, which builds the operational judgment needed to debug production problems effectively. Framework adoption is more successful when the team has first experienced the complexity the framework is designed to manage.


Retrieval Infrastructure: Vector Databases and RAG

Retrieval-augmented generation (RAG) is the architectural pattern that allows AI systems to answer questions based on your specific content your documentation, your customer history, your internal knowledge base rather than relying solely on the model’s general training knowledge. It is foundational to most B2B SaaS AI use cases because the value of the AI system comes from its access to organization-specific context, not from generic capability alone.

RAG works by converting documents and content into numerical representations (embeddings) that capture their semantic meaning, storing those embeddings in a vector database, and at query time retrieving the most semantically relevant content to include in the model’s context window. The quality of the overall system is determined by three factors: the quality of the embeddings (how accurately the numerical representation captures the meaning), the quality of the retrieval (how reliably the most relevant content is retrieved for each query), and the quality of the synthesis (how well the model uses the retrieved content to produce a useful response).

Vector database selection is a more nuanced decision than it first appears. The primary dimensions of evaluation are: query performance at your anticipated document volume and query rate, the richness of the metadata filtering capabilities (the ability to restrict retrieval to documents matching specific criteria by customer, by date, by document type), the quality of the hybrid search capabilities (combining semantic similarity search with keyword search for better precision), the operational complexity of managing and updating the index, and the pricing model at scale.

For most B2B SaaS companies beginning their first RAG deployment, a managed cloud vector database service is the right choice. The operational overhead of running a self-hosted vector database is meaningful, and the cost savings only become significant at very high query volumes. Evaluate managed services against the metadata filtering and hybrid search criteria, since these capabilities vary significantly between providers and matter significantly for production use case performance.

Embedding model selection is closely coupled to vector database selection. The embedding model converts text into the numerical vectors stored in the database, and the database must be populated and queried using the same embedding model to maintain semantic consistency. Considerations include: embedding dimensionality (higher dimensions can capture more semantic nuance but cost more to store and query), the model’s performance on domain-specific content (general-purpose embedding models may not capture the terminology and concepts specific to your domain as well as domain-adapted models), and the API availability and cost of the embedding model at the volume required by your indexing and query pipeline.

Retrieval quality is the most frequently underestimated investment in RAG system development. Getting a RAG system to produce a response is straightforward. Getting a RAG system to reliably retrieve the most relevant content for diverse query types, across a large document collection, with acceptable latency, requires systematic evaluation and iteration. Build a retrieval evaluation dataset a set of representative queries with documented correct answers before beginning implementation, and use it to measure retrieval quality throughout development. The retrieval evaluation dataset is not optional; it is the tool that reveals whether the system is improving or regressing as you tune the retrieval configuration.


Choosing Your AI Approach: RAG, Fine-Tuning, or Prompting Alone

Before selecting specific stack components, there is a higher-level architectural decision that shapes everything else: for each use case, which of the three primary approaches to AI customization is appropriate? The three options are prompting alone (using a general-purpose model with carefully crafted instructions), retrieval-augmented generation (grounding the model’s responses in retrieved content from your knowledge base), and fine-tuning (adapting a model’s weights on your specific data to change its behavior or improve its performance on your domain).

Understanding when each approach is appropriate prevents two common mistakes: teams that attempt to fine-tune when prompting would suffice (investing months in training infrastructure for marginal gains), and teams that rely on prompting alone when retrieval is necessary (producing systems that hallucinate about organization-specific details they were never given).

Prompting alone is appropriate when the task requires general capability that the model already has reasoning, writing, summarization, classification of common categories and when the information required to perform the task can be provided in the context window. A system that helps engineers write clearer commit messages, or that drafts email responses for a CS rep, typically requires prompting alone. The model already knows how to write clearly and draft emails; the system’s job is to provide appropriate instructions and context in the prompt.

Retrieval-augmented generation is appropriate when the task requires information that the model does not have in its training data your specific product documentation, your customer’s account history, your internal policies and procedures, or any other organization-specific knowledge. RAG is the right approach for the majority of B2B SaaS AI use cases because the value of the AI system comes from its access to your specific context, and that context is too large and too frequently updated to fit in a prompt. A system that answers customer questions about product configuration, or that surfaces relevant historical information during a CS rep’s conversation with a customer, requires RAG.

Fine-tuning is appropriate when you need to change the model’s fundamental behavior in ways that prompting cannot achieve teaching the model a specialized vocabulary, adapting its writing style to match your brand, improving its performance on a very specific narrow task where you have extensive labeled training data, or compressing a complex multi-example few-shot prompt into the model’s weights for efficiency at scale. Fine-tuning has significantly higher upfront cost (data preparation, training compute, evaluation) than prompting or RAG, and it requires ongoing re-training as the model’s knowledge needs to be updated. For most organizations beginning AI transformation, fine-tuning is not the right starting point. It becomes appropriate after the team has operated production RAG systems long enough to understand precisely where the base model’s behavior falls short of requirements in ways that prompting adjustments cannot address.

A practical decision rule: start with prompting alone for tasks where general model capability suffices. Add retrieval when the system needs organization-specific knowledge. Invest in fine-tuning only when there is a demonstrated, measured gap in performance that RAG and prompt engineering cannot close, and when you have enough labeled training data to make the fine-tuning investment worthwhile.


The Prompt Engineering Layer

Prompts are the primary mechanism through which an AI system’s behavior is specified. They define the persona, the constraints, the output format, the reasoning approach, and the handling of edge cases. For a production AI system, the prompt is as much application logic as any code in the codebase and it deserves to be managed with the same discipline.

In most organizations’ early AI development, prompts live in code strings, scattered across the codebase, changed informally, and with no version history or deployment process distinct from the code that contains them. This approach works for the first few weeks and becomes a liability thereafter. When a prompt change causes a quality regression, there is no way to identify what changed. When multiple engineers are working on related systems, prompt changes conflict in ways that are hard to trace. When a model update changes how a prompt behaves, the team has no way to test the impact before it reaches production.

Prompt management infrastructure the systems and processes that treat prompts as first-class artifacts is one of the highest-value foundational investments in an AI stack. The minimum viable prompt management system includes: a central store for all production prompts, distinct from the application code that calls them; version control with the ability to roll back to a previous version; a testing harness that runs a representative set of inputs against any prompt change before deployment; and a deployment pipeline that stages prompt changes through an evaluation environment before production. More sophisticated implementations add A/B testing capabilities, performance tracking per prompt version, and governance workflows for prompt changes that affect high-stakes use cases.

Building this infrastructure before it is urgently needed before a prompt change causes a production quality incident is the difference between a team that can improve AI systems confidently and a team that treats prompt changes as high-risk, high-anxiety operations.


Deployment, Serving, and API Management

Putting AI systems into production requires more than deploying the model. It requires building the serving layer that manages the interaction between the application and the AI components handling the latency characteristics of model APIs, managing costs through caching and rate limiting, and providing the integration patterns that allow AI services to be consumed cleanly by the core application.

Latency management is one of the most practically important challenges in AI serving. LLM API calls have latency profiles that are fundamentally different from database queries or microservice calls. A p50 latency of 800ms is common for mid-sized responses from current frontier models, and p99 latency can exceed several seconds. For user-facing features, this latency must be either reduced through caching and streaming, or managed through UX patterns that make the wait acceptable. Streaming responses displaying the AI output token by token as it is generated significantly improve the perceived responsiveness of AI features without reducing the actual generation time.

Semantic caching is a technique that can reduce both cost and latency for use cases where many queries are semantically similar. Rather than caching exact query strings, a semantic cache stores previous query-response pairs as embeddings and returns a cached response when a new query is sufficiently similar to a cached one. For support automation use cases where many customers ask variations of the same question, semantic caching can reduce model call volume by 20% to 40%, with corresponding cost savings.

Circuit breakers and graceful degradation. Because AI API calls are network calls to external services, they are subject to failures that internal function calls are not. A well-designed AI serving layer includes circuit breaker logic that detects when an AI service is failing or degrading and automatically switches to a fallback behavior a simpler rule-based response, a cached result, or a clear indication to the user that AI assistance is temporarily unavailable rather than propagating the failure to the user experience. Building graceful degradation from the beginning, even before the first production incident, means that when failures occur they are handled cleanly rather than creating visible breakage.

AI service isolation deploying AI capabilities as services that are separate from the core application is the infrastructure pattern that makes AI systems independently scalable and independently deployable. When AI services are isolated, a spike in AI workload does not affect core application performance, AI services can be updated independently without a full application deployment, and different AI services can use different models or configurations without affecting each other. Building this isolation from the first production AI system establishes the pattern that all subsequent systems will follow.


Observability for AI Systems

Traditional application monitoring measures whether systems are running and responding. It does not measure whether AI systems are producing correct, safe, and useful outputs. Building observability that is actually useful for AI systems requires adding a semantic layer measurement of what the system is doing, not just whether it is doing it.

The metrics that matter most for production AI systems fall into four categories. Quality metrics measure the accuracy, helpfulness, and safety of AI outputs. They include automated metrics (similarity to reference outputs, format compliance, safety classifier scores) and sampled human evaluation (human reviewers assessing a random sample of outputs against defined quality criteria). Quality metrics are the most important and the hardest to automate fully building a quality measurement approach that is both systematic and scalable is one of the more technically demanding aspects of AI observability.

Operational metrics measure the performance characteristics of the AI service: latency (p50, p95, p99), throughput, error rates, and model API availability. These are similar to traditional service metrics and can be instrumented with standard observability tooling, with the addition of AI-specific dimensions like token usage per request and model version.

Cost metrics track spending at the granularity needed to identify cost drivers and optimization opportunities: cost per request, cost per user, cost per use case, and cost trends over time. Cost metrics are often overlooked in early AI deployments when the spend is modest, and then urgently needed when a usage spike produces an unexpected bill.

Feedback metrics capture signals from the users of the AI system whether they accepted or overrode AI recommendations, whether they flagged outputs as incorrect, whether they engaged with AI-assisted content or ignored it. Feedback metrics are the primary input to the improvement loop that makes AI systems better over time.

Selecting observability tooling requires evaluating both the collection infrastructure (how logs and metrics are captured from the AI service) and the analysis layer (how those signals are surfaced to the team in actionable form). Several dedicated AI observability platforms have emerged that address both layers, alongside more general-purpose observability platforms that have added AI-specific capabilities. For most teams beginning AI transformation, a pragmatic approach is to instrument logging comprehensively from the start and defer selection of a dedicated observability platform until the team has enough production experience to know what they most need to see.


Security and Data Privacy in Stack Selection

Security and data privacy considerations are not separate from the technical stack evaluation they are integral to it. The choices made at each stack layer have direct implications for what data is transmitted to third parties, how it is stored and processed, and what obligations and risks that creates.

Data sent to model providers. Every call to a commercial model API sends data the prompt contents, which includes any retrieved documents and any user-provided information to the provider’s infrastructure for processing. For most general-purpose B2B SaaS use cases, this data includes operational content that may be subject to your customer data processing agreements. Before deploying any AI system that processes customer data, verify that your agreements with AI providers are consistent with your obligations to your customers. Most major providers offer enterprise data processing agreements that prohibit use of submitted data for model training, but the default terms for lower-tier API access often do not offer these protections.

Data residency requirements. Customers in regulated industries or in jurisdictions with strict data residency requirements may have contractual or regulatory constraints on where their data can be processed. If your customer base includes such customers, verify that the AI providers you are using can accommodate those requirements either through region-specific API endpoints or through on-premises or private cloud deployment options.

Sensitive data in context windows. RAG systems retrieve documents and include them in model context windows as part of generating responses. If your document collection includes sensitive data personally identifiable information, financial data, confidential business information that sensitive data will be included in API calls to the model provider when it is retrieved. Build data classification into the retrieval infrastructure: understand which documents contain sensitive data, and ensure that sensitive data is either excluded from the retrieval index or handled through a more restricted access path.

Prompt injection risks. AI systems that accept user-provided input as part of their context are vulnerable to prompt injection attempts by malicious users to override the system’s instructions by embedding adversarial instructions in their inputs. This is a real attack vector for customer-facing AI systems and deserves explicit treatment in the prompt design and evaluation process. Evaluate your AI systems against prompt injection attempts before production deployment, and build monitoring for unusual output patterns that might indicate a successful injection attack.

Model output logging. The logging of AI system inputs and outputs which is necessary for evaluation and debugging creates a data retention consideration. Logged model outputs may include sensitive information that was in the context window during generation. Establish data retention policies for AI system logs that are consistent with your broader data retention policies and with your obligations to customers. Specifically address how long logs are retained, who has access to them, and what processes exist for deleting logs for specific customers upon request.

These security and privacy considerations are not afterthoughts they are requirements that should be assessed during stack selection, before production deployment, and periodically as the system evolves. The organizations that handle them well establish a clear AI security posture early and update it as the stack grows. The organizations that handle them poorly discover the gaps in compliance reviews, customer audits, or worst case incidents.


The Build vs. Buy Decision Framework

For each component of the AI stack, the build-versus-buy decision requires weighing three factors: differentiation value, operational cost, and switching cost.

Differentiation value asks whether building this component in-house produces a competitive advantage that a commercial product cannot replicate. For most AI stack components vector databases, orchestration frameworks, observability tooling the answer is no. A custom-built vector database is unlikely to outperform a well-resourced commercial product on query performance, and the engineering investment required to build and maintain it is substantial. By contrast, the prompt logic and retrieval configuration that shapes how your AI system responds to your customers’ specific questions is genuinely differentiated it encodes your domain knowledge and your quality standards in ways that a generic component cannot replicate.

Operational cost asks what it costs to maintain and operate each component over time. Open-source components that are self-hosted typically have lower direct costs but higher operational overhead someone on your team is responsible for upgrades, security patches, capacity planning, and incident response. Managed commercial services have higher direct costs but lower operational overhead. For teams that are not large enough to staff a dedicated infrastructure team, the managed service premium is usually well worth paying.

Switching cost asks how difficult it would be to change this decision later. High switching-cost decisions choices that are difficult and expensive to reverse deserve more careful evaluation up front. Vector database choices are moderately high switching cost, because migrating a large document collection to a different database with different embedding models requires re-indexing and re-evaluation. Model choices are lower switching cost if the orchestration layer is designed to be model-agnostic. Prompt logic has very low switching cost if it is managed separately from the application code.

As a practical heuristic: buy the infrastructure layers (vector database, serving infrastructure, observability tooling), use open frameworks with light customization for the orchestration layer, and build the logic layers (prompts, retrieval configuration, evaluation criteria, domain-specific processing) in-house. This heuristic concentrates engineering investment where it produces differentiated value and uses commercial products where commodity solutions are available.


Common Stack Mistakes

Several stack mistakes appear consistently across AI implementations and deserve explicit warning.

Over-engineering the initial stack. The enthusiasm of a team building its first AI system often produces a stack designed for scale that the team will not reach for two years. A multi-region, highly available, auto-scaling AI serving infrastructure is impressive engineering. It is not what most companies need for their first three production AI systems. The cost is not just the initial build it is the ongoing maintenance overhead that constrains the team’s ability to ship use cases. Start with the simplest stack that works for the first use case. Add sophistication when the need for it is demonstrated by real operational experience, not anticipated.

Under-investing in evaluation infrastructure. Almost every team that has run AI systems in production for more than six months wishes they had built evaluation infrastructure earlier. The typical trajectory is: build a system, deploy it, measure it with ad-hoc manual review, discover quality problems, try to fix them without a systematic way to know if the fix worked, and repeat. Building a systematic evaluation harness a representative test set, automated metrics, a regular sampling process for human review before the first deployment is one of the highest-leverage investments in the stack.

Choosing a vector database for the wrong reasons. Vector database selection is frequently driven by marketing exposure the database that received the most conference coverage, or the one a well-regarded engineer at another company mentioned in a blog post. The criteria that matter are retrieval quality on your specific data, the richness of metadata filtering, and the operational characteristics at your scale. Evaluate with your data, not with benchmark data.

Ignoring model versioning and stability. Foundation model providers periodically update their models, and these updates can change system behavior in ways that are not backward compatible. A production AI system that was tuned against one version of a model may behave differently after a model update not always better, and sometimes significantly worse on specific cases the team had previously addressed. Building in the ability to pin specific model versions, and maintaining an evaluation suite that can detect behavioral changes after a model update, is essential operational hygiene.


Nexus in Focus: Thomas’s Stack Selection

When Thomas began the stack evaluation for Nexus’s first production AI system, he approached it with the discipline Marcus had asked for: no decisions based on what was trending, only decisions based on what fit Nexus’s specific context.

For the foundation model, Thomas ran a structured evaluation using 200 real support tickets sampled from the previous year, representing the full range of categories and complexity levels. He tested three models one frontier model, one mid-tier model, and one open-weight model deployed on Azure’s managed inference service. The frontier model produced the best classification accuracy on complex tickets but was three times the cost of the mid-tier model. The mid-tier model, after prompt tuning, produced accuracy within 4% of the frontier model at one-third the cost. The open-weight model required infrastructure management that Thomas judged was not worth the additional overhead at Nexus’s current stage. The mid-tier model was the clear choice: meaningfully cheaper, operationally simpler, and good enough for the task.

For vector database and retrieval, Thomas selected a managed cloud provider with strong metadata filtering capabilities essential for the knowledge assistant use case, where queries needed to be restricted to documents relevant to the specific product version the customer was running. He ruled out two alternatives: one that offered better raw performance but lacked the metadata filtering depth Nexus needed, and one that was significantly cheaper but had an observability API that made debugging retrieval quality problems difficult.

The stack choice Thomas was most deliberate about was what not to build. Nexus had no dedicated infrastructure team, and Thomas was the only engineer who would be responsible for the AI systems in the near term. He chose managed services for every infrastructure layer vector database, serving infrastructure, observability tooling and reserved custom engineering for the prompts, retrieval configuration, and evaluation logic where Nexus’s domain knowledge was genuinely differentiated. The total infrastructure spend was approximately $800 per month, within the Phase 1 budget, with predictable scaling behavior as usage grew.

Six months after the first deployment, Thomas presented the stack architecture to Marcus with one significant update: the evaluation infrastructure he had initially planned to build “later” had been built in week three, after a prompt change in week two had caused a quality regression that took four days to diagnose without proper measurement tooling. The lesson was unambiguous: evaluation infrastructure first, everything else second.

Thomas also documented two decisions he had reconsidered since the initial selection. The orchestration framework he had chosen for its feature richness had turned out to be more complex than the use cases required he was using approximately 20% of its capabilities and spending disproportionate time understanding its abstractions when debugging. His recommendation for the second use case was to start with lighter-weight orchestration code and only introduce the framework when the complexity genuinely warranted it. The second reconsidered decision was the retrieval chunking strategy the way documents were split before embedding. Thomas had used a simple fixed-size chunking approach in the first deployment, which worked adequately but produced retrieval failures on documents where the relevant information spanned a chunk boundary. For the knowledge assistant use case, he planned to evaluate semantic chunking splitting documents at natural semantic boundaries rather than fixed character counts which preliminary testing suggested would reduce boundary-crossing retrieval failures by a meaningful margin.

These second-order learnings the things that only become visible after a system has been running in production for months are precisely what the roadmap’s sequential design is built to capture. The stack choices that seemed optimal in planning looked different after the first production experience, and the ability to incorporate those learnings into the second and third systems without starting from scratch is what the shared foundational architecture is designed to enable.


If You’re Buying, Not Building

For organizations that procure AI tools rather than building them, the relevant version of the stack evaluation is a vendor due diligence framework.

The five stack layers map directly to the questions you should ask every AI vendor: What foundation model(s) does the product use, and can you understand or influence the model selection? What orchestration approach is used, and how does it handle edge cases and failures? How is retrieval or context managed, and can you bring your own data? What are the deployment and integration requirements on your side? And most importantly what observability does the vendor provide, and what can you monitor about how the AI is making decisions within their product?

The observability question is the one most vendors are least prepared to answer well. A vendor that cannot tell you how their AI system is making decisions, what its failure modes are, and how quality is monitored in production is a vendor that has not invested in the operational discipline that production AI systems require. The quality of a vendor’s observability is a reliable signal of the quality of their overall AI engineering.

For data security, ask specifically: where is your data sent when the AI processes it? Is it used to train or fine-tune the model? What are the data retention policies? These questions have significant implications for customer data processing obligations and for the intellectual property protection of your proprietary information.


Key Takeaways

  • AI stack evaluation is a strategic exercise, not just a technical one. The best stack is the one that fits your team’s capability, your operational constraints, and your use case trajectory not the one with the best benchmark scores.
  • The five layers of an AI stack foundation models, orchestration, retrieval infrastructure, deployment/serving, and observability each require distinct evaluation criteria and interact with each other in ways that make component-level decisions interdependent.
  • Model selection matters less than most teams expect because the quality difference between top-tier models is smaller than the quality difference between good and poor prompt engineering. Evaluate empirically on your specific task and data, not on general benchmarks.
  • RAG is foundational to most B2B SaaS AI use cases. Retrieval quality not model quality is the most common source of poor RAG system performance. Build a retrieval evaluation dataset before beginning implementation.
  • Prompt engineering is application logic. Treat it with the same rigor as code: version control, testing, staged deployment. The infrastructure to manage prompts properly is worth building before it is urgently needed.
  • Observability infrastructure for AI systems must include quality metrics, not just operational metrics. The team that cannot systematically measure whether their AI system is producing good outputs cannot improve it systematically.
  • As a build-versus-buy heuristic: buy the infrastructure layers, use frameworks with light customization for orchestration, build the logic layers. Concentrate engineering investment where domain knowledge creates differentiated value.
  • Security and data privacy are integral to stack selection, not afterthoughts. Verify data processing agreements, assess sensitive data in retrieval pipelines, evaluate prompt injection risks, and establish log retention policies before production deployment. The organizations that handle these requirements well do so from the beginning, not in response to a compliance incident.
  • The best stack for your first production AI system is the one your team can operate confidently and debug quickly not the most technically sophisticated one available. Every stack decision made for scale that is not yet needed creates maintenance burden that slows use case delivery. Start simple, add sophistication when production experience demonstrates the need for it.

Action Items

  1. Map your first two planned use cases to the five-layer stack framework. For each layer, identify whether you will use a commercial product, an open-source framework, or a custom build. Document the primary reason for each choice and the switching cost if the choice turns out to be wrong.
  2. Design an empirical model evaluation for your first use case. Assemble 100 to 200 representative inputs from your actual data, define the quality criteria for a good output, and test at least two models against those inputs before making a model selection decision. Document the results.
  3. Plan your retrieval evaluation dataset. Before implementing any RAG system, define 50 to 100 representative queries with documented correct answers. This dataset will be your primary tool for measuring and improving retrieval quality throughout development.
  4. Design the prompt management infrastructure for your first AI system. At minimum, define where prompts will be stored, how changes will be reviewed before deployment, and how you will know if a prompt change degrades quality. Implement this before the first production deployment.
  5. Define the observability requirements for your first production AI system before implementation begins. What quality metrics will you track? What does a quality incident look like, and how will you know it is happening? Who is responsible for reviewing quality samples, and how often?
  6. Conduct a security and data privacy review before any production AI deployment. For each AI use case, document: what data is sent to the model provider, whether your customer data processing agreements permit this, whether sensitive data could appear in the retrieval context, and what your log retention policy is. Address any gaps before launch, not after.
  7. After the first production AI system has been running for 90 days, schedule a stack retrospective. Ask: which stack choices made the system easier to build and operate than expected? Which made it harder? What would you choose differently for the second system? Document the answers this retrospective is the primary mechanism by which your stack strategy improves over time.