Haldwani Times
Haldwani Times
Technology

talkpipe 1.4.0

talkpipe 1.4.0
Photo / Illustration: Haldwani Times Editorial Desk

Skip to main content Switch to mobile version talkpipe 1.4.0 Python internal and external DSL for writing generative AI analytics

pip install talkpipe==1.4.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.

What Can You Do With TalkPipe?

Chat with LLMs - Create multi-turn conversations with OpenAI, Ollama, or Anthropic models in just a few lines of code

Process Documents - Extract text from PDFs, analyze research papers, score content relevance

Build RAG Pipelines - Create end-to-end Retrieval-Augmented Generation workflows with vector databases

Analyze Web Content - Download web pages (respecting robots.txt), extract readable text, and summarize

Build Data Pipelines - Chain together data transformations, filtering, and analysis with Unix-like simplicity

Deploy Anywhere - Run in Jupyter notebooks, as Docker containers, or as standalone Python applications

How TalkPipe Is Organized

Three layers; use any mix of them in one project:

Pipe and ChatterLang — Chain sources (which produce items), segments (which transform them), and sinks (segments such as print that write items somewhere) with | in Python, or write ChatterLang scripts for the same concepts (easy to drive from env vars and CI). One word does double duty: a pipeline source starts a pipeline, while the source="ollama" parameter on LLM segments names the model provider.

AI and data primitives — LLMs, full-text search, and vector databases behind one style of component.

Pipelines and applications — Higher-level RAG-style pieces plus CLIs and web apps.

For the full story, see Architecture.

Entry points for different usage scenarios, from interactive development to production deployment:

chatterlang_workbench A browser-based IDE for writing, testing, and running ChatterLang scripts: editor with autocomplete and live error checking, real-time execution, pipeline save/load, next-component suggestions, logging, and documentation lookup.

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:

OpenAI / Anthropic: an API key in the environment (OPENAI_API_KEY, ANTHROPIC_API_KEY). The providers' own SDKs read it; it does not go in ~/.talkpipe.toml.

Ollama on this machine: Ollama running, with the model pulled (ollama pull llama3.2).

Ollama on another machine: also set TALKPIPE_OLLAMA_SERVER_URL, e.g. export TALKPIPE_OLLAMA_SERVER_URL="http://:11434" (a bare host/IP with no scheme or port, like "myollamahost", also works). The model must be pulled on that server — run ollama pull llama3.2 there, or OLLAMA_HOST=http://:11434 ollama pull llama3.2 from your machine.

None of this is needed for the hello world below. See Configuration for the details and for $key substitution in ChatterLang scripts.

Hello world (no LLM server required):

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:

A script that starts with | has no source: its input is whatever you pass to the function. A script that starts with INPUT FROM supplies its own input and is called with no argument. From the shell, chatterlang_script --stdin --script '| ...' feeds a source-less script standard input, one line per item.

single_in=True means "the argument is one item" (without it, a string argument would be treated as a stream of characters); single_out=True means "return the one result itself rather than a one-element list" (it raises if the pipeline produced any other number of results). Leave both off when you pass a list and want a list back.

Tip: from talkpipe.chatterlang import compile is equivalent to the compiler.compile(...) style above — both styles work throughout the docs.

Multi-turn chat (requires an LLM provider):

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).

Index a list of strings, then ask questions against that vector store (expand with options in Example 5). tmp://my_kb is an in-process store that lives only as long as the interpreter — both halves below must run in the same process; use a directory path (as Example 5 does) to keep the index. toDict[field_list="_:text"] wraps each incoming string as {"text": }, the dictionary shape the RAG segments expect — in a field_list, _ means "the whole item" and a:b means "read a, store it as b":

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.

1. The Pipe API (Internal DSL)

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:

Add new functionality with simple decorators:

ChatterLang is the external DSL: a small language of its own, kept in a string or a file, with a Unix-like syntax for the same pipelines — perfect for rapid prototyping and experimentation. Run a script from the command line with chatterlang_script --script '