In this quickstart, we’ll create a simple conversational bot that greets users when they join and exits when they leave. This example demonstrates the core components of a Pipecat application with a streamlined setup.

Set up your project

Create a project directory

mkdir pipecat-quickstart && cd pipecat-quickstart

Set up a virtual environment

python3 -m venv env
source env/bin/activate

Download the example files

curl -O https://raw.githubusercontent.com/pipecat-ai/pipecat/main/examples/foundational/07k-interruptible-lmnt.py
curl -O https://raw.githubusercontent.com/pipecat-ai/pipecat/main/examples/foundational/run.py

Install dependencies

pip install fastapi uvicorn python-dotenv pipecat-ai[webrtc,deepgram,lmnt] pipecat-ai-small-webrtc-prebuilt

Configure the environment

Create a .env file with your LMNT API key:

echo "LMNT_API_KEY=your_lmnt_api_key" > .env
echo "DEEPGRAM_API_KEY=your_deepgram_api_key" > .env
echo "OPENAI_API_KEY=your_openai_api_key" > .env

Replace your_{service}_api_key with the actual API keys you created during the installation step.

Run the example

Start the bot with this command:

python 07k-interruptible-lmnt.py

You’ll see a URL (typically http://localhost:7860) in the console output. Open this URL in your browser to join the session. Try having a conversation with the bot!

Understanding the code

Let’s examine the key lmnt component of 07k-interruptible-lmnt:

# Initialize LMNT's text-to-speech service
# Using a pre-selected British female voice
# You can find other voices at https://app.lmnt.com/voice-library
tts = LMNTTTSService(
    api_key=os.getenv("LMNT_API_KEY"),
    voice_id="morgan",  # British Lady
)

Customize the example

Try these simple modifications to enhance your bot:

Next steps

Deploy on the cloud

Now that you have seen how to get a simple bot running, proceed to the Pipecat Cloud quickstart to see an example deployment.