Skip to main content

A CLI tool for accessing the LLM API in the terminal.

Project description

# paipe: Your Python LLM Pipeline Assistant

[![PyPI version](https://badge.fury.io/py/paipe.svg)](https://pypi.org/project/paipe/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**paipe** is a command-line tool designed to streamline your interactions with Large Language Models (LLMs). It provides a flexible and configurable pipeline to process text input through various LLM providers and models, managed through profiles for ease of use and customization.

## Features

- **Command-Line Interface:**  Simple and intuitive CLI for interacting with LLMs directly from your terminal.
- **Profile-Based Configuration:**  Define and manage multiple LLM configurations (profiles) in a `paipe.yaml` file, allowing you to switch between different providers, models, and settings effortlessly.
- **Streaming Output:** Supports streaming responses from LLMs for a more interactive and real-time experience.
- **Input from Stdin or File:** Read input text from standard input for quick prompts or from files for processing larger documents.
- **Extendable Configurations:** Designed to be easily extended with new LLM providers and models by modifying the configuration file.

## Installation

```bash
python -m pip install -U paipe

Configuration

paipe is configured using a paipe.yaml file. This file should be placed in one of the following locations (in order of priority):

  1. Current directory (./paipe.yaml)
  2. User local directory (~/.local/share/paipe/paipe.yaml)
  3. System configuration directory (/etc/paipe.yaml)

If no paipe.yaml is found in these locations, paipe will prompt an error message and exit.

Here's an example of a paipe.yaml configuration file(access api via openrouter):

default:
    provider: openai
    api_key: 'YOUR_OPENROUTER_API_KEY_HERE' # Replace with your actual API key
    base_url: 'https://openrouter.ai/api/v1'
    model: 'deepseek/deepseek-chat:free'
deepseek-r1:
    provider: openai
    api_key: 'YOUR_OPENROUTER_API_KEY_HERE' # Replace with your actual API key
    base_url: 'https://openrouter.ai/api/v1'
    model: 'deepseek/deepseek-r1:free'

Each section in the paipe.yaml file defines a profile. Here's a breakdown of the profile settings:

  • provider: Specifies the LLM provider. Currently, paipe is configured to use openai which can interface with various providers through platforms like OpenRouter or directly with specific APIs.
  • api_key: Your API key for the chosen provider. Replace the placeholder 'YOUR_API_KEY_HERE' with your actual API key.
  • base_url: The API base URL for the provider. For OpenRouter, it's typically 'https://openrouter.ai/api/v1'.
  • model: The specific LLM model to use from the provider. The available models depend on your chosen provider and API key access. Examples include 'google/gemini-2.0-pro-exp-02-05:free', 'qwen2-72b-instruct', 'deepseek/deepseek-r1:free', etc.

Usage

Basic usage:

paipe <prompt>

This will execute paipe with the <prompt> you provide, using the default profile defined in your paipe.yaml and stream the response to your terminal.

cat essay.txt | paipe --profile deepseek-r1 "write a summary of the following text:"

This will read the content of essay.txt and send it to the deepseek-r1 profile for processing.

paipe --list

This will list all the available profiles defined in your paipe.yaml file.

License

paipe is released under the MIT License. See the LICENSE file for more details.

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

paipe-0.1.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

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

paipe-0.1.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file paipe-0.1.1.tar.gz.

File metadata

  • Download URL: paipe-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for paipe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 01a76796219219c7f68a62f785c8a27a479a745f02cad4dfd9ca66a56da3a959
MD5 cae3ee067cbe304746bceb7f322f4d58
BLAKE2b-256 d3cc3e1b14c66dcc75137661ba189a4f74e49b70c31678c5a1d80eca9902f0a9

See more details on using hashes here.

File details

Details for the file paipe-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: paipe-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.14

File hashes

Hashes for paipe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f69fd8e67f5bce8a838790d2cf8765877b6f6d33dc0eb9464f13a33294b36b42
MD5 fa81b24a0bd0b45f0427115c0a97a9c3
BLAKE2b-256 4a23019f976b5d44f72480262a22e48d6b7fd64e78c37af9423032233476d761

See more details on using hashes here.

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