﻿# Connect large language model (LLM) providers

> [HTML Version](cortex-llm-providers.html)

AI agents, AI operations, and smart search in **BRIX AI** are powered by large language models (LLMs). These models generate responses to queries, analyze files, describe images, process text for semantic search, and rank search results to improve accuracy.

Connect a provider to **BRIX AI** to use its language models when configuring product components. You can connect one or multiple providers of various types:

- Cloud model providers, such as OpenAI, Yandex Cloud, Giga, Infinity, and DeepInfra.

- Services with an OpenAI-compatible API.

- Your vLLM servers with deployed models.

When you connect a provider, all its preconfigured language models become available in **BRIX AI**. You can also add fine-tuned models—those additionally trained and customized on the provider side for your company's specific tasks—to the list of available models.  

## Set up a connection to a model provider

In the **BRIX AI** left menu, click the provider icon **(cortex-providers-icon.png) ** to open the **Model Providers** page.

1. Next to the page title, click the plus icon.

2. Fill in the fields:

- **Name**. Enter the name to display in the provider list.

- **Provider**. Select the service that provides language models.

- **API key**. Paste the key obtained from the provider. It will be used to authenticate **BRIX AI** requests. Also fill in an additional option depending on the selected provider:

	- **Base URL**. Enter the base address used to access the provider server.

	- **Folder ID**. For **Yandex Cloud**, specify the [folder ID](https://yandex.cloud/ru/docs/resource-manager/operations/folder/get-id) of the service account used to send requests.

	- **Scope**. For **Giga**, specify which [API version](https://developers.sber.ru/docs/ru/gigachat/api/reference/rest/gigachat-api) requests are made to.

3. Click **Save**.

The provider will be added to the list on the **Model Providers** page. All out-of-the-box models it provides will become available for selection when configuring **BRIX AI** components.

### Configure access to custom language models

If you configured custom models trained for your company's tasks on the provider side, you can connect them in **BRIX AI**. They will appear in the provider's model list and become available when configuring AI agents, AI operations, and smart search. To do this:

1. On the **Model Providers** page, select a provider to open its settings.

2. Next to the **Additional Models** field, click the plus icon and fill in the fields:

- **Name**. The unique name of the model specified when training it on the provider side, matching its API access identifier.

- **Model type**: Select the purpose of the model.

	- **LLM**. Generates responses to queries. Models of this type are available when configuring AI agents and AI operations.

	- **Embedding**. Converts text into a vector format to obtain embeddings for context-aware search. Models of this type are available in smart search indexing settings.

	- **Rerank**. Sorts search results by relevance. Models of this type are available in smart search ranking settings.

- **Context window length**. The maximum message history length the model can consider when generating a response, specified in tokens.

3. Click **Add**.

The settings window will update to show an entry for the added model in the table. You can remove a model by clicking the trash icon next to it, or delete all additional models for the provider by clicking **Clear** in the upper-right corner of the table.

4. After adding all the models, click **Save**.

## Actions with model providers

The **Model Providers** page displays all connected providers. Click the three dots icon in a provider's row to perform actions:

- **Edit**. Edit the [provider connection settings](#connect-provider).

- **Delete**. Permanently remove the provider from the list. If its models are already used in **BRIX AI** components, replace them with models from another provider.

- **Enabled**, **Disabled**. By default, a provider's models are ready to use as soon as it is added. You can temporarily disable access to a provider—for example, during technical outages. To keep **BRIX AI **components running, select models from a different provider in their settings.