Skip to main content

Semantic pipes for your terminal - PDFs, images, audio, video, and text through Unix verbs that understand.

Project description

smartpipe

CI PyPI Python License: Apache 2.0

Semantic pipes for your terminal. (PyPI: smartpipe-cli; the command is smartpipe.)

Run PDFs, images, audio, video, and text through Unix verbs that understand their input. Use Ollama for local models, or choose a cloud provider explicitly.

Formerly sempipe (which still works as a command alias). The import name, SMARTPIPE_* env vars, and ~/.config/smartpipe keep the old spelling.

$ uvx --from smartpipe-cli smartpipe   # zero-install trial (or: pip install smartpipe-cli)

$ smartpipe map "summarize the key risk" --in 'filings/*.pdf'     # documents, figures included
$ smartpipe filter "the caller sounds frustrated" --in 'calls/*.mp3'
$ echo "hello world" \
    | smartpipe map "translate to Spanish"
hola mundo

A PDF arrives with its figures attached. A scanned page routes itself to a vision model and says so.

Audio is heard natively or transcribed. Video is watched where the wire supports it, and decomposed into frames plus transcript where it does not. Every degradation is disclosed per row.

No server. No YAML. No vector database. stdin to stdout, composing with grep, jq, sort - and tail -f: the per-item verbs stream.

The verbs

Semantic (call a model):

Verb What it does Feels like
map transform each item - text or media - with a prompt sed, but it understands
extend add extracted fields; everything else survives your record, plus columns
filter keep items matching a plain-English condition grep, but semantic
embed / top_k vectors; rank by similarity sort | head, by meaning
reduce synthesize many items into one awk END, but literate
join match two inputs (--kind inner|leftouter|anti) SQL join, but semantic
cluster group by meaning, label each group themes with sizes and quotes
distinct fold near-duplicates sort -u, by meaning
diff what distinguishes two sets the post-incident answer
outliers the items least like the rest novelty, surfaced

Free utilities (never call a model): where (KQL-style predicates), summarize (count/avg/percentiles, time buckets), sort, sample (seeded), getschema, split, chart (terminal bars, SVG, facets, time series). Put them first - they cut the corpus before anything paid runs.

Sixty seconds

# 1. Point smartpipe at a model (local & free via Ollama, or cloud):
$ smartpipe config

# 2. Ask a question across a folder of mixed documents:
$ smartpipe map "What does this say about pricing?" --in 'docs/*.pdf'

# 3. Typed extraction - braces carry names, types, AND guidance:
$ cat tickets.jsonl \
    | smartpipe extend "Add {label enum(bug, feature, praise), urgency number: 0 to 1}"

# 4. The analyst's Monday, one line:
# group by meaning, label each theme; chart it for the deck
$ cat feedback.txt \
    | smartpipe cluster --top 8 \
    | smartpipe chart cluster --save themes.svg

# 5. Free gates before paid judges - and watch the live token/media counts:
# where cuts for free; the model judges only what remains
$ cat app.log \
    | smartpipe where 'text has "ERROR"' \
    | smartpipe filter "an actual outage"

# 6. Save the whole pipeline as a file; it becomes a command:
$ smartpipe run triage.sem --dry-run     # the stage graph + cost posture, zero calls

New to any of this? The ten-minute quickstart assumes nothing - including that you know what a "model" is.

Honest about where your data goes, and what it costs

Some of smartpipe runs locally regardless of chat model choice: local embeddings (fastembed) and local transcription (whisper) ship built in.

For chat, Ollama gives you a local path when it runs on your machine. If you choose a cloud model, that provider sees the data for that run. Examples: gpt-5.4-mini, claude-opus-4-8, gemini-3.1-flash-lite, mistral-large-latest, and openrouter/....

API keys come from environment variables and are never stored. ChatGPT subscribers can use smartpipe auth login instead.

Paid media conversions require allow-captions. Runs show live token/media counts and end with a receipt. smartpipe usage keeps local hour/day/week/month/lifetime totals, and the opt-in result cache makes repeated calls free.

It behaves like a real Unix tool

  • stdout is data, stderr is chatter. Progress and receipts never contaminate your pipe.
  • TTY-aware. Human-readable at the terminal, NDJSON when piped - automatically.
  • Order-preserving. Output order matches input order, even with parallel calls.
  • Failure-tolerant. One bad item is a warning, not a crash.
  • Reproducible. Temperature 0 everywhere, seeded sampling, deterministic clustering.

Learn more

Full docs in docs/ (or as a site - uv run --group docs mkdocs serve):

How to cite

If smartpipe is useful in your research, cite it (or run smartpipe cite):

@software{gupta_smartpipe_2026,
  author = {Gupta, Prabal},
  title = {smartpipe: semantic pipes for your terminal},
  year = {2026},
  version = {1.3.0},
  license = {Apache-2.0},
  url = {https://github.com/prabal-rje/smartpipe}
}

GitHub's "Cite this repository" button (from CITATION.cff) gives APA too.

Development

Built in the open, under Apache-2.0. Contributor setup and the quality gates are in CONTRIBUTING.md; the manual release pass lives in qa/. The CLI surface is a SemVer contract.

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

smartpipe_cli-1.3.0.tar.gz (254.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

smartpipe_cli-1.3.0-py3-none-any.whl (248.5 kB view details)

Uploaded Python 3

File details

Details for the file smartpipe_cli-1.3.0.tar.gz.

File metadata

  • Download URL: smartpipe_cli-1.3.0.tar.gz
  • Upload date:
  • Size: 254.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smartpipe_cli-1.3.0.tar.gz
Algorithm Hash digest
SHA256 0c724ccf6538dcff2c1b9fc6f09a4705fdda6467ec6df3b753bd07926e874c2a
MD5 0d7b5cfbe45dbb0600900ecaf2f337e3
BLAKE2b-256 a804ea99ca93e95f994e9845b393d742f6ba10b83ec5d369ecd9a2693c09b640

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartpipe_cli-1.3.0.tar.gz:

Publisher: release.yml on prabal-rje/smartpipe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file smartpipe_cli-1.3.0-py3-none-any.whl.

File metadata

  • Download URL: smartpipe_cli-1.3.0-py3-none-any.whl
  • Upload date:
  • Size: 248.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for smartpipe_cli-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed2d0f9206080a0285f67f23b6438259c7200e368c49d90c0fa1771b584cc3e
MD5 c2bc890f853d9e3abbd82b3b6ede4474
BLAKE2b-256 a37404e8c1040db362e373c466af9695616c5a26464bc98260a803666dbfecef

See more details on using hashes here.

Provenance

The following attestation bundles were made for smartpipe_cli-1.3.0-py3-none-any.whl:

Publisher: release.yml on prabal-rje/smartpipe

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page