Python internal and external DSL for writing generative AI analytics
pip install talkpipe==1.3.0 Copy PIP instructions
Build and iterate on AI workflows efficiently.
TalkPipe is a Python toolkit for creating, testing, and deploying workflows that combine generative AI with your data and tools. Write pipelines in Python (the Pipe API, chaining steps with |) or in ChatterLang (a concise text DSL) — both use the same building blocks, with LLMs as one tool among many. Pipelines are streaming generators, so large datasets flow through without being loaded into memory, and a pipeline defined once can run from Python, Jupyter, Docker, chatterlang_script, or chatterlang_serve.
Who it's for: engineers and researchers who want scriptable AI pipelines — RAG, batch scoring, web ingestion, agents, and automation — without giving up normal Python when they need it. If your primary model is a large prebuilt agent platform or GUI-first orchestration, another tool may fit better (or layer one on top); TalkPipe stays close to code and scripts.
Typical vertical flow: ingest → chunk/embed → index (for example LanceDB) → retrieve → prompt → answer, then expose the same script with chatterlang_serve if you want an API. See Example 5: RAG pipeline for a full walkthrough.
This README is a high-level overview. Use the documentation map below or the documentation hub for depth.
No LLM, API key, or server needed (Python 3.11+):
pip install talkpipe chatterlang_script --script 'INPUT FROM echo[data="3,1,2"] | cast[cast_type="int"] | scale[multiplier=10] | print' 30 10 20 That one line is a complete pipeline written in ChatterLang: a source (echo, which starts the stream — here with three items) followed by segments (cast, scale, print), each of which transforms the items flowing past and hands them to the next through |. Every TalkPipe feature — LLM calls, document loading, vector search — is another source or segment you drop into the same chain. The Quick Start below runs the same kind of pipeline from Python and adds an LLM; Getting started is the step-by-step version.
Three layers; use any mix of them in one project:
Entry points for different usage scenarios, from interactive development to production deployment:
chatterlang_script Runs ChatterLang scripts from files or directly from the command line, for batch processing and automation.
chatterlang_serve Exposes ChatterLang pipelines as REST APIs or web forms, so workflows can be deployed as web services or user-facing endpoints.
makevectordatabase & serverag Create vector databases from documents and run RAG web servers in two commands—no scripts required.
chatterlang_reference_browser & chatterlang_reference_generator Browse installed ChatterLang sources and segments interactively, or generate reference documentation for all of them in HTML and text formats.
talkpipe_plugins View and manage plugins. TalkPipe's plugin system lets developers register their own sources and segments, so the ecosystem can grow through community contributions and domain-specific extensions.
Container images Pull release images from GitHub Container Registry (multi-platform on each GitHub release).
Applications built on TalkPipe Install them as standalone commands with uv, each into its own environment:
uv tool upgrade upgrades one, uv tool uninstall removes it, and uv tool update-shell puts the commands on your PATH if they are not found. For a pre-release, add --prerelease allow to the install; to go back to the latest release afterwards, reinstall with --reinstall (uv tool install --upgrade never moves a package backwards).
Requirements: Python 3.11 or newer (3.11, 3.12, and 3.13 are the versions tested in CI). Check yours with python3 --version before installing.
pip install talkpipe TalkPipe is provider-neutral: it works with Ollama (local or remote), OpenAI, and Anthropic for chat, and with Ollama, OpenAI, and model2vec (in-process, no server) for embeddings. None of them is required; install the provider(s) you need:
pip install "talkpipe[openai]" # OpenAI pip install "talkpipe[ollama]" # Ollama pip install "talkpipe[anthropic]" # Anthropic Claude pip install "talkpipe[model2vec]" # In-process static embeddings (also in [all]) # Or: pip install "talkpipe[all]" (The quotes matter in zsh, where an unquoted [...] is a glob.)
See LLM providers for what each provider needs and how to select it.
Any provider works in any example. The examples in this README mostly show source="ollama", but that is just a per-segment parameter: swap in source="openai" or source="anthropic" (with a matching model) on any LLM segment — the RAG helpers take the same choice as embedding_source/completion_source. Different segments in one pipeline can even use different providers. Installing talkpipe[all] includes all provider integrations, so switching or mixing needs no further installs.
What each provider needs before its examples run:
None of this is needed for the hello world below. See Configuration for the details and for $key substitution in ChatterLang scripts.
Note: source="eliza" is not an LLM provider. It is a local, deterministic adapter for experimenting with TalkPipe/ChatterLang syntax and multi-turn flow when you do not yet have Ollama/OpenAI/Anthropic access.
Hello, my name is Alice. I am Dr. Eliza. Hi there. What question keeps returning for you? What's my name? Earlier you said your name is Alice. Is that still how you introduce yourself? Reading the example — the same three ideas recur in every example below:
Tip: from talkpipe.chatterlang import compile is equivalent to the compiler.compile(...) style above — both styles work throughout the docs.
Prerequisite: as written, this example uses Ollama, a separate application (not just the talkpipe[ollama] Python package). Install and start it from https://ollama.com/download, then pull the model with ollama pull llama3.2. Ollama is not required: to use OpenAI or Anthropic instead, substitute source="openai" or source="anthropic" (see the commented variants below).
No Ollama server? Swap embedding_source="model2vec" and embedding_model="minishlab/potion-base-8M" for offline embeddings (included in talkpipe[all]). The first run downloads that model from Hugging Face (a few files, tens of MB); after that it's cached and needs no network — see Precache for offline use to pre-download for air-gapped environments. The ragToText completion step still needs a chat provider: set completion_source="openai" or completion_source="anthropic" with a matching completion_model. (OpenAI embeddings work too: embedding_source="openai", embedding_model="text-embedding-3-small".) See the model2vec guide.
Indexing a large collection inside a container? Give the container VM enough memory first — see Memory for large indexing jobs.
TalkPipe's Pipe API is a Pythonic way to build data pipelines using the | operator to chain components. It is an internal DSL: a small pipeline language made of ordinary Python objects, so it lives inside your Python code:
chatterlang_script --script 'INPUT FROM echo[data="1,2,hello,3"] | cast[cast_type="int"] | print' This prints 1, 2, and 3 on separate lines: echo splits its data on commas, and cast skips hello, which cannot be converted to an integer.
To make the uppercase segment from section 1 available in ChatterLang, register it with a decorator:
The language reference, starting with a one-page language at a glance, is in ChatterLang.
Reminder: Examples 1–5 show source="ollama", but any installed provider works in every one of them — swap the source/model parameters as described in the Quick Start.
Problem: Run two LLM personas on one seed topic for several rounds. Result: Printed turns accumulated in @conversation.
talkpipe/ ├── app/ # Runnable applications (servers, CLIs) ├── chatterlang/ # ChatterLang parser, compiler, and components ├── data/ # Data manipulation and I/O components ├── llm/ # LLM and embedding integrations (Ollama, OpenAI, Anthropic, model2vec) ├── operations/ # Algorithms and data processing ├── pipe/ # Core pipeline infrastructure ├── pipelines/ # High-level pipeline components (RAG, vector DB) ├── search/ # Search engine integrations (Whoosh, LanceDB) └── util/ # Utility functions and configuration Configuration TalkPipe uses a flexible configuration system via ~/.talkpipe.toml or environment variables. For LLM and embedding model / source defaults, see Model and source configuration. The example below makes Ollama the default chat provider; default_model_source = "openai" or "anthropic" (with a matching default_model_name) works the same way.
# ~/.talkpipe.toml default_model_name = "llama3.2" default_model_source = "ollama" smtp_server = "smtp.gmail.com" smtp_port = 587 Environment variables use the TALKPIPE_ prefix:
export TALKPIPE_email_password="your-password" export OPENAI_API_KEY="sk-..." Scripts can read any configured value with $name, just as a Python program can read os.environ — a ChatterLang script is a program and runs with your privileges, like a Jupyter notebook. See Security and trust model before running scripts from others or exposing a TalkPipe server.
import talkpipe is fast because the component registry imports a segment or source only when a script or the Pipe API first names it; only catalogue-wide operations (.all, the reference browser, talkpipe_plugins --list) load everything. Keep your own components cheap the same way — import heavy optional dependencies inside the function that needs them. See lazy loading for details (the historical TALKPIPE_LAZY_IMPORT switch no longer changes behaviour).
Contributor-focused glossary, naming conventions, parameter semantics, standard config keys, and segment/source reference notes live in the developer handbook.
Sources generate data (see Creating Custom Components above for segments, which transform data):
We welcome contributions! Whether it's new components, bug fixes, documentation, or examples, please check our GitHub repository for contribution guidelines.
The default branch, stable, is release-only: it points at the latest release, so what you see on the repository's front page describes that release. Development happens on main, which is where merge requests go and where unreleased changes and their documentation accumulate — check it out first:
git clone https://github.com/sandialabs/talkpipe.git cd talkpipe && git checkout main Local development uses uv against the committed uv.lock, so contributors share one reproducible set of versions:
uv sync --all-extras CI does not use the lockfile. It installs with pip (pip install -e ".[dev,all]") and resolves dependencies fresh, on purpose: that is what someone running pip install talkpipe gets, so the build breaks when they would break — a dependency problem the lockfile would hide is exactly what we want CI to see.
Code quality. CI fails on any finding from ruff check ., ruff format --check ., or mypy (the rule set and type-checking config live in pyproject.toml), so run them before pushing — ruff check --fix . && ruff format . fixes most findings. To run the same checks on every commit, opt in once per clone with uv run pre-commit install; pre-commit run --all-files reproduces the CI gate locally.
Releasing. The version comes from the git tag (setuptools_scm); the tag conventions and the publish steps are in RELEASING.md.
TalkPipe 1.0 is a stable release. From 1.0.0 onward we follow semantic versioning:
TalkPipe is a programming language, and its security model is analogous to Jupyter's: a script runs with the privileges of the user who runs it, so run scripts you trust and protect the servers the way you would a notebook server. Details in Security and trust model.
TalkPipe is licensed under the Apache License 2.0. See LICENSE file for details.
dev ollama openai anthropic pypdf pillow model2vec all
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




