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

# Embedders in Tyk AI Studio

> Learn what an Embedder is in Tyk AI Studio, which features use the shared Embedders, and the rules that keep stored vectors valid.

## Availability

| Edition | Deployment Type |
| :- | :- |
| Community and [Enterprise](https://tyk.io/docs/ai-management/ai-studio/overview.md#enterprise-edition) | Self-Managed |

Embedders are available from v2.2.0.

## Overview

An Embedder is a saved embedding configuration. It tells AI Studio which client to call, AI Studio uses an Embedder to change text into vectors.

Before v2.2.0, each data source kept its own embedding settings. Now many data sources can share one Embedder. If you change the endpoint or the API key of an Embedder, the change applies to all the data sources that use it.

![Embedders list with two Embedders that use the OpenAI provider and one standalone Ollama Embedder](https://mintcdn.com/tyk/r98Mv741lZiULGvC/img/ai-management/ai-studio-embedders-list.png?fit=max\&auto=format\&n=r98Mv741lZiULGvC\&q=85\&s=68b9f194a835d6a5b5756d7503195b35)

## What Uses Embedders

| Feature | What the Embedder Embeds | Can the Model Change? |
| :- | :- | :- |
| [Data sources](https://tyk.io/docs/ai-management/ai-studio/datasources-rag.md) | The documents that you upload, and each query that searches the data source | No, not while a data source uses the Embedder. Refer to [The Model Is Locked](#the-model-is-locked). |
| [Semantic routers](https://tyk.io/docs/ai-management/ai-studio/semantic-router.md) (Enterprise) | The example prompts of each route, and each request that the router classifies | Yes. The router embeds its examples again when its configuration changes. |

[Semantic caching](https://tyk.io/docs/ai-management/ai-studio/semantic-caching.md) does not use the shared Embedders. The Advanced LLM Cache plugin has its own embedder settings in the plugin configuration. It calls an OpenAI-compatible endpoint, or it uses a local hashing embedder.

## Linked and Standalone Embedders

An Embedder gets its connection in one of two ways:

| | Linked to an LLM Provider | Standalone |
| :- | :- | :- |
| Connection | The vendor, endpoint, and API key of the [LLM provider](https://tyk.io/docs/ai-management/ai-studio/llm-management.md) | Its own **API compatibility**, endpoint, and API key |
| Privacy score | The privacy score of the LLM provider | Its own privacy score |
| Use it for | An LLM provider that you already configured, such as OpenAI | A dedicated embedding service, such as a local model behind an OpenAI-compatible API |

A linked Embedder follows its LLM provider. When you change the endpoint, the key, or the privacy score of the provider, the Embedder uses the new values.

The **LLM provider** list shows only the providers whose vendor supports embeddings.

### API Compatibility

**API compatibility** is the client that AI Studio uses to call the endpoint. It is not always the company that serves the model. For example, if you serve a Hugging Face model through an OpenAI-compatible API, select **OpenAI**.

The vendors that support embeddings are OpenAI, Ollama, Google AI, Vertex, and Hugging Face.

* **Endpoint URL**: Leave it empty to use the default endpoint of the vendor.
* **Vertex**: The endpoint field is **Project and location**. Enter the Google Cloud project and region, for example `my-project:us-central1`.
* **API key**: Enter the key, or a reference to a stored [secret](https://tyk.io/docs/ai-management/ai-studio/secrets.md) (`$SECRET/NAME`) or an environment variable (`$ENV/NAME`). AI Studio does not show a stored key again. Use a secret reference, so that the Embedder does not store the key itself.

## Rules That Protect Your Data

### The Model Is Locked

The vectors in a vector store come from one model. If a query uses a different model, the search returns poor matches, and AI Studio shows no error. For this reason, while a data source uses an Embedder, you cannot change:

* The model.
* The API compatibility of a standalone Embedder.
* The LLM provider of a linked Embedder.
* The type of the Embedder, from linked to standalone or the opposite.

You can always change the name, the description, the endpoint, and the API key.

To use a different model, do these steps:

1. Create a new Embedder with the new model.
2. Select the new Embedder on the data source.
3. Process the embeddings of the data source again.

The same rule applies to an LLM provider that a linked Embedder uses. While data sources embed through it, you cannot change the vendor of the provider.

![Edit embedder form with a message that the model and API compatibility cannot change because the Support Knowledge Base data source uses the Embedder](https://mintcdn.com/tyk/r98Mv741lZiULGvC/img/ai-management/ai-studio-embedders-locked.png?fit=max\&auto=format\&n=r98Mv741lZiULGvC\&q=85\&s=d8218f1abf1601d263d43c6d46ad6858)

### Privacy Levels

An Embedder receives the text that it embeds. Thus, its privacy score must be equal to or higher than the score of each data source that uses it. AI Studio refuses a data source, or a change to an Embedder or an LLM provider, that breaks this rule.

For a semantic router, the privacy score of the Embedder is one of the values that set the privacy score of the router. For more information about privacy scores, refer to [Privacy Levels](https://tyk.io/docs/ai-management/ai-studio/privacy-levels.md).

### Delete an Embedder

You cannot delete an Embedder that a data source or a semantic router uses. The error message lists them. The **Used by** section of the Embedder detail page shows the same list.

You also cannot delete an LLM provider while an Embedder is linked to it.

![Embedder detail page with the model, the privacy level, the linked OpenAI provider, and a Used by section that lists one data source](https://mintcdn.com/tyk/r98Mv741lZiULGvC/img/ai-management/ai-studio-embedders-detail.png?fit=max\&auto=format\&n=r98Mv741lZiULGvC\&q=85\&s=bbb894adf15a37b1c03d9568fa526a60)

### Namespaces

An Embedder that is linked to an LLM provider in a namespace can serve only the data sources and semantic routers in that namespace. An Embedder that is linked to a global provider can serve all namespaces. A standalone Embedder has no namespace.

AI Studio refuses a change that breaks this rule. Thus, the key of a provider does not go to Edge Gateways in other namespaces.

### Inactive LLM Providers

A data source can still use an Embedder whose LLM provider is not active. The data source continues to embed its documents and queries, in AI Studio and on Edge Gateways.

A semantic router is different. On Edge Gateways, a router with a linked Embedder uses the LLM provider of the Embedder. Edge Gateways receive only the active providers. Thus, the router cannot embed through an inactive provider. It continues with its other classification steps.

## Create an Embedder

You can create an Embedder in two ways.

### From the Embedders Page

1. Go to **LLM management > Embedders**, and click **Add embedder**.
2. Enter a **Name** and, optionally, a **Description**.
3. In **Connection**, select **Use an LLM provider** or **Standalone**.
   * For a linked Embedder, select the **LLM provider**.
   * For a standalone Embedder, select the **API compatibility**. Then enter the endpoint and the API key. Refer to [API Compatibility](#api-compatibility).
4. Enter the embedding **Model**, for example `text-embedding-3-small`.
5. For a standalone Embedder, set the **Privacy level**. A linked Embedder uses the privacy score of its LLM provider.
6. Click **Create embedder**.

![Add embedder form for a standalone Embedder with OpenAI API compatibility, a custom endpoint, a secret reference, and a Confidential privacy level](https://mintcdn.com/tyk/r98Mv741lZiULGvC/img/ai-management/ai-studio-embedders-standalone-form.png?fit=max\&auto=format\&n=r98Mv741lZiULGvC\&q=85\&s=57416591404bf430822f8faada7f53f3)

### From a Form That Uses an Embedder

The [data source](https://tyk.io/docs/ai-management/ai-studio/datasources-rag.md#how-rag-works-in-the-chat-interface) form and the semantic router form (Enterprise) have an **Embedder** field. Select an existing Embedder, or click **New embedder** to create one without leaving the form. The list shows the model, the vendor, and the privacy score of each Embedder.

![Edit data source form with the Embedder list and the New embedder button](https://mintcdn.com/tyk/r98Mv741lZiULGvC/img/ai-management/ai-studio-embedders-data-source.png?fit=max\&auto=format\&n=r98Mv741lZiULGvC\&q=85\&s=10396e401b7bc91412dd647f70696de9)

## Permissions

In the Enterprise Edition, the `embedders` permission controls the **Embedders** page. It is in the **LLM management** group of the [permission catalog](https://tyk.io/docs/ai-management/ai-studio/rbac.md).

* To create an Embedder, a user needs `embedders` with the `write` action. This applies on the **Embedders** page and to the **New embedder** button on other forms.
* A linked Embedder uses the credentials of its LLM provider. To link an Embedder, or to change its provider, a user also needs `llms` with the `read` action.
