Skip to content

3.4 Summary and Conclusions

Versioning

Figure 37. Three types of artifacts that require versioning.

Figure 37. Three types of artifacts that require versioning.

In LLM systems it is impossible to limit oneself to the model and the code around it — here a whole set of artifacts appears, each of which affects the behavior of the system and requires separate control (Fig. 37). Versioning is the first concern. Unlike classic ML pipelines, where the main attention is focused on data and the model, in LLM scenarios prompts, configurations, and knowledge sources begin to play a critical role.

Prompts are the most volatile part of the system. Even a small change in wording can significantly affect the result. Therefore they should not be left "hard-coded" in the code: they are moved to separate files, placed under version control, and it is mandatory to record which exact version was used in each run. This makes it possible to explain the system's behavior and return to previous results without guesswork.

Data is no less important. In RAG systems it is precisely the data that determines what the model "knows" at a given moment. Updating the knowledge base directly affects the quality of answers, and without versioning it becomes impossible to understand why the system has started answering differently. Practice shows that using versioned namespaces in vector databases is one of the most convenient ways to manage this process and to ensure the ability to roll back.

The third key element is the configuration of the pipeline. Chunking parameters, the choice of model, validation thresholds, and other settings must be stored together with the results of the run. Only then can one speak of reproducibility: the ability to repeat exactly any previous run and get the same result under the same conditions.

Observability in Production

Figure 38. Three dimensions of LLM system observability.

Figure 38. Three dimensions of LLM system observability.

However, versioning alone is not enough. When the system goes into production, observability comes to the fore (Fig. 38). It makes it possible not just to record facts, but to understand what is happening inside the system in real time. Several levels must be considered at once here. Technical metrics reflect the "health" of the system — latency, errors, token consumption, cost. Quality metrics show whether the system is solving its task: how valid the answers are, how users evaluate them, how automatic checks behave. Finally, request tracing makes it possible to follow the path of a specific request through all components and see intermediate results, which is critical for diagnosing problems.

Multi-Level Testing

Figure 39. The testing pyramid for LLM systems.

Figure 39. The testing pyramid for LLM systems.

Testing LLM systems requires a combined approach.

Unit tests check deterministic components: parsers, validators, formatters. They should be fast and run on every commit.

Integration tests check the interaction between components. They can use both mocks of LLM calls and real calls with pre-recorded inputs.

Regression tests on a golden set are needed to make sure that changes have not degraded quality on known examples. As shown in Fig. 39, such tests are closest to the real behavior of the system, but they run less often, since they require more time and resources.

Adapting to Change

Figure 40. Three sources of change and protection against them.

Figure 40. Three sources of change and protection against them.

LLM systems operate in an environment that is constantly changing. Data is updated, new versions of dependencies are released, and model providers change the behavior of their services. Resilience to such changes does not arise on its own — it requires deliberate design.

Data changes constantly. Documentation is updated, new sources appear, outdated materials are removed. Therefore the indexing pipeline must support incremental processing of changes without full reindexing. Versioning of indexes helps to roll back in case of problems.

Dependencies get updated. A new version of LangChain or another library may change the API or the behavior of components. Pinning versions in requirements.txt and regular testing during updates protect the system from unexpected failures.

Model providers also change, sometimes without explicit notice. A model that worked one way a month ago may behave differently today. As shown in Fig. 40, regression tests make it possible to notice such changes in time. For critically important scenarios it is worth considering self-hosted models or pinning versions through the provider's API, if that option is available.

Conclusion

Figure 41. From a simple prompt to a production system.

Figure 41. From a simple prompt to a production system.

Models are becoming more powerful, and new tools and frameworks keep appearing. But the fundamental principles (versioning, testing, observability, modularity) remain stable (Fig. 40). They apply to any system, regardless of the specific tools.

These three chapters have provided the tools and practices for building LLM systems that not only work, but also can be maintained, developed, and scaled.