> For the complete documentation index, see [llms.txt](https://docs.percona.com/percona-search-for-mongodb/llms.txt).

# Automatic embedding with OpenAI-Compatible Providers

With the `OPENAI_COMPATIBLE` provider, `mongot` can generate embeddings using any service that exposes an OpenAI-compatible `/v1/embeddings` endpoint, whether it is a hosted service or an embedding server that you run yourself.

This page covers what is specific to OpenAI-compatible providers. For the list of all supported providers, how automatic embedding works, and the general configuration procedure, see [Automatic embedding configuration](https://docs.percona.com/percona-search-for-mongodb/configure-automatic-embedding.md).

## OpenAI-compatible embedding providers

Note

The following table lists common examples. The ports are typical defaults. Check the configuration of your embedding server before using them.

| **Engine**                                   | **Default endpoint**                   | **Authentication**            |
| -------------------------------------------- | -------------------------------------- | ----------------------------- |
| [Ollama](https://ollama.com/)                | `http://localhost:11434/v1/embeddings` | Not required by default       |
| vLLM                                         | `http://localhost:8000/v1/embeddings`  | Not required by default       |
| llama.cpp server                             | `http://localhost:8080/v1/embeddings`  | Not required by default       |
| LM Studio                                    | `http://localhost:1234/v1/embeddings`  | Not required by default       |
| LocalAI                                      | `http://localhost:8080/v1/embeddings`  | Not required by default       |
| Hugging Face Text Embeddings Inference (TEI) | `http://localhost:8080/v1/embeddings`  | Not required by default       |
| OpenAI                                       | `https://api.openai.com/v1/embeddings` | `Authorization: Bearer <key>` |
| Azure OpenAI                                 | Deployment-specific endpoint           | `api-key: <key>`              |

## What to know before you start

Before configuring an OpenAI-compatible provider, review these settings and requirements:

| **Setting**                  | **Supported values and requirements**                                                                                                                  |
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `numDimensions`              | Optional. Must match the size of the vectors that the model returns, from `1` to `8192`. If you omit it, `mongot` uses the model’s `outputDimensions`. |
| OpenAI `dimensions` field    | Local engines commonly return vectors with a fixed dimension and may reject requests that include the OpenAI `dimensions` field.                       |
| `embedding.providerEndpoint` | The global override applies to **VOYAGE** models only. Each `OPENAI_COMPATIBLE` model defines its own `providerEndpoint` in the catalog.               |
| API key                      | Local engines can run without an API key when authentication isn’t configured.                                                                         |

For details about these settings and their defaults, see the [Automatic embedding configuration reference](https://docs.percona.com/percona-search-for-mongodb/automatic-embedding-configuration-reference.md).

## Next steps

Choose the engine you want to connect:

[Configure automatic embedding with Ollama](https://docs.percona.com/percona-search-for-mongodb/configure-automatic-embedding-ollama.md)

[Configure automatic embedding with Azure OpenAI](https://docs.percona.com/percona-search-for-mongodb/configure-automatic-embedding-openai-azure.md)

To use models hosted by Hugging Face without an OpenAI-compatible endpoint, use the dedicated `HUGGINGFACE_INFERENCE` provider:

[Configure automatic embedding with the Hugging Face Inference API](https://docs.percona.com/percona-search-for-mongodb/configure-automatic-embedding-huggingface.md)

## Learn more

- [Automated Embedding](https://www.mongodb.com/docs/vector-search/crud-embeddings/automated-embedding/)
- [How Automated Embedding Works](https://www.mongodb.com/docs/vector-search/crud-embeddings/automated-embedding/overview/)
- [How to Index Fields for Vector Search](https://www.mongodb.com/docs/vector-search/index/vector-search-type/)
