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
What it demonstrates
- Minimal Pipelex setup with a single
PipeLLMpipe - The
main_pipefield 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
-
Clone the cookbook repository and install dependencies:
git clone https://github.com/Pipelex/pipelex-cookbook.git cd pipelex-cookbook pip install . -
Set up your environment variables by copying
.env.exampleto.envand adding your API keys. -
Run the example:
pipelex run bundle examples/a_quick_start/hello_world.mthds
Expected output: A haiku about "Hello World" displayed with pretty formatting.
Related Documentation
- PipeLLM Operator - The core operator for LLM interactions
- Define Your Concepts - How to define custom data types for your methods