EDB Postgres AI AI/ML - Installing the pgai tech preview
Suggest editsThe preview release of pgai is distributed as a self-contained Docker container that runs PostgreSQL and includes all of the pgai dependencies.
Configuring and running the container image
If you haven't already, sign up for an EDB account and log in to the EDB container registry.
Log in to Docker with the username tech-preview and your EDB Repo 2.0 subscription token as your password:
Download the pgai container image:
Specify a password to use for Postgres in the environment variable PGPASSWORD. The tech preview container will set up Postgres with this password and use it to connect to it. In bash or zsh set it as follows:
You can use the pgai extension with encoder LLMs in Open AI or with open encoder LLMs from HuggingFace. If you want to use Open AI you also must provide your API key for that in the OPENAI_API_KEY environment variable:
You can use the pgai extension with AI data stored in Postgres tables or on S3 compatible object storage. To work with object storage you need to specify the ACCESS_KEY and SECRET_KEY environment variables:.
Start the pgai tech preview container with the following command. It makes the tech preview PostgreSQL database available on local port 15432:
Connect to Postgres
If you haven't yet, install the Postgres command-line tools. If you're on a Mac, using Homebrew, you can install it as follows:
Connect to the tech preview PostgreSQL running in the container. Note that this relies on $PGPASSWORD being set - if you're using a different terminal for this part, make sure you re-export the password:
Install the pgai extension:
Could this page be better? Report a problem or suggest an addition!