SFR Embedding 2 R
An open embedding model that finds passages by meaning. Salesforce/SFR-Embedding-2_R
- Accuracy
0.586
8 retrieval sets, mean nDCG@10
- Time per request
Not timed one request at a time
- Serverless price
Call it
from sie_sdk import SIEClientclient = SIEClient("http://localhost:8080")query = "queryHow do I keep my vector index fresh as documents change?"documents = [ "document 1Incremental indexing re-embeds only the changed documents.", "document 2A reranker reorders the shortlist for higher precision.", "document 3Dense embeddings put similar meanings close together.", "document 4Cron the encode job nightly to re-vectorise edited rows.", "document 5GPU price per hour depends on your cloud provider.",]model = "modelSalesforce/SFR-Embedding-2_R"q = client.encode(model, [{"text": query}], is_query=True)[0]["dense"]docs = client.encode(model, [{"text": d} for d in documents])print(q)print([v["dense"] for v in docs])import { SIEClient } from '@superlinked/sie-sdk';
const client = new SIEClient('http://localhost:8080');
const query = "How do I keep my vector index fresh as documents change?";
const documents = [
"Incremental indexing re-embeds only the changed documents.",
"A reranker reorders the shortlist for higher precision.",
"Dense embeddings put similar meanings close together.",
"Cron the encode job nightly to re-vectorise edited rows.",
"GPU price per hour depends on your cloud provider.",
];
const model = 'Salesforce/SFR-Embedding-2_R';
const [queryVector] = await client.encode(model, [{ text: query }], { outputTypes: ['dense'], isQuery: true });
const documentVectors = await client.encode(model, documents.map((text) => ({ text })), { outputTypes: ['dense'] });
console.log(queryVector?.dense);
console.log(documentVectors.map((vector) => vector.dense));# Encode the query with is_query, then the candidate documents.
curl http://localhost:8080/v1/encode/Salesforce%2FSFR-Embedding-2_R \
-H "Content-Type: application/json" \
-d "{\"items\":[{\"text\":\"How do I keep my vector index fresh as documents change?\"}],\"params\":{\"output_types\":[\"dense\"],\"options\":{\"is_query\":true}}}"
curl http://localhost:8080/v1/encode/Salesforce%2FSFR-Embedding-2_R \
-H "Content-Type: application/json" \
-d "{\"items\":[{\"text\":\"Incremental indexing re-embeds only the changed documents.\"},{\"text\":\"A reranker reorders the shortlist for higher precision.\"},{\"text\":\"Dense embeddings put similar meanings close together.\"},{\"text\":\"Cron the encode job nightly to re-vectorise edited rows.\"},{\"text\":\"GPU price per hour depends on your cloud provider.\"}],\"params\":{\"output_types\":[\"dense\"]}}"Build the "Search" capability into my app using the Superlinked Inference Engine (SIE).
Context
- SIE is an OpenAI-style inference API. Python SDK: `from sie_sdk import SIEClient`; TypeScript: `@superlinked/sie-sdk`.
- Base URL: http://localhost:8080, my own SIE server, which takes no API key.
- Model: Salesforce/SFR-Embedding-2_R (SIE primitive: /encode). Keep the model id configurable.
Task
- Input: a query string plus a list of candidate documents.
- Behaviour: return the native dense vectors for the query and candidate documents
- Send two POST /v1/encode requests: one item {text: query} with params {output_types: ["dense"], options: {is_query: true}}, then all candidate documents with params {output_types: ["dense"]}. Return the decoded dense vectors in input order. In Python, use encode(..., is_query=True) only for the query call and read each returned ["dense"] array. In TypeScript, use client.encode with outputTypes: ["dense"] for both calls and isQuery: true only for the query, then read each returned .dense array. Native output is vectors; the page computes cosine ranking from its recorded vectors. Keep ranking logic outside the API example. Do not issue one request per candidate.
Deliverables
- A typed client wrapper, an application-level function for this task, error handling for timeouts/empty input, and unit tests with a stubbed client.
- Wire it into my existing stack (ask me which framework if unclear) and add a short usage example. Edit the code and run it live Sign up to run this example.
Get started no credit card required
Next to the other embedding models
| Model | 8 retrieval sets, mean nDCG@10 | Time per request | Serverless price | Size |
|---|---|---|---|---|
| SFR Embedding 2 R Salesforce | 0.586 | Not timed | Run in your cloud | 7.1B |
| Qwen3 Embedding 4B Qwen | 0.599 | Not timed | $0.06 per 1M tokens | 4.0B |
| Qwen3 Embedding 8B Qwen | 0.620 | Not timed | Run in your cloud | 7.6B |
| stella en 1.5B v5 NovaSearch | 0.583 | Not timed | Run in your cloud | 1.5B |
| Linq Embed Mistral Linq-AI-Research | 0.576 | Not timed | Run in your cloud | 7.1B |
Measured on public datasets
| Dataset | nDCG@10 |
|---|---|
| Stack | 0.941 |
| Sci | 0.856 |
| Legal | 0.783 |
| Nano | 0.647 |
| Fi | 0.620 |
| CQADupstack | 0.526 |
| NFCorpus | 0.414 |
| Cos | 0.296 |
| SCIDOCS | 0.249 |
Facts
- Size
- 7.1B parameters
- License
- CC-BY-NC-4.0
- Reads
- Text, up to 32,768 tokens
- Endpoint
-
encode
Evaluation
- Accuracy
- Run on SIE against the public dataset named in each figure
- 8 retrieval sets
- The mean over NFCorpus, FiQA2018, SciFact, SCIDOCS, CQADupstackPhysicsRetrieval, CosQA, StackOverflowQA and LegalBenchConsumerContractsQA
- Prices
- Serverless list prices, effective 10 Nov 2026
Run SFR Embedding 2 R in your own cloud, or start on Serverless
SIE Serverless
We host the models; you call one API.
- No idle GPUs, pay for what you use
- Fits your stack: SDK, API, CLI, MCP
- Self-host the same open-source engine
- SOC 2 Type 2, US or EU data residency
- Create an account to try Serverless
SIE Cluster
Kubernetes in your own cloud, backed by our engineers.
- Terraform modules for your cloud
- Apache-2.0, same engine as Serverless
- GPU workers scale to zero between jobs
- Separate worker pools for each tenant
Agent prompt
Deploy SIE to our AWS account with the superlinked/sie/aws Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Google Cloud project with the superlinked/sie/google Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Azure subscription with the superlinked/sie/azure Terraform module. Docs: superlinked.com/docs/deployment.Deploy SIE to our Alibaba Cloud account with the superlinked/sie/alicloud Terraform module. Docs: superlinked.com/docs/deployment. SIE Local
The open-source server on your own machine.
- NVIDIA GPU
- One container, no cluster
- Process your data fully offline
- Same SDK and model IDs as Serverless
docker run --gpus all -p 8080:8080 -e SIE_BUNDLE=sglang-embedding ghcr.io/superlinked/sie-server:latest-cuda12-sglang