Skip to content

Example: Hello World

This is the "Hello World" of Pipelex, a simple pipeline that demonstrates the basic concepts of Pipelex.

It's the perfect starting point to verify your installation and get a first taste of how Pipelex works.

Get the code

GitHub

What it demonstrates

  • Minimal Pipelex setup with a single PipeLLM pipe
  • The main_pipe field to designate the entry point
  • Running a method bundle from the CLI

The Method: hello_world.mthds

The method definition is extremely simple — a single LLM call that generates a haiku:

domain    = "quick_start"
main_pipe = "hello_world"

[pipe]
[pipe.hello_world]
type = "PipeLLM"
description = "Write text about Hello World."
output = "Text"
prompt = """
Write a haiku about Hello World.
"""

How to run

  1. Clone the cookbook repository and install dependencies:

    git clone https://github.com/Pipelex/pipelex-cookbook.git
    cd pipelex-cookbook
    pip install .
    
  2. Set up your environment variables by copying .env.example to .env and adding your API keys.

  3. Run the example:

    pipelex run bundle examples/a_quick_start/hello_world.mthds
    

Expected output: A haiku about "Hello World" displayed with pretty formatting.