Modular agentic pipeline system for document and data workflows
Project description
Trellis
Modular agentic pipeline system for document and data workflows.
Trellis lets you define multi-step AI pipelines as declarative YAML — ingest PDFs, fetch SEC filings, call LLMs, extract structured fields, fan out over lists — and run them from the CLI, a REST API, or directly from Python.
Documentation · Installation · Pipeline DSL Reference · Examples
Install
pip install trellis-pipelines
With uv:
uv add trellis-pipelines
Requires Python 3.12+. Set at least one LLM provider key before running pipelines:
export ANTHROPIC_API_KEY=sk-ant-... # or OPENAI_API_KEY, etc.
Quickstart
CLI
# Validate a pipeline file
trellis validate examples/pipelines/pdf_summarize.yaml
# Run a pipeline
trellis run examples/pipelines/pdf_summarize.yaml
# Pass runtime parameters
trellis run examples/pipelines/fetch_10k_parametrized.yaml \
--params '{"ticker": "AAPL", "year": "2024"}'
# Override the LLM model for all tasks
trellis run examples/pipelines/pdf_summarize.yaml --model anthropic/claude-haiku-4-5
A pipeline file
pipeline:
id: pdf_summarize
goal: "Load a PDF and summarize key points"
tasks:
- id: ingest_pdf
tool: ingest_document
inputs:
path: "https://example.com/report.pdf"
- id: extract_content
tool: extract_from_texts
inputs:
document: "{{ingest_pdf.output}}"
prompt: "Extract the main topics and key metrics"
- id: summarize
tool: llm_job
inputs:
prompt: |
Summarize in 5 bullet points for a busy executive:
{{extract_content.output}}
max_tokens: 256
Dependencies are inferred from {{task_id.output}} references — no explicit wiring needed.
Python
import asyncio
from trellis.models.pipeline import PipelineSpec
from trellis.execution.orchestrator import Orchestrator
spec = PipelineSpec.from_yaml("examples/pipelines/pdf_summarize.yaml")
orchestrator = Orchestrator()
result = asyncio.run(orchestrator.run_pipeline(spec))
print(result.outputs)
REST API
# Start the server (requires trellis-pipelines[api])
pip install "trellis-pipelines[api]"
uvicorn trellis_api.main:app --reload
curl -X POST http://localhost:8000/pipelines/run \
-H "Content-Type: application/json" \
-d '{
"pipeline": {
"id": "hello",
"goal": "Say hello",
"tasks": [
{
"id": "greet",
"tool": "llm_job",
"inputs": { "prompt": "Say hello in one sentence." }
}
]
}
}'
Key features
- Declarative YAML DSL — flat task list, dependencies inferred from template references
- Template resolution —
{{task_id.output}},{{params.key}},{{session.key}},{{item}}(fan-out) - Fan-out / parallel_over — scatter a task over a list, collect results automatically
awaitbarriers — explicit synchronization across parallel branches- Retry & backoff — per-task
retrywith exponential backoff and jitter - Structured extraction —
extract_fieldswith JSON Schema,extract_from_textsfor free-form - PDF + web ingestion —
ingest_document(PDF/HTML),fetch_url,search_web - Multi-tenancy — tenant-scoped blackboard (
store/{{session.key}}) for stateful workflows - CLI, REST API, and Python SDK — three interfaces, one engine
Project structure
trellis/ # Core: models, execution engine, tool registry
trellis_api/ # FastAPI REST server (optional extra: [api])
trellis_cli/ # Typer CLI
trellis_mcp/ # MCP server adapter (roadmap)
examples/ # Example pipelines and data
docs/ # MkDocs source
tests/ # Test suite
Optional extras
| Extra | What it adds |
|---|---|
trellis-pipelines[api] |
FastAPI + uvicorn REST server |
trellis-pipelines[dev] |
pytest, ruff, mypy, black, isort |
trellis-pipelines[all] |
All extras |
Documentation
License
MIT — see LICENSE or https://opensource.org/license/mit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trellis_pipelines-0.2.0.tar.gz.
File metadata
- Download URL: trellis_pipelines-0.2.0.tar.gz
- Upload date:
- Size: 109.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48f9191eb663aa40ea405fd7e6da89b90582d191672a8c303a2925a5918d3ab0
|
|
| MD5 |
e2b210664346e60b2b1bd2010590aef9
|
|
| BLAKE2b-256 |
1fe0af67ccad73f9583236b49f204ba5286046e2ee7f7aea6541d4031a67dae7
|
File details
Details for the file trellis_pipelines-0.2.0-py3-none-any.whl.
File metadata
- Download URL: trellis_pipelines-0.2.0-py3-none-any.whl
- Upload date:
- Size: 128.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d294c25e4fae6a550d64a2a0796e89b234fdaed0b9aadeb8406bcda860442b97
|
|
| MD5 |
430bf09cfd0d5829f100208bb8ee96fe
|
|
| BLAKE2b-256 |
f3eb938c9b294afafc18c9a3a64935fdc41d2120abacd0d87e2e9ad7d32aee35
|