timeline-arrowCustom Pipeline Development Guide

This guide walks you through creating custom pipelines for GLChat Backend. Custom pipelines allow you to define your own AI processing workflows using GLChat's components and infrastructure.

Architecture Overview

GLChat pipelines are built on top of the GL SDK (GLLM SDK), which provides the core components and infrastructure for building AI pipelines. The relationship between GLChat and GL SDK can be visualized as follows:

Key Points:

  • GLChat pipelines define the workflow logic using GL SDK components

  • GL SDK provides the building blocks (synthesizers, retrievers, etc.) and execution framework

  • Your build() function orchestrates GL SDK components into a pipeline

  • Your build_initial_state() function prepares the data that flows through the pipeline

GLChat Pipeline vs GL SDK Pipeline

Understanding the relationship between GL SDK pipelines and GLChat pipelines is crucial for developing custom pipelines.

GL SDK Pipeline

GL SDK Pipeline is an SDK (Software Development Kit) that provides the framework and components for building AI pipelines. Key characteristics:

  • Standalone: Pipelines built with GL SDK can run independently anywhere outside of GLChat

  • Portable: Your pipeline code can be executed in any Python environment with the GL SDK installed

  • Reusable: The same pipeline can be used across different applications

For detailed information about GL SDK Pipeline concepts (Pipeline, Steps, State, Runtime Context), refer to the GL SDK Basic Concepts documentationarrow-up-right.

GLChat Pipeline

GLChat Pipeline is a GL SDK pipeline that has been adapted to work within the GLChat Backend infrastructure. To make a GL SDK pipeline usable in GLChat, you need to make small adjustments:

  1. Integration Functions: Implement build() function to construct the pipeline instance using GL SDK components, and build_initial_state() function to prepare the initial state dictionary from GLChat's request data

  2. State Mapping: Map GLChat's request data structure to the pipeline's expected state format in build_initial_state()

  3. Configuration: Adapt to GLChat's configuration system (preset config, runtime config) - see Advanced Configuration

  4. Database Registration: Register the pipeline in GLChat's database so it appears in the Admin Dashboard - see Database Migration

The Relationship

In essence: This documentation guides you on how to take a pipeline built with GL SDK and make it work within GLChat's ecosystem. The core pipeline logic remains the same—you're just adding the integration layer that connects it to GLChat's infrastructure.

To get started implementing these adjustments, see the Quick Start Guide which walks you through creating your first custom pipeline in under 5 minutes.

Last updated