Skip to content

pgai documentation

Supercharge your PostgreSQL database with AI capabilities. Supports:

Supercharge your PostgreSQL database with AI capabilities. Supports:

  • Ability to call out to leading LLMs like OpenAI, Ollama, Cohere, and more via SQL.
  • Built-in utilities for dataset loading and processing

All with the reliability, scalability, and ACID compliance of PostgreSQL.

Model calling allows you to call out to LLM models from SQL. This lets you leverage the power of LLMs for a variety of tasks, including classification, summarization, moderation, and other forms of data enrichment.

The following models are supported (click on the model to learn more):

ModelTokenizeEmbedChat CompleteGenerateModerateClassifyRerank
Ollama✔️✔️✔️
OpenAI✔️️✔️✔️✔️
Anthropic✔️
Cohere✔️✔️✔️✔️✔️
Voyage AI✔️
Huggingface (with LiteLLM)✔️
Mistral (with LiteLLM)✔️
Azure OpenAI (with LiteLLM)✔️
AWS Bedrock (with LiteLLM)✔️
Vertex AI (with LiteLLM)✔️