> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/documentation/use-octoxlabs/settings/product-settings/ai-configuration.md).

# AI Configuration

Enter the OctoXLabs AI token or your own model API keys, choose the primary models for Query AI and AI Insight, set a proxy and test the connection.

**AI Configuration** sets up the AI features of OctoXLabs. There are two. **Query AI** turns a question written in plain language into a query in the Query Wizard. **AI Insight** calculates insights and a security score for a device and shows them in the device detail view as OctoAI Insights. On this page you give the platform the credentials it needs to reach an AI model, and you choose which model each feature uses.

### Before you begin

* Applies to: OctoXLabs 6.x. Query AI is in 6.0.0 for devices and in 6.2.0 for every inventory. AI Insight is in 6.5.0.
* Required permission to open the page: `configurations.view_aiconfiguration`.
* Required permission to save and test: `configurations.change_aiconfiguration`. This permission can be given to custom groups.
* Either an OctoXLabs AI token, which OctoXLabs support provides, or an API key for at least one of the supported models (see below).
* Outbound access from the main server to the AI service. Ask OctoXLabs support for the address and port to allow.

### Open the page

Go to **Settings** > **Product Settings** > **AI Configuration**.

### AI Configuration settings

#### Token and primary models

| Setting                      | Type      | Default                             | Description                                                                                                                                       |
| ---------------------------- | --------- | ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Octoxlabs AI Proxy Token** | Password  | Empty                               | The token for the OctoXLabs AI service. After you save, the field shows ten asterisks. With a token set, every model in the list can be selected. |
| **Query AI Primary Model**   | Selection | **Azure OpenAI Mini (Recommended)** | The model that Query AI uses by default. It is also pre-selected on the Query AI page.                                                            |
| **AI Insight Primary Model** | Selection | **Azure OpenAI Mini (Recommended)** | The model that AI Insight uses.                                                                                                                   |

The models you can choose are **Azure OpenAI Mini (Recommended)**, **OpenAI GPT Mini**, **Anthropic Claude Sonnet**, **Google Gemini Pro** and **Google Gemini Flash**. Without an **Octoxlabs AI Proxy Token**, a model is greyed out until you enter an API key for it. The page tells you: **Define an API key for this model to make it selectable**.

#### Model API keys

Use these fields if you want to use your own account with a model provider. Each field is a password field and shows ten asterisks after saving.

| Setting                       | Type     | Default | Description                          |
| ----------------------------- | -------- | ------- | ------------------------------------ |
| **Azure OpenAI Mini API Key** | Password | Empty   | Key for **Azure OpenAI Mini**.       |
| **OpenAI GPT Mini API Token** | Password | Empty   | Token for **OpenAI GPT Mini**.       |
| **Claude Sonnet API Key**     | Password | Empty   | Key for **Anthropic Claude Sonnet**. |
| **Gemini Pro API Key**        | Password | Empty   | Key for **Google Gemini Pro**.       |
| **Gemini Flash API Key**      | Password | Empty   | Key for **Google Gemini Flash**.     |

#### HTTP Proxy (optional)

Fill these in if the main server reaches the AI service through a proxy.

| Setting            | Type     | Default | Description                               |
| ------------------ | -------- | ------- | ----------------------------------------- |
| **HTTP Proxy**     | Text     | Empty   | Proxy for HTTP calls to the AI service.   |
| **HTTPS Proxy**    | Text     | Empty   | Proxy for HTTPS calls to the AI service.  |
| **Proxy Username** | Text     | Empty   | The proxy user name, if it needs a login. |
| **Proxy Password** | Password | Empty   | The proxy password.                       |

### Configure AI

{% stepper %}
{% step %}

#### Enter the credentials

Paste the **Octoxlabs AI Proxy Token**, or enter the API key for the model you want to use. If you need a proxy, fill in the **HTTP Proxy** section.
{% endstep %}

{% step %}

#### Choose the primary models

Pick a model in **Query AI Primary Model** and in **AI Insight Primary Model**. You can pick a different model for each.
{% endstep %}

{% step %}

#### Save and test

Select **Save**. The console shows **Settings saved**. Then select **Test Connection**. On success you see **AI proxy connection successful**. Below the form, **Last check: Successful** or **Last check: Failed** shows the result of the latest test.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
**Test Connection** is disabled while you have unsaved changes, with the message **Save changes before testing the connection**. Save first, then test.
{% endhint %}

### Custom LLM providers

From 6.9.0 the AI Configuration screen also lets you choose an LLM provider. Along with the default OctoXLabs AI service, you can define your own provider if it supports the OpenAI-compatible API standard, for example vLLM, and use it for the AI features.

### Where the models are used

* **Query AI.** In the Query Wizard, ask for a query in plain language. The model you picked as **Query AI Primary Model** is the one that is selected by default.
* **AI Insight.** On a device, request OctoAI Insights to get insights and a security score. You can use the calculated score when you build queries in the Query Wizard.

### Troubleshooting

| Symptom or error message                             | Cause                                                                                          | Fix                                                                            |
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| A model is greyed out in a primary model list        | No token and no API key for that model.                                                        | Enter the **Octoxlabs AI Proxy Token** or the model's API key and save.        |
| **Test Connection** is disabled                      | There are unsaved changes.                                                                     | Select **Save**, then test again.                                              |
| **Last check: Failed**                               | The token or key is wrong, the proxy is wrong, or the main server cannot reach the AI service. | Check the credentials, the proxy fields and the firewall, save and test again. |
| You cannot find **AI Configuration** in **Settings** | Your group lacks `configurations.view_aiconfiguration`.                                        | Ask an administrator to add it to your group. See Groups.                      |

### What's next?

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Create and Save Queries</strong></td><td>Use Query AI in the Query Wizard.</td><td></td></tr><tr><td><strong>Asset Inventory</strong></td><td>Open a device and request OctoAI Insights.</td><td></td></tr><tr><td><strong>Groups</strong></td><td>Control who can use and configure AI.</td><td></td></tr></tbody></table>
