Skip to content

Pipe Operators

MTHDS Standard Reference

Pipe operators are part of the MTHDS open standard. For the authoritative language specification, see Pipes & Operators on mthds.ai. This page documents Pipelex-specific behavior and usage.

Pipe operators are the fundamental building blocks in Pipelex, representing a single, focused task. They are the "verbs" of your pipeline that perform the actual work.

Each operator specializes in a specific kind of action, from interacting with Large Language Models to executing custom Python code. You combine these operators using Pipe Controllers to create complex methods.

Core Operators

Here are the primary pipe operators available in Pipelex:

  • PipeLLM: The core operator for all interactions with Large Language Models (LLMs), including text generation, structured data extraction, and vision tasks.
  • PipeStructure: Turns free-form text into structured, typed data via a single LLM call — ideal when the text comes from an upstream extraction, search, or generation step.
  • PipeExtract: Performs Optical Character Recognition (OCR) on images and PDF documents to extract text and embedded images, and fetches and extracts content from web pages.
  • PipeImgGen: Generates images from a text prompt using models like GPT Image, Flux, or other image generation models.
  • PipeSearch: Searches the web using a configurable search provider and returns structured results with an answer and source citations.
  • PipeJudge: Asks a judgment model a closed question about the evidence its prompt presents, and returns a YesNo, a Choice or a Rating verdict with the probabilities the model measured, or asks several in one request and fills a structure with their verdicts.
  • PipeFunc: An escape hatch that allows you to execute any custom Python function, giving you maximum flexibility.
  • PipeCompose: Composes outputs deterministically from working memory — renders Jinja2 templates for formatted reports or complex prompts, or constructs structured objects by mapping fields from inputs, without an LLM.
  • PipeDocGen: Generates a document file from its inputs, calling no AI model: a PDF laid out from a structure or formatted from a Markdown report, and with the Pipelex document generation plugin a PDF from an HTML template, an Excel workbook, a Word document or a PowerPoint deck.

Overview

Pipelex provides the following pipe operators:

  • PipeLLM: For LLM-based text generation and processing
  • PipeCompose: For composing text (Jinja2 templates) or structured objects (construct mode) from working memory data
  • PipeExtract: For optical character recognition and document processing
  • PipeFunc: For executing custom functions
  • PipeImgGen: For AI-powered image generation
  • PipeSearch: For web search with structured results
  • PipeJudge: For a closed question answered with a verdict and its probabilities
  • PipeStructure: For turning free-form text into structured data
  • PipeDocGen: For generating a document file, such as a PDF, from structured data

PipeLLM

Core operator for LLM-based text generation and processing.

Key Features

  • Text generation
  • Structured output generation
  • Multiple output modes
  • System prompt customization
  • LLM configuration

PipeCompose

Composes outputs deterministically from working memory, without an LLM.

Key Features

  • Template mode: Jinja2 rendering to Text or Html outputs
  • Construct mode: structured objects assembled by field mapping
  • Field methods: references, templates, fixed values, nested constructs
  • Native wrapper unwrapping when copying whole inputs into native fields

PipeExtract

Processes images and PDFs using Optical Character Recognition, and fetches and extracts content from web pages.

Key Features

  • PDF processing
  • Image processing
  • Text extraction
  • Image extraction
  • Page view generation

PipeFunc

Executes custom functions within the pipeline.

Key Features

  • Custom function execution
  • Working memory integration
  • Multiple output types
  • Function registry integration

PipeImgGen

Generates and manipulates images.

Key Features

  • Image generation
  • Quality control
  • Multiple output formats
  • Batch processing
  • Parameter customization

PipeDocGen

Generates a document file from its inputs, calling no AI model.

Key Features

  • A PDF laid out from the inputs' structure, with tables, sections and page numbers
  • Markdown reports formatted, from a Markdown input
  • A file name built from the inputs
  • With the Pipelex document generation plugin: PDFs from HTML templates, Excel, Word and PowerPoint

PipeSearch

Searches the web and returns structured results with sources.

Key Features

  • Web search via configurable providers
  • Structured results with answer and source citations
  • Dynamic prompt templates with $variable syntax
  • Standard and deep search models

PipeJudge

Asks a judgment model closed questions about the evidence its prompt presents.

Key Features

  • Yes/no, choice and rating questions, the kind read from the fields the pipe declares
  • Several questions in one request, their verdicts filling the fields of a structure named after them
  • Verdicts carrying the probabilities the model measured, and a threshold for a yes/no
  • The evidence written as a prompt template, rendered as a PipeLLM's prompt is, its images and documents sent as files to a model that reads them
  • Two-sided criteria for a yes/no, and rating levels that may carry labels, which the verdict reports