Managed Inference and Agent API with Cohere Embed Multilingual
Last updated January 29, 2025
This article is a work in progress, or documents a feature that is not yet released to all users. This article is unlisted. Only those with the link can access it.
Table of Contents
The Heroku Managed Inference and Agent add-on is currently in pilot. The products offered as part of the pilot aren’t intended for production use and are considered as a Beta Service and are subject to the Beta Services terms at https://www.salesforce.com/company/legal/agreements.jsp.
Cohere Embed Multilingual is an advanced embedding model designed to convert text into dense vector representations across multiple languages. These resulting vectors can be compared to accomplish various goals like similarity.
- Model ID:
cohere-embed-multilingual
- Regions:
us
,eu
When to Use This Model
Cohere Embed Multilingual is ideal for Retrieval-Augmented Generation (RAG) tasks, where you need to search and retrieve relevant documents based on natural-language queries. This model is also useful for building recommendation systems and classification tools that require consistent text embeddings.
Usage
Cohere Embed Multilingual follows our Cohere v1/embeddings API schema.
To provision access to the model, attach cohere-embed-multilingual
to your app $APP_NAME
:
heroku ai:models:create -a $APP_NAME cohere-embed-multilingual --as EMBEDDING
Using config variables, you can invoke cohere-embed-multilingual
in a variety of ways:
- Heroku CLI
ai
plugin (heroku ai:models:call
) - curl
- Python
- Ruby
- JavaScript
Example curl Request
Get started quickly with an example request:
export EMBEDDING_MODEL_ID=$(heroku config:get -a $APP_NAME EMBEDDING_MODEL_ID)
export EMBEDDING_KEY=$(heroku config:get -a $APP_NAME EMBEDDING_KEY)
export EMBEDDING_URL=$(heroku config:get -a $APP_NAME EMBEDDING_URL)
curl $EMBEDDING_URL/v1/embeddings \
-H "Authorization: Bearer $EMBEDDING_KEY" \
-d @- <<EOF
{
"input": ["Hello, I am a blob of text.", "How's the weather in Portland?"],
"model": "$EMBEDDING_MODEL_ID",
"input_type": "search_document",
"encoding_format": "raw"
}
EOF