---
title: pgai documentation | Tiger Data Docs
description: Supercharge your PostgreSQL database with AI capabilities. Supports:
---

# pgai documentation

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.

## pgai install

- [Install pgai with Docker](/reference/pgai/extension/install/docker/index.md): run pgai in a container environment.
- [Install pgai from source](/reference/pgai/extension/install/source/index.md): install pgai from source.

## pgai model calling

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):

| **Model**                                                                                   | **Tokenize** | **Embed** | **Chat Complete** | **Generate** | **Moderate** | **Classify** | **Rerank** |
| ------------------------------------------------------------------------------------------- | :----------: | :-------: | :---------------: | :----------: | :----------: | :----------: | :--------: |
| **[Ollama](/reference/pgai/extension/model_calling/ollama/index.md)**                       |              |     ✔️    |         ✔️        |      ✔️      |              |              |            |
| **[OpenAI](/reference/pgai/extension/model_calling/openai/index.md)**                       |      ✔️️     |     ✔️    |         ✔️        |              |      ✔️      |              |            |
| **[Anthropic](/reference/pgai/extension/model_calling/anthropic/index.md)**                 |              |           |                   |      ✔️      |              |              |            |
| **[Cohere](/reference/pgai/extension/model_calling/cohere/index.md)**                       |      ✔️      |     ✔️    |         ✔️        |              |              |      ✔️      |     ✔️     |
| **[Voyage AI](/reference/pgai/extension/model_calling/voyageai/index.md)**                  |              |     ✔️    |                   |              |              |              |            |
| **[Huggingface (with LiteLLM)](/reference/pgai/extension/model_calling/litellm/index.md)**  |              |     ✔️    |                   |              |              |              |            |
| **[Mistral (with LiteLLM)](/reference/pgai/extension/model_calling/litellm/index.md)**      |              |     ✔️    |                   |              |              |              |            |
| **[Azure OpenAI (with LiteLLM)](/reference/pgai/extension/model_calling/litellm/index.md)** |              |     ✔️    |                   |              |              |              |            |
| **[AWS Bedrock (with LiteLLM)](/reference/pgai/extension/model_calling/litellm/index.md)**  |              |     ✔️    |                   |              |              |              |            |
| **[Vertex AI (with LiteLLM)](/reference/pgai/extension/model_calling/litellm/index.md)**    |              |     ✔️    |                   |              |              |              |            |

- **Usage examples**:

  - [Delayed embed](/reference/pgai/extension/model_calling/delayed_embed/index.md): run pgai using pgai or TimescaleDB background actions.
  - [Moderate comments using OpenAI](/reference/pgai/extension/model_calling/moderate/index.md): use triggers or actions to moderate comments using OpenAI.

## pgai utils

- [Load dataset from Hugging Face](/reference/pgai/extension/utils/load_dataset_from_huggingface/index.md): load datasets from Hugging Face’s datasets library directly into your PostgreSQL database.

## pgai operations and security

- [Secure pgai with user privilages](/reference/pgai/extension/security/privileges/index.md): grant the necessary permissions for a specific user or role to use pgai functionality.
- [A guide to securely handling API keys](/reference/pgai/extension/security/handling-api-keys/index.md): learn how to securely handle API keys in your database.
