Skip to main content
Redhat Developers  Logo
  • AI

    Get started with AI

    • Red Hat AI
      Accelerate the development and deployment of enterprise AI solutions.
    • AI learning hub
      Explore learning materials and tools, organized by task.
    • AI interactive demos
      Click through scenarios with Red Hat AI, including training LLMs and more.
    • AI/ML learning paths
      Expand your OpenShift AI knowledge using these learning resources.
    • AI quickstarts
      Focused AI use cases designed for fast deployment on Red Hat AI platforms.
    • No-cost AI training
      Foundational Red Hat AI training.

    Featured resources

    • OpenShift AI learning
    • Open source AI for developers
    • AI product application development
    • Open source-powered AI/ML for hybrid cloud
    • AI and Node.js cheat sheet

    Red Hat AI Factory with NVIDIA

    • Red Hat AI Factory with NVIDIA is a co-engineered, enterprise-grade AI solution for building, deploying, and managing AI at scale across hybrid cloud environments.
    • Explore the solution
  • Learn

    Self-guided

    • Documentation
      Find answers, get step-by-step guidance, and learn how to use Red Hat products.
    • Learning paths
      Explore curated walkthroughs for common development tasks.
    • Guided learning
      Receive custom learning paths powered by our AI assistant.
    • See all learning

    Hands-on

    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.
    • Interactive labs
      Learn by doing in these hands-on, browser-based experiences.
    • Interactive demos
      Click through product features in these guided tours.

    Browse by topic

    • AI/ML
    • Automation
    • Java
    • Kubernetes
    • Linux
    • See all topics

    Training & certifications

    • Courses and exams
    • Certifications
    • Skills assessments
    • Red Hat Academy
    • Learning subscription
    • Explore training
  • Build

    Get started

    • Red Hat build of Podman Desktop
      A downloadable, local development hub to experiment with our products and builds.
    • Developer Sandbox
      Spin up Red Hat's products and technologies without setup or configuration.

    Download products

    • Access product downloads to start building and testing right away.
    • Red Hat Enterprise Linux
    • Red Hat AI
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat Developer Toolset

    References

    • E-books
    • Documentation
    • Cheat sheets
    • Architecture center
  • Community

    Get involved

    • Events
    • Live AI events
    • Red Hat Summit
    • Red Hat Accelerators
    • Community discussions

    Follow along

    • Articles & blogs
    • Developer newsletter
    • Videos
    • Github

    Get help

    • Customer service
    • Customer support
    • Regional contacts
    • Find a partner

    Join the Red Hat Developer program

    • Download Red Hat products and project builds, access support documentation, learning content, and more.
    • Explore the benefits

Orchestrate production RAG with OpenShift AI

Orchestrate a RAG pipeline with AI Pipelines, Ray Data, and Docling on OpenShift AI

September 1, 2026
Ana Biazetti Saad Zaher
Related topics:
Artificial intelligenceAI inferenceData science
Related products:
Red Hat OpenShift AI

    In the previous post in this series, we built a streaming retrieval-augmented generation (RAG) pipeline that parses, chunks, embeds, and writes to Milvus in a single Ray Data script. It works well. But it is a monolithic script. When parsing fails at file 847 of 1,000, you rerun everything from scratch. When someone asks what parameters produced last Tuesday's vector collection, you search through logs using grep. When you want to swap the embedding model, you edit the same file that owns the parser, the chunker, and the Milvus writer.

    If you are an MLOps engineer or AI practitioner looking to move from experimental scripts to production RAG orchestration, this guide demonstrates how to deploy modular, maintainable workflows on OpenShift AI.

    This is the 4th post in our series on scaling RAG document processing. The 1st post made the business case for distributed processing. The 2nd post showed how to scale Docling parsing on Red Hat OpenShift AI. The 3rd post unified parsing, embedding, and vector storage into a single streaming job.

    This post wraps the same Ray Data and Docling processing in AI pipelines, giving you reproducible parameterized runs with full history, S3-compatible intermediate storage that enables independent component retries, and 5 reusable components you can swap, schedule, or extend individually. The previous post covers the engine; this post adds the production automation layer.

    What the RAG pipeline does

    The pipeline takes a collection of PDF documents and produces a queryable RAG system with a deployed large language model (LLM). It handles every step: parsing PDFs into structured content, splitting that content into chunks that respect document structure, generating vector embeddings, storing those embeddings in Milvus, and deploying both an embedding model and an LLM for inference.

    To move from raw PDFs to a queryable production system, the pipeline combines specialized open source tools within a unified architecture: Docling for structure-aware parsing and chunking, Ray via KubeRay for distributed compute, Milvus for vector storage, MinIO for S3-compatible intermediate storage, and vLLM via KServe for LLM and embedding model serving (using Mistral-7B-Instruct-v0.3 as the default LLM). All orchestrated through Kubeflow Pipelines (KFP) via AI pipelines on OpenShift AI.

    Red Hat OpenShift AI is what ties these components into a managed platform rather than a collection of tools you wire together yourself. It handles Ray cluster lifecycle through KubeRay, GPU scheduling and fair sharing through Kueue, model serving with autoscaling through KServe, and self-service pipeline orchestration through AI pipelines—so you focus on the RAG logic, not the infrastructure. For a deeper look at the full technology stack, see the previous post in this series.

    Data chain processes PDFs through S3 to Milvus, parallel model chain deploys an LLM, and both connect to RAG inference endpoints.
    Figure 1: Architecture diagram showing the 5 components, 2 parallel chains, and S3-compatible intermediate storage.

    Why orchestrate your RAG pipeline with AI pipelines

    The streaming pipeline in the previous post is a valid approach for many workloads. But as your RAG system moves toward production, you need capabilities that a single script cannot provide on its own.

    Reproducibility and run history

    Every pipeline run in AI pipelines records its parameters, timestamps, logs, and status. When a colleague asks what embedding model and chunk size produced the collection running in production, you open the OpenShift AI dashboard and read it directly from the run record. You do not reconstruct it from shell history or environment variables. You can also schedule recurring runs to reingest documents on a weekly cadence, or trigger a run automatically when new documents land in your source bucket.

    S3 intermediate storage enables independent retries

    We designed this pipeline to write parsed and chunked output as JSONL files to S3 between the parsing and ingestion stages. This is a design choice we made for this pipeline, not a built-in platform feature. The benefit is concrete: if the Milvus ingestion step fails after parsing 1,000 documents, the parsed chunks are already sitting in S3. You fix the Milvus connection and rerun only the ingestion component. KFP supports component-level re-execution, and because the intermediate data lives in S3, the rerun picks up right where the failure occurred without repeating hours of document processing.

    Parallel execution chains

    The pipeline runs 2 independent chains concurrently. The data chain handles parsing, embedding, and ingestion. The model chain downloads and deploys the LLM. These chains have no dependency on each other until query time, so running them in parallel cuts total pipeline execution time significantly. A model download that takes 15 minutes happens at the same time as document parsing that takes 20 minutes, rather than running sequentially for 35 minutes total.

    Reusable components

    Each of the 5 components is a self-contained KFP component with its own container image, parameters, and interface. You can reuse the model deployment component in a completely different pipeline. You can replace the parsing component with one that handles a different document format. The components are building blocks, not a monolith.

    The 5 RAG pipeline components

    parse_and_chunk

    The parse_and_chunk stage submits a RayJob that distributes Docling processing across Ray workers using map_batches with ActorPoolStrategy. Each actor runs Docling's DocumentConverter in a separate subprocess for crash isolation, so a malformed PDF that causes a segfault does not take down the entire Ray worker. The component uses Docling's HybridChunker, which respects document structure when determining chunk boundaries rather than splitting at arbitrary character counts. Output is written as JSONL files to S3, where each line contains the chunk text, source document metadata, and positional information.

    ingest_to_milvus

    To handle vector indexing, ingest_to_milvus reads the JSONL chunks from S3, generates vector embeddings, and inserts them into Milvus with an IVF_FLAT index configured for COSINE similarity. It supports 2 embedding modes. For collections up to roughly 10,000 chunks, local CPU embedding with the granite-embedding-125m-english model (approximately 500 MB) requires no GPU resources and adds no additional infrastructure. For larger collections exceeding 100,000 chunks, offloading embedding generation to a vLLM service on a dedicated GPU node increases throughput up to 10 times compared to standard CPU workers.

    deploy_embedding_model

    When enabled, the optional deploy_embedding_model component deploys a text embedding model as a KServe InferenceService using vLLM with the --task embedding flag. It only runs when the pipeline parameter deploy_embedding is set to True. For smaller workloads where local CPU embedding is sufficient, you skip this component entirely and save the GPU resources for model serving. This conditional execution is one of the benefits of the component-based design: the pipeline adapts to your scale without code changes.

    download_model

    The download_model stage pulls a Hugging Face model to a persistent volume claim (PVC) with sentinel file caching. The first download of a model like Mistral-7B pulls approximately 14 GB of weights, which takes 10 to 20 minutes. On subsequent runs, the sentinel file signals that the model is already present, and the component completes in seconds. This avoids redownloading the model every time a pod restarts or a new pipeline run begins.

    model_deployment

    Finally, model_deployment provisions the LLM as a KServe InferenceService running vLLM. It follows OpenShift AI dashboard conventions for resource naming and labeling, and integrates with HardwareProfile for GPU allocation. The deployment uses RawDeployment mode, which gives you direct control over the serving configuration without the additional abstraction layers of serverless mode.

    Multi-step RAG pipeline architecture

    The multi-step pipeline, separates the data processing into 3 sequential components (parse_and_chunk, optionally deploy_embedding_model, then ingest_to_milvus) and runs 2 model components (download_model, then model_deployment) in parallel. You can inspect the complete component definition in the OpenDataHub GitHub repository. This production-oriented variant gives you independent component retries, clearer failure isolation, and the ability to rerun only the stages that need updating.

    Running the RAG pipeline

    Prerequisites

    You need:

    • An OpenShift AI cluster with AI pipelines enabled
    • KubeRay operator installed
    • Milvus and S3-compatible storage deployed
    • A Hugging Face token with access to the LLM you plan to deploy
    • GPU nodes for model serving
    • A workbench with the pipeline SDK installed

    Getting started

    The example repository includes a guided notebook, rag_pipeline_build.ipynb, that walks you through configuring parameters, compiling the pipeline, and submitting it to AI pipelines. The notebook handles S3 credentials, Milvus connection details, model selection, and worker scaling configuration. You can choose between the single-step and multi-step variants depending on whether you are in development or production mode.

    Once the pipeline completes, the repository includes 2 options for querying the deployed RAG system. The rag_query_test.ipynb notebook lets you validate the end-to-end system by submitting queries directly against the deployed LLM with Milvus-backed retrieval, giving you full control over retrieval parameters like top-k and similarity thresholds.

    For a more integrated approach, the rag_ogx_streaming.ipynb notebook demonstrates querying through the OpenGenAI Stack (OGX) Responses API, which is included with Red Hat OpenShift AI. A single API call with the file_search tool handles the entire retrieval-augmented generation flow—vector search, context retrieval, grounded generation, and streaming—with built-in source attribution. This collapses the manual embed-search-prompt-generate loop into 1 request.

    How this fits the series

    This series has progressively built up the production RAG architecture. The 1st post explained why distributed processing matters. The 2nd post focused on scaling Docling parsing alone. The 3rd unified parsing, embedding, and ingestion into a single streaming pipeline. This post adds the orchestration layer that makes the whole system reproducible, observable, and maintainable in production. Each post builds on the one before it, and each addresses a different layer of the problem.

    Get started

    Clone the example repository and follow the guided notebook to deploy the full pipeline on your OpenShift AI cluster. Once you run through the notebook, you will have a reproducible, multi-step RAG pipeline processing your own documents on OpenShift AI. The README file walks you through every prerequisite and configuration step.

    Try running the pipeline with your own document sets or adapting the components to your existing storage layers. Have questions or custom components to share? Open an issue or start a discussion in the Red Hat AI examples repository.

    To learn more about the platform, explore the Red Hat OpenShift AI documentation and AI pipelines documentation.

    Series note

    Explore the full RAG scaling series:

    • Part 1: Breaking the RAG bottleneck: Scalable document processing with Ray Data and Docling
    • Part 2: Scale document ingestion with Docling and Ray on OpenShift AI
    • Part 3: Build a distributed RAG pipeline with Ray Data on OpenShift AI

     

    Related Posts

    • Build a distributed RAG pipeline with Ray Data on OpenShift AI

    • Scale document ingestion with Docling and Ray on OpenShift AI

    • Tame Ray workloads on OpenShift AI with KubeRay and Kueue

    • Batch inference on OpenShift AI with Ray Data, vLLM, and CodeFlare

    • Submit remote RayJobs to a Ray cluster with the CodeFlare SDK

    • How to fine-tune Llama 3.1 with Ray on OpenShift AI

    Recent Posts

    • LoRA backdoor threat: How OpenShift AI mitigates the risk

    • LLM quantization guide: How to do it, and how it helps

    • Kafka Monthly Digest: August 2026

    • Orchestrate production RAG with OpenShift AI

    • Developing LLM guardrail configs locally with NeMo Guardrails

    What’s up next?

    Learning Path intro-to-OS-LP-feature-image

    Introduction to OpenShift AI

    Learn how to use Red Hat OpenShift AI to quickly develop, train, and deploy...
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility
    Ask AI