rest embedder source.
This guide requires a Cohere account with an API key.
Choose a model
Cohere offers several embedding models:| Model | Dimensions | Notes |
|---|---|---|
embed-english-v3.0 | 1,024 | Best accuracy for English content |
embed-multilingual-v3.0 | 1,024 | Best for multilingual datasets |
embed-english-light-v3.0 | 384 | Faster, lower cost for English content |
embed-multilingual-light-v3.0 | 384 | Faster, lower cost for multilingual content |
embed-english-v3.0. For multilingual content, choose embed-multilingual-v3.0. The light variants are faster and cheaper but may return slightly less accurate results.
Configure the embedder
Because Cohere uses the REST embedder source, you must define therequest and response structures that match Cohere’s API. Create the following embedder configuration:
source: must be"rest"because Cohere uses the REST embedder integrationurl: the Cohere embeddings API endpointapiKey: your Cohere API keydimensions: the number of dimensions for the chosen model (1024 forembed-english-v3.0)documentTemplate: a Liquid template that converts your documents into text for embeddingrequest: defines the structure of requests sent to Cohere, including the model and input formatresponse: tells Meilisearch where to find the embeddings in Cohere’s response
The
input_type parameter is required by Cohere’s API. Set it to "search_document" when indexing documents. Meilisearch automatically uses "search_query" for search queries.Update your index settings
Send the embedder configuration to Meilisearch:MEILISEARCH_URL with the address of your Meilisearch project, INDEX_NAME with your index name, MEILISEARCH_KEY with your Meilisearch API key, and COHERE_API_KEY with your Cohere API key.
Meilisearch will start generating embeddings for all documents in the index. Monitor progress through the task queue.
Test the embedder
Once indexing is complete, perform a search using thehybrid parameter:
semanticRatio of 0.5 returns a balanced mix of keyword and semantic results. Adjust this value based on your needs.
Next steps
Full Cohere guide
In-depth guide with advanced configuration options
Choose an embedder
Compare Cohere with other embedder providers