# How-to guide: Connecting OSS models through AI Trust Layer

> This guide explains how to connect an open-source model hosted on an AI gateway through the AI Trust Layer **LLM Configurations** feature. You create a custom Integration Service connector using the OpenAI V1 Compliant template and configure it with your gateway credentials and model identifier.

This guide explains how to connect an open-source model hosted on an AI gateway through the AI Trust Layer **LLM Configurations** feature. You create a custom Integration Service connector using the OpenAI V1 Compliant template and configure it with your gateway credentials and model identifier.

The steps use Fireworks as the example gateway, but any OpenAI-compatible gateway works.

## Prerequisites

- BYO AI Gateway enabled in your cluster. For details, see [Configuring AI Trust Layer](https://docs.uipath.com/automation-suite/automation-suite/2.2510/installation-guide-eks-aks/ai-trust-layer-specific-configuration).
- An account on an OpenAI-compatible AI gateway (for example, Fireworks) with access to the model you want to use
- The model identifier as listed in your gateway (for example, `accounts/fireworks/models/glm-4p6` for GLM on Fireworks)
- API credentials for your gateway account
- Organization administrator access in Automation Suite
- Access to Integration Service and Connector Builder

## Configure the LLM in AI Trust Layer

1. Navigate to **Admin** > **AI Trust Layer** > **LLM configurations** and select **Add configuration**.
2. Set the **Tenant**, **Product**, and **Feature** values.

   :::note
   You can select any product that supports BYOM — for example, **Agents**, **Gen AI Activities**, or **Coded Agents**.
   :::

3. Under **Model Configuration**, select **Add Custom Alias** and enter the name of the OSS model.
4. Set **API Type** to the API type that corresponds to your model. For most chat models, select **Chat Completions**.
5. In the **Connector** field, select **Create custom connector**.
6. Select the **OpenAI V1 Compliant LLM** template, then select **Create connector**.
   Connector Builder opens with the template pre-populated.
7. Configure and save the connector, then [publish it](https://docs.uipath.com/integration-service/automation-suite/2.2510/user-guide/connector-builder-publishing).

## Add a connection in Integration Service

1. In Integration Service, navigate to **Connections** and select **Add connection**.
2. Select the custom connector you published.
3. Enter your gateway credentials. For Fireworks, this is your API key.
4. Select **Connect** to provision the connection.

## Complete the LLM configuration

1. Return to **Admin** > **AI Trust Layer** > **LLM configurations** and open the configuration you started.
2. Under **Model Configuration**, set **Connector** to your published connector and **Connection** to the connection you created.
3. In the **LLM identifier** field, enter the model identifier exactly as it appears in your gateway.

   For Fireworks-hosted models, the identifier follows the format `accounts/fireworks/models/<model-name>`. For example: `accounts/fireworks/models/glm-4p6`.

   :::note
   Trailing spaces in the **LLM identifier** field cause connection errors. Verify there are no leading or trailing spaces before saving.
   :::

4. Select **Test configuration** to run the AI Trust Layer probe.
5. If the probe passes, select **Save**.

### Result

The configuration is saved and the OSS model is available to the product and feature you specified. Calls route through the AI Trust Layer and appear in the audit log under **Source: Custom connection**. To verify, run an agent using the newly added model and check the traces and AI Trust Layer audit logs to confirm the expected model was invoked.

:::note
If you encounter issues while creating a custom connector, contact UiPath Support for assistance.
:::
