3.1 Introduction
The typical path of developing an LLM system starts with some simple experiments. The gap between an experiment and a production pipeline is so large that it may take a separate team just to serve your solution.
An experiment in a notebook: the code is run manually cell by cell, results are checked visually, the environment is the researcher's local machine, and data is saved wherever convenient.
A production pipeline: the order of execution is defined, the system runs automatically on a schedule or trigger, results are validated programmatically, execution happens in managed infrastructure, and logs and artifacts are stored in a centralized repository.
Moving between these two states requires formalization: what the input is, what the output is, which steps run and in what order, and how the correctness of the results is verified. This formalization is what pipeline orchestration is.
A pipeline is a directed acyclic graph (DAG) of steps. Each step receives input data, performs processing, and produces output artifacts. Dependencies between steps determine the order of execution. The orchestrator makes sure that a step starts only after all of its dependencies have finished successfully. Here is a simple example:
Loading, preprocessing, chunking, creating embeddings, indexing, validation: each step runs after all of its dependencies have completed.
LLMOps as a Specialization of MLOps
LLMOps applies MLOps practices to systems built on language models. The general principles (versioning, reproducibility, monitoring) remain relevant, but specific aspects appear.
Prompts need versioning just like code and data. A change to a prompt can significantly change the behavior of the system. A small change in wording can lead to a drop in quality. You need to be able to track which prompt was used for each run.
Quality evaluation is harder than for traditional ML models. Metrics such as accuracy or F1 work well for classification, but generative tasks require specific approaches: human evaluation, using models to evaluate other models (LLM-as-a-judge), and specialized metrics.
Dependence on external services creates additional points of failure. The provider's API may be unavailable, limits may be exceeded, and the model may be updated by the provider without notice. Error-handling strategies and fallback options are needed.
The cost of execution becomes significant. Every API call has a price. Cost optimization becomes part of the engineering process, no less important than quality optimization.
Criteria of Engineering Quality
When building LLM systems, you need to follow a set of criteria that define the quality of the workflow.
Reproducibility means that a run with the same input data and parameters produces the same result. For non-deterministic components (for example, with temperature > 0) this is achieved by fixing the seed or saving intermediate results.
Observability is the ability to reconstruct the course of execution: which steps were performed, how long they took, which artifacts were created. Logs and metrics must be detailed enough for diagnostics.
Idempotence means that repeating a step with the same inputs leads to the same result without side effects. This is critical for retry mechanisms and manual restarts.
Modularity implies reusable components. For example, a step that loads a PDF should not depend on how exactly this data will be used later.
Testability is the ability to check each component in isolation. Unit tests are used for this, as well as integration tests for the whole pipeline.