Cohere → SIE
Cohere offers embed-v3 (asymmetric query/document embeddings) and
rerank-v3.5 (cross-encoder reranker). Both have direct SIE
equivalents.
Why migrate
Section titled “Why migrate”- Self-hosted. No API key, no per-call cost, no rate limits, no data egress.
- Embedding + reranking from one stack. Cohere bills both separately; SIE serves both from one cluster.
- Open weights. SIE serves permissive-licensed embedding models
and
BAAI/bge-reranker-v2-m3from one self-hosted stack.
What stays the same
Section titled “What stays the same”- Asymmetric query/document hint. Cohere uses
input_type="search_query"vs"search_document". SIE usesis_query=Truevsis_query=False. - Rerank shape. Query + list of docs in, sorted scores out.
- Multilingual coverage. If you picked Cohere for
embed-multilingual-v3.0, use a multilingual SIE model such asintfloat/multilingual-e5-large-instructand validate on your own labeled multilingual set before cutting over; model rankings shift by language.
Before
Section titled “Before”import osimport cohere
docs = [ "Mitochondria are the powerhouse of the cell.", "The Eiffel Tower is in Paris.",]
client = cohere.ClientV2(api_key=os.environ["COHERE_API_KEY"])
resp = client.embed( texts=["The mitochondrion is the powerhouse of the cell."], model="embed-english-v3.0", input_type="search_document", embedding_types=["float"],)vectors = resp.embeddings.float_
resp = client.rerank( model="rerank-v3.5", query="What is the powerhouse of the cell?", documents=docs, top_n=10,)import { CohereClientV2 } from "cohere-ai";
const docs = [ "Mitochondria are the powerhouse of the cell.", "The Eiffel Tower is in Paris.",];
const client = new CohereClientV2({ token: process.env.COHERE_API_KEY });
const embedResp = await client.embed({ texts: ["The mitochondrion is the powerhouse of the cell."], model: "embed-english-v3.0", inputType: "search_document", embeddingTypes: ["float"],});const vectors = embedResp.embeddings.float;
const rerankResp = await client.rerank({ model: "rerank-v3.5", query: "What is the powerhouse of the cell?", documents: docs, topN: 10,});from sie_sdk import SIEClientfrom sie_sdk.types import Item
client = SIEClient("http://localhost:8080")
texts = ["The mitochondrion is the powerhouse of the cell."]docs = [ "Mitochondria are the powerhouse of the cell.", "The Eiffel Tower is in Paris.",]
# Document side: is_query=False (or omitted)docs_result = client.encode( "NovaSearch/stella_en_400M_v5", [Item(text=t) for t in texts], is_query=False,)vectors = [r["dense"].tolist() for r in docs_result]
# Rerankresult = client.score( "BAAI/bge-reranker-v2-m3", Item(text="What is the powerhouse of the cell?"), [Item(text=d) for d in docs],)# result["scores"] is sorted by relevance desc; each entry has item_id and score.import { SIEClient } from "@superlinked/sie-sdk";
const client = new SIEClient("http://localhost:8080");
const texts = ["The mitochondrion is the powerhouse of the cell."];const docs = [ "Mitochondria are the powerhouse of the cell.", "The Eiffel Tower is in Paris.",];
// Document side: isQuery=false (or omitted)const docsResult = await client.encode( "NovaSearch/stella_en_400M_v5", texts.map(t => ({ text: t })), { isQuery: false },);const vectors = docsResult.map(r => Array.from(r.dense ?? []));
// Rerankconst result = await client.score( "BAAI/bge-reranker-v2-m3", { text: "What is the powerhouse of the cell?" }, docs.map(d => ({ text: d })),);// result.scores is sorted by relevance desc; each entry has itemId and score.
await client.close();Mapping
Section titled “Mapping”| Cohere | SIE equivalent |
|---|---|
embed-english-v3.0 | NovaSearch/stella_en_400M_v5 |
embed-multilingual-v3.0 | intfloat/multilingual-e5-large-instruct |
embed-english-light-v3.0 | intfloat/e5-small-v2 |
input_type="search_query" | client.encode(..., is_query=True) |
input_type="search_document" | client.encode(..., is_query=False) |
rerank-v3.5 / rerank-english-v3.0 | BAAI/bge-reranker-v2-m3 or jinaai/jina-reranker-v2-base-multilingual |
rerank-multilingual-v3.0 | BAAI/bge-reranker-v2-m3 |
Score range caveat
Section titled “Score range caveat”Cohere returns calibrated relevance scores in roughly the [0, 1] range.
SIE’s score() returns raw model-native scores from the cross-encoder,
which for bge-reranker-v2-m3 are logits (any real number; sigmoid
to get a probability if you need [0,1]). The ordering is what
matters for reranking; don’t compare absolute scores across the two
providers.
Re-embed required?
Section titled “Re-embed required?”Yes. Cohere’s embed-v3 and SIE’s catalog embedding models
produce vectors in unrelated spaces, even at matched dimensions.
Run it yourself
Section titled “Run it yourself”mise run serve -- -m NovaSearch/stella_en_400M_v5,BAAI/bge-reranker-v2-m3export COHERE_API_KEY=...uv add cohereRun the Cohere ‘before’ and SIE ‘after’ snippets from this page on a small slice of your own corpus. Compare embeddings and rerank ordering.