# Adding a Custom AI Model

## ![](https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FG5ZbxX918xOHwbAwAJ4n%2FSummary2-Small-Icon.svg?alt=media\&token=da26a67f-ff7f-47b3-8669-06be960dc2d7) Overview

This article explains how to connect a custom AI model to DevOps, replacing Flosum’s shared AI resources. Using your own model can improve performance, reduce latency, and help prevent temporary errors caused by heavy load on Flosum's shared AI resources. A self-hosted model can also provide stronger information security than cloud AI providers. Depending on the provider and model you choose, you may see improvements in speed and reliability. To connect, you will need an API token from your chosen provider. To learn more about the AI features in DevOps, see the following article.

* [overview-of-ai-features](https://docs.flosum.com/devops/settings/ai-settings/overview-of-ai-features "mention")

{% hint style="info" %}

#### Best Practices

* Validate your custom AI model configuration in a non-production branch before rolling it out more widely.
* Use an AI model provider API endpoint that meets your security requirements (cloud vs self-hosted).
* Store your API token securely and rotate it based on your security requirements.
  {% endhint %}

### Supported AI Models

* DeepSeek Chat
* DeepSeek Reasoner
* GPT 4o
* GPT 4o Mini
* GPT 4.1
* GPT 4.1 Mini
* GPT 5
* GPT 5 Mini

## Adding a Custom Model

{% stepper %}
{% step %}

### Access Custom Model

1. Click **Settings** from the left sidebar menu.
2. Click the **General** tab.
3. Click **AI settings**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F4ttPCgSU5HP1IPyvoqYJ%2FAddingACustomAiModel-S01-01.png?alt=media&#x26;token=f69f004f-466a-4b97-9dc3-ebf029cf924c" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Enable Custom Model

1. Enable the **Custom model** toggle.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2Fofv151HeCuDIiIukdNut%2FAddingACustomAiModel-S02-01.png?alt=media&#x26;token=42bcde25-985b-4d60-80d6-806305804745" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Model** dropdown menu.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FTAmUyHgwM6MVUp12MAj9%2FAddingACustomAiModel-S02-02.png?alt=media&#x26;token=ae1b724c-cf90-42aa-899c-787f4906dc4a" alt="" width="563"><figcaption></figcaption></figure></div>
3. Select the AI model you are connecting to.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2F86nH2jjAtyuBxtWRkir8%2FAddingACustomAiModel-S02-03.png?alt=media&#x26;token=8c543004-9cbe-420e-a2aa-f847dc29d8df" alt="" width="563"><figcaption></figcaption></figure></div>
4. In the **Api Url** textbox, enter the endpoint URL of the AI model you are connecting to.

{% hint style="info" %}

#### API URL

**DeepSeek API Endpoint**

You can connect to a DeepSeek model hosted by DeepSeek using the following URL:

* <https://api.deepseek.com>

**OpenAI API Endpoint**

You can connect to a GPT model hosted by OpenAI using the following URL:

* <https://api.openai.com/v1>

**Third-Party or Self-Hosted API Endpoint**

You can connect to any third-party or self-hosted AI model that uses an OpenAI-compatible API endpoint. The API URL must be accessible from Flosum’s servers.
{% endhint %}

5. In the **Token** textbox, enter your API token for connecting to the AI model.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2Fs5BINaUQSDNfQjxllgfw%2FAddingACustomAiModel-S02-04.png?alt=media&#x26;token=63144fa0-4e71-4090-ba50-c4868c98632d" alt="" width="563"><figcaption></figcaption></figure></div>
6. Click **Save**.

   <div align="left"><figure><img src="https://1800549522-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRpUu5iMlzMFAudyBvMOl%2Fuploads%2FnF10iwJbDWP9zafv50mm%2FAddingACustomAiModel-S02-05.png?alt=media&#x26;token=c0c93ab0-3020-40cc-bd8a-c2bec84ec09b" alt="" width="563"><figcaption></figcaption></figure></div>
7. If the connection to the AI model is successful, you will see the message "**AI model configured successfully.**"
   {% endstep %}

{% step %}

### Using AI Features

For instructions on using DevOps' AI features, see the following articles:

* AI Test Class Creator
* AI Code Documenter
  {% endstep %}
  {% endstepper %}
