Python
Setup

Setup

⚠️ Note: The cloud-based API is currently being deprecated in favour of local installation. Please upgrade to the latest version of thepipe-api and follow the instructions in the README (opens in a new tab) to set up the local API. The cloud-based API will be removed in the next release.

To use thepi.pe, you need to install it and set the THEPIPE_API_KEY environment variable. This key is essential for authenticating your requests to the thepi.pe API.

pip install thepipe-api

Ensure you have two environment variables set: LLM_SERVER_BASE_URL and LLM_SERVER_API_KEY. For example:

LLM_SERVER_BASE_URL=https://api.openai.com
LLM_SERVER_API_KEY=your-api-key

You can use any LLM server that follows OpenAI format (such as OpenAI (opens in a new tab), a locally hosted LiteLLM (opens in a new tab) instance, or a model provider such as OpenRouter (opens in a new tab)). A DEFAULT_AI_MODEL environment variable can be set to your VLM of choice. For example, you could use google/gemini-2.0-flash-001 if using OpenRouter or gpt-4o if using OpenAI.

If you want full functionality with media-rich sources such as webpages, video, and audio, you can choose to install the following dependencies:

apt-get update && apt-get install -y git ffmpeg
python -m playwright install --with-deps chromium