# Enable AI

This guide explains how to enable and configure AI functionality in **PIARA Lite** using the **OpenAI API**. Once connected, PIARA can use AI models to analyze and enrich both text and image data in your instance.

{% embed url="<https://www.youtube.com/watch?v=nfq1aNFhgPc>" %}

> ℹ️ **PIARA Premium** also supports **Google Gemini** and **Ollama**, using the same configuration flow.

***

## 🤖 What Is an AI Model in PIARA?

In PIARA, an **AI Model** is a combination of:

* A provider (e.g., OpenAI, Google, Ollama)
* A billing account (via API key)
* A specific model from that provider (e.g., `gpt-4.1`, `gpt-4.1-nano`)

This modular design provides flexibility and encourages experimentation with AI.

> 🛠️ **AI Models** are system-wide configurations available to all users in the instance.

### 💡 Notes

* **PIARA Lite** supports **OpenAI** models only.
* **PIARA Premium** adds support for **Google Gemini** and **Ollama**.

***

## 📋 Prerequisites

Make sure the following requirements are met before you proceed:

* ✅ A fully deployed instance of **PIARA Lite**
* 🔑 A valid **OpenAI API key**
* 🧪 (Optional) Some data already present in PIARA
* 📄 Required configuration parameters (listed below)

***

## ⚙️ Required Configuration Parameters

| Parameter      | Value / Source                                                       |
| -------------- | -------------------------------------------------------------------- |
| **URL**        | `https://api.openai.com`                                             |
| **API Key**    | [Get your API key from OpenAI](https://platform.openai.com/api-keys) |
| **Model Type** | [Browse available models](https://platform.openai.com/docs/models)   |

***

## 🛠️ Setup Instructions

### 1. Open the AI Model Management Page

Navigate to:\
\&#xNAN;**`System > AI Models Management`**

> 📂 If no models are configured, the list will be empty.

### 2. Add a New AI Model

Click **“Add Model”** and fill in the fields:

|                 |                                                                                                   |
| --------------- | ------------------------------------------------------------------------------------------------- |
| **Title**       | A unique name for the model (e.g., `GPT-4.1-nano`)                                                |
| **Description** | *(Optional)* Notes for internal use                                                               |
| **URL**         | `https://api.openai.com`                                                                          |
| **API Key**     | Your key from [OpenAI API Keys](https://platform.openai.com/api-keys)                             |
| **Model Type**  | e.g., `gpt-4.1-nano`, `gpt-4.1`, etc. ([See model list](https://platform.openai.com/docs/models)) |
| **Connector**   | Select `OpenAI` (PIARA Lite only supports OpenAI)                                                 |
| **Inputs**      | Select **Text**, **Image**, or both (depends on model capabilities)                               |
| **Options**     | *(Optional)* JSON config for advanced use (not covered in this guide)                             |

### 3. Test the Connection

After saving the model:

1. Click **“Save and Test”**
2. Enter a sample input (e.g., `Hello AI!`)
3. Click **Submit**
4. ✅ Confirm successful connection

### 4. (Optional) Add More Models

You can configure multiple models to support various use cases:

* Use unique names for each model
* Select different model types (e.g., lightweight vs full-scale)

***

## ✅ Result

Once set up, your models will appear in the list and can be used in enrichment and automation features throughout PIARA.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://piara-docs.gitbook.io/piara-documentation/admin-guide/enable-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
