diff --git a/solutions/search/semantic-search/semantic-search-inference.md b/solutions/search/semantic-search/semantic-search-inference.md index d2482f1804..243bf7547f 100644 --- a/solutions/search/semantic-search/semantic-search-inference.md +++ b/solutions/search/semantic-search/semantic-search-inference.md @@ -39,36 +39,44 @@ Click the name of the service you want to use on any of the widgets below to rev ## Requirements [infer-service-requirements] :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere A [Cohere account](https://cohere.com/) is required to use the {{infer}} API with the Cohere service. :::::: ::::::{tab-item} ELSER +:sync: elser ELSER is a model trained by Elastic. If you have an {{es}} deployment, there is no further requirement for using the {{infer}} API with the `elasticsearch` service. :::::: ::::::{tab-item} HuggingFace +:sync: huggingface A [HuggingFace account](https://huggingface.co/) is required to use the {{infer}} API with the HuggingFace service. :::::: ::::::{tab-item} OpenAI +:sync: openai An [OpenAI account](https://openai.com/) is required to use the {{infer}} API with the OpenAI service. :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai * An [Azure subscription](https://azure.microsoft.com/free/cognitive-services?azure-portal=true) * Access granted to Azure OpenAI in the desired Azure subscription. You can apply for access to Azure OpenAI by completing the form at [https://aka.ms/oai/access](https://aka.ms/oai/access). * An embedding model deployed in [Azure OpenAI Studio](https://oai.azure.com/). :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio * An [Azure subscription](https://azure.microsoft.com/free/cognitive-services?azure-portal=true) * Access to [Azure AI Studio](https://ai.azure.com/) * A deployed [embeddings](https://ai.azure.com/explore/models?selectedTask=embeddings) or [chat completion](https://ai.azure.com/explore/models?selectedTask=chat-completion) model. :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai * A [Google Cloud account](https://console.cloud.google.com/) * A project in Google Cloud * The Vertex AI API enabled in your project @@ -77,16 +85,19 @@ An [OpenAI account](https://openai.com/) is required to use the {{infer}} API wi :::::: ::::::{tab-item} Mistral +:sync: mistral * A Mistral Account on [La Plateforme](https://console.mistral.ai/) * An API key generated for your account :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock * An AWS Account with [Amazon Bedrock](https://aws.amazon.com/bedrock/) access * A pair of access and secret keys used to access Amazon Bedrock :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search * An AlibabaCloud Account with [AlibabaCloud](https://console.aliyun.com) access * An API key generated for your account from the [API keys section](https://opensearch.console.aliyun.com/cn-shanghai/rag/api-key) :::::: @@ -98,8 +109,10 @@ An [OpenAI account](https://openai.com/) is required to use the {{infer}} API wi Create an {{infer}} endpoint by using the [Create {{infer}} API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-inference-put): :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere ```console PUT _inference/text_embedding/cohere_embeddings <1> { @@ -123,6 +136,7 @@ When using this model the recommended similarity measure to use in the `dense_ve :::::: ::::::{tab-item} ELSER +:sync: elser ```console PUT _inference/sparse_embedding/elser_embeddings <1> { @@ -146,6 +160,7 @@ You might see a 502 bad gateway error in the response when using the {{kib}} Con :::::: ::::::{tab-item} HuggingFace +:sync: huggingface First, you need to create a new {{infer}} endpoint on [the Hugging Face endpoint page](https://ui.endpoints.huggingface.co/) to get an endpoint URL. Select the model `all-mpnet-base-v2` on the new endpoint creation page, then select the `Sentence Embeddings` task under the Advanced configuration section. Create the endpoint. Copy the URL after the endpoint initialization has been finished, you need the URL in the following {{infer}} API call. ```console @@ -165,6 +180,7 @@ PUT _inference/text_embedding/hugging_face_embeddings <1> :::::: ::::::{tab-item} OpenAI +:sync: openai ```console PUT _inference/text_embedding/openai_embeddings <1> { @@ -187,6 +203,7 @@ When using this model the recommended similarity measure to use in the `dense_ve :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai ```console PUT _inference/text_embedding/azure_openai_embeddings <1> { @@ -212,6 +229,7 @@ It may take a few minutes for your model’s deployment to become available afte :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio ```console PUT _inference/text_embedding/azure_ai_studio_embeddings <1> { @@ -238,6 +256,7 @@ It may take a few minutes for your model’s deployment to become available afte :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai ```console PUT _inference/text_embedding/google_vertex_ai_embeddings <1> { @@ -259,6 +278,7 @@ PUT _inference/text_embedding/google_vertex_ai_embeddings <1> :::::: ::::::{tab-item} Mistral +:sync: mistral ```console PUT _inference/text_embedding/mistral_embeddings <1> { @@ -276,6 +296,7 @@ PUT _inference/text_embedding/mistral_embeddings <1> :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock ```console PUT _inference/text_embedding/amazon_bedrock_embeddings <1> { @@ -299,6 +320,7 @@ PUT _inference/text_embedding/amazon_bedrock_embeddings <1> :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search ```console PUT _inference/text_embedding/alibabacloud_ai_search_embeddings <1> { @@ -326,8 +348,10 @@ PUT _inference/text_embedding/alibabacloud_ai_search_embeddings <1> The mapping of the destination index - the index that contains the embeddings that the model will create based on your input text - must be created. The destination index must have a field with the [`dense_vector`](elasticsearch://reference/elasticsearch/mapping-reference/dense-vector.md) field type for most models and the [`sparse_vector`](elasticsearch://reference/elasticsearch/mapping-reference/sparse-vector.md) field type for the sparse vector models like in the case of the `elasticsearch` service to index the output of the used model. :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere ```console PUT cohere-embeddings { @@ -354,6 +378,7 @@ PUT cohere-embeddings :::::: ::::::{tab-item} ELSER +:sync: elser ```console PUT elser-embeddings { @@ -377,6 +402,7 @@ PUT elser-embeddings :::::: ::::::{tab-item} HuggingFace +:sync: huggingface ```console PUT hugging-face-embeddings { @@ -403,6 +429,7 @@ PUT hugging-face-embeddings :::::: ::::::{tab-item} OpenAI +:sync: openai ```console PUT openai-embeddings { @@ -431,6 +458,7 @@ PUT openai-embeddings :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai ```console PUT azure-openai-embeddings { @@ -459,6 +487,7 @@ PUT azure-openai-embeddings :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio ```console PUT azure-ai-studio-embeddings { @@ -487,6 +516,7 @@ PUT azure-ai-studio-embeddings :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai ```console PUT google-vertex-ai-embeddings { @@ -515,6 +545,7 @@ PUT google-vertex-ai-embeddings :::::: ::::::{tab-item} Mistral +:sync: mistral ```console PUT mistral-embeddings { @@ -543,6 +574,7 @@ PUT mistral-embeddings :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock ```console PUT amazon-bedrock-embeddings { @@ -571,6 +603,7 @@ PUT amazon-bedrock-embeddings :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search ```console PUT alibabacloud-ai-search-embeddings { @@ -603,8 +636,10 @@ PUT alibabacloud-ai-search-embeddings Create an [ingest pipeline](../../../manage-data/ingest/transform-enrich/ingest-pipelines.md) with an [{{infer}} processor](elasticsearch://reference/enrich-processor/inference-processor.md) and use the model you created above to infer against the data that is being ingested in the pipeline. :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere ```console PUT _ingest/pipeline/cohere_embeddings_pipeline { @@ -627,6 +662,7 @@ PUT _ingest/pipeline/cohere_embeddings_pipeline :::::: ::::::{tab-item} ELSER +:sync: elser ```console PUT _ingest/pipeline/elser_embeddings_pipeline { @@ -649,6 +685,7 @@ PUT _ingest/pipeline/elser_embeddings_pipeline :::::: ::::::{tab-item} HuggingFace +:sync: huggingface ```console PUT _ingest/pipeline/hugging_face_embeddings_pipeline { @@ -671,6 +708,7 @@ PUT _ingest/pipeline/hugging_face_embeddings_pipeline :::::: ::::::{tab-item} OpenAI +:sync: openai ```console PUT _ingest/pipeline/openai_embeddings_pipeline { @@ -693,6 +731,7 @@ PUT _ingest/pipeline/openai_embeddings_pipeline :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai ```console PUT _ingest/pipeline/azure_openai_embeddings_pipeline { @@ -715,6 +754,7 @@ PUT _ingest/pipeline/azure_openai_embeddings_pipeline :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio ```console PUT _ingest/pipeline/azure_ai_studio_embeddings_pipeline { @@ -737,6 +777,7 @@ PUT _ingest/pipeline/azure_ai_studio_embeddings_pipeline :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai ```console PUT _ingest/pipeline/google_vertex_ai_embeddings_pipeline { @@ -759,6 +800,7 @@ PUT _ingest/pipeline/google_vertex_ai_embeddings_pipeline :::::: ::::::{tab-item} Mistral +:sync: mistral ```console PUT _ingest/pipeline/mistral_embeddings_pipeline { @@ -781,6 +823,7 @@ PUT _ingest/pipeline/mistral_embeddings_pipeline :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock ```console PUT _ingest/pipeline/amazon_bedrock_embeddings_pipeline { @@ -803,6 +846,7 @@ PUT _ingest/pipeline/amazon_bedrock_embeddings_pipeline :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search ```console PUT _ingest/pipeline/alibabacloud_ai_search_embeddings_pipeline { @@ -840,8 +884,10 @@ Download the file and upload it to your cluster using the [Data Visualizer](../. Create embeddings from the text by reindexing the data through the {{infer}} pipeline that uses your chosen model. This step uses the [reindex API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex) to simulate data ingestion through a pipeline. :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere ```console POST _reindex?wait_for_completion=false { @@ -865,6 +911,7 @@ The [rate limit of your Cohere account](https://dashboard.cohere.com/billing) ma :::::: ::::::{tab-item} ELSER +:sync: elser ```console POST _reindex?wait_for_completion=false { @@ -883,6 +930,7 @@ POST _reindex?wait_for_completion=false :::::: ::::::{tab-item} HuggingFace +:sync: huggingface ```console POST _reindex?wait_for_completion=false { @@ -901,6 +949,7 @@ POST _reindex?wait_for_completion=false :::::: ::::::{tab-item} OpenAI +:sync: openai ```console POST _reindex?wait_for_completion=false { @@ -924,6 +973,7 @@ The [rate limit of your OpenAI account](https://platform.openai.com/account/limi :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai ```console POST _reindex?wait_for_completion=false { @@ -947,6 +997,7 @@ The [rate limit of your Azure OpenAI account](https://learn.microsoft.com/en-us/ :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio ```console POST _reindex?wait_for_completion=false { @@ -970,6 +1021,7 @@ Your Azure AI Studio model deployment may have rate limits in place that might a :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai ```console POST _reindex?wait_for_completion=false { @@ -988,6 +1040,7 @@ POST _reindex?wait_for_completion=false :::::: ::::::{tab-item} Mistral +:sync: mistral ```console POST _reindex?wait_for_completion=false { @@ -1006,6 +1059,7 @@ POST _reindex?wait_for_completion=false :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock ```console POST _reindex?wait_for_completion=false { @@ -1024,6 +1078,7 @@ POST _reindex?wait_for_completion=false :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search ```console POST _reindex?wait_for_completion=false { @@ -1065,8 +1120,10 @@ If you cancelled the reindexing process, you run the query only a part of the da :::::::{tab-set} +:group: service ::::::{tab-item} Cohere +:sync: cohere ```console GET cohere-embeddings/_search { @@ -1134,6 +1191,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} ELSER +:sync: elser ```console GET elser-embeddings/_search { @@ -1188,6 +1246,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} HuggingFace +:sync: huggingface ```console GET hugging-face-embeddings/_search { @@ -1255,6 +1314,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} OpenAI +:sync: openai ```console GET openai-embeddings/_search { @@ -1313,6 +1373,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} Azure OpenAI +:sync: azure-openai ```console GET azure-openai-embeddings/_search { @@ -1371,6 +1432,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} Azure AI Studio +:sync: azure-ai-studio ```console GET azure-ai-studio-embeddings/_search { @@ -1429,6 +1491,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} Google Vertex AI +:sync: google-vertex-ai ```console GET google-vertex-ai-embeddings/_search { @@ -1487,6 +1550,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} Mistral +:sync: mistral ```console GET mistral-embeddings/_search { @@ -1545,6 +1609,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} Amazon Bedrock +:sync: amazon-bedrock ```console GET amazon-bedrock-embeddings/_search { @@ -1603,6 +1668,7 @@ As a result, you receive the top 10 documents that are closest in meaning to the :::::: ::::::{tab-item} AlibabaCloud AI Search +:sync: alibabacloud-ai-search ```console GET alibabacloud-ai-search-embeddings/_search {