Quick Start
Create your first custom pipeline in under 5 minutes.
⚠️ Disclaimer: This guide is specifically for adding new custom pipelines within the GLChat. The instructions and examples provided here are tailored to GLChat's architecture and infrastructure. They are not intended for use in other projects or standalone applications.
Prerequisites
Before creating your custom pipeline, ensure you have completed the following setup:
1. Setup GLChat Backend
Follow the setup instructions in the GLChat Backend README to:
Install dependencies
Configure environment variables
Set up the database
Start the required services
2. Get OpenAI API Key
Sign up or log in to OpenAI Platform
Navigate to API Keys
Create a new API key
Add the API key to your
.envfile:
OPENAI_API_KEY=your-api-key-hereNote: Replace your-api-key-here with your actual OpenAI API key. Keep your API key secure and never commit it to version control.
Step 1: Generate Pipeline Files
Use the automated CLI tool to create your pipeline structure:
make new-pipelineOr directly:
uv run python scripts/create_pipeline.pyThe script will prompt you for:
Pipeline Name: Lowercase, alphanumeric with underscores (e.g.,
my_custom_pipeline)Description: Brief description of the pipeline's purpose
Author Name: Your full name
Author Email: Your email (should be @gdplabs.id)
Naming Convention:
Folder Name: Use
snake_case(e.g.,my_custom_pipeline)Pipeline ID: System converts to
kebab-case(folder:my_custom_pipeline→ ID:my-custom-pipeline)
The CLI tool automatically:
Creates the pipeline folder:
glchat_be/config/pipeline/<pipeline_name>/Generates
__init__.pyandpipeline.pywith proper stubs and docstringsCreates a migration file with auto-detected
down_revisionProvides next steps guidance
Step 2: Run Migration
Apply the database migration to register your pipeline:
This registers your pipeline in the database, making it available in the Admin Dashboard.
That's it! Your pipeline is now ready to use. The CLI tool generates a complete, working LLM pipeline that you can use immediately.
What does the generated pipeline look like?
The CLI tool generates a complete pipeline.py file with two main functions:
The build() Function - Constructs the pipeline using GL SDK components:
The build_initial_state() Function - Prepares the initial context/state that flows through the pipeline.
This is a simple LLM-only pipeline that's ready to use out-of-the-box. For building more complex RAG pipelines with retrievers, rerankers, and other components, refer to the official GL SDK guide.
Next Steps
Your pipeline is ready to use! Here are some optional next steps:
Customize your pipeline (optional) - The generated pipeline is a simple LLM-only pipeline. To add retrieval, reranking, or other advanced features, modify
glchat_be/config/pipeline/<pipeline_name>/pipeline.py. See the official GL SDK guide for examples.Customize the migration (optional) - If you need organization-specific settings or other customizations, modify the generated migration file. See Database Migration Guide
Add advanced configuration (optional) - Configure custom settings, parameters, and more. See Advanced Configuration Guide
Last updated