> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate a Custom Embedding Model

Connect your own embedding model to control how Search AI vectorizes text, enabling domain-specific embeddings or compliance with data privacy requirements.

## Supported Vector Dimensions

Your embedding model must output one of these vector sizes:

| Supported Sizes |
| - |
| 128, 256, 384, 512, 768, 1024, 1028, 1536, 2048, 3072 |

## Integration Steps

**Step 1: Configure the Model**

1. Go to **Generative AI Tools > Model Library**
2. Click **+New Model** and select **Custom Integration**
3. In the **Configurations** tab, provide:

| Field | Description |
| - | - |
| Integration Name | Unique identifier for this integration |
| Model Name | Your model name (for example, `text-embedding-ada-002`) |
| Endpoint | API endpoint that returns embeddings |
| Auth | Authorization profile (if required) |
| Headers | Any required request headers |

1. Click **Next** and enter your **Request Prompt** (the payload sent to the model):

```json theme={null}
{
  "input": "The food was delicious and the waiter...",
  "model": "text-embedding-ada-002",
  "encoding_format": "float"
}
```

1. Click **Test** to verify the response, then **Save**

**Step 2: Create a Custom Prompt**

1. Go to **Generative AI Tools > Prompt Library**
2. Click **+New Prompt** and configure:

| Field | Description |
| - | - |
| Name | Unique identifier for this prompt |
| Feature | Select **Vector Generation** |
| Model | Select your custom model from Step 1 |

3. Define the **Request** using the `{{embedding_input}}` variable:

```json theme={null}
{
  "input": "{{embedding_input}}",
  "model": "text-embedding-ada-002",
  "encoding_format": "float"
}
```

4. Enter sample values and click **Test**
5. In the **Response**, double-click the field containing the embeddings array to set the **Text Response Path**

The selected field must contain an array of numbers:

```json theme={null}
{
  "data": [
    {
      "embedding": [-0.022822052, 0.01614314, 0.008042404, ...]
    }
  ]
}
```

6. Click **Save**

> [!NOTE]
>
> If the response format doesn't match, use a post-processor script to transform it.

**Step 3: Enable the Model**

1. Go to **GenAI Features**
2. For **Vector Generation**:
   * Select the model from Step 1
   * Select the prompt from Step 2
3. Enable the feature

Search AI now uses your custom embedding model.

## Fine-Tuning Embedding Models

For improved relevance, fine-tune embedding models with your domain-specific data using the [Fine-Tune Embedding Utility](https://koreai.mintlify.site/ai-for-service/searchai/advance-config-and-dev-tools.md#model-optimization) from the Search AI Toolkit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.