Build & Run AI Methods
A method is a reusable, typed AI procedure — declared in a .mthds file and executed by Pipelex. Each step is explicit, each output is structured, and every run is repeatable.
Claude Code MTHDS Tutorial Cookbook
Why Methods?
-
Declarative
Express business logic at a high level of abstraction, in human-readable
.mthdsfiles that work across models. -
Typed
Concepts are semantic types: AI understands what you mean, and every input and output connects with purpose.
-
Repeatable
Deterministic orchestration that leaves exactly the room you want for AI to express its intelligence and creativity.
-
Composable
Chain pipes into sequences, nest methods inside methods, and share them with the community.
What a Method Looks Like
A single pipe in MTHDS — five lines that call an LLM with typed inputs and output:
[pipe.summarize_article]
type = "PipeLLM"
inputs = { article = "Text", audience = "Text" }
output = "Text"
prompt = "Summarize $article in three bullet points for $audience."
From here, Pipelex handles model routing across 60+ models, structured output parsing, and pipeline orchestration.
Capabilities
-
Semantic types that give meaning to every input and output — native, inline, or backed by Python classes.
-
Six operators that do the work: LLM calls, document extraction, image generation, web search, composition, and custom functions.
-
Sequence, parallel, batch, and conditional controllers that wire pipes into full methods with shared working memory.
-
One gateway key or bring-your-own: OpenAI, Anthropic, Mistral, Google, Deepseek, Hugging Face, and more.
-
Validate pipelines before execution and dry-run with mocked responses — catch errors without spending tokens.
-
Full CLI for init, build, validate, run, and graph visualization. Plus
plxtfor formatting and linting.mthdsfiles.
The MTHDS Ecosystem
MTHDS is the open standard behind Pipelex methods. It defines the language, the file format, and the ecosystem for sharing methods.
Explore the ecosystem
Get Started
-
Describe what you want in natural language — Claude writes, runs, and iterates on your method for you.
-
Learn the declarative language step by step: concepts, pipes, sequences, inputs, and structured outputs.
-
Production-ready recipes — from Hello World to document extraction, synthetic data, and image generation.
