Skip to content

Embeddings & Reranking API

POST /v1/embeddings

Converts text into numerical vectors so semantic similarity becomes measurable. A typical use case is populating and searching a vector database.

ParameterTypeDescription
modelstringModel ID, e.g. vllm/release/harrier-oss-v1-0.6b
inputstring/arrayText or list of texts
Terminal window
curl -X POST https://ai.noris.de/v1/embeddings \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "vllm/release/harrier-oss-v1-0.6b",
"input": "AI infrastructure from Germany"
}'

The response contains an embedding array with the vector for each input element:

{
"object": "list",
"data": [
{ "object": "embedding", "index": 0, "embedding": [0.0123, -0.0456, "..."] }
],
"model": "vllm/release/harrier-oss-v1-0.6b",
"usage": { "prompt_tokens": 5, "total_tokens": 5 }
}

Store the vectors alongside metadata in your vector database. At search time, the query is embedded as well and compared against the stored vectors via similarity search (e.g. cosine).

POST /v1/rerank

A reranker scores query and documents pairwise, producing a more precise ranking than embedding search alone. A typical use case is the second stage of a RAG pipeline.

ParameterTypeDescription
modelstringModel ID, e.g. vllm/release/bge-reranker-v2-m3
querystringSearch query
documentsarrayList of candidate documents
top_nintegerNumber of top results to return
return_documentsbooleanInclude document text in the response
Terminal window
curl -X POST https://ai.noris.de/v1/rerank \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"model": "vllm/release/bge-reranker-v2-m3",
"query": "How does zero-data-retention work?",
"documents": [
"noris does not persist prompts.",
"The weather in Nuremberg is sunny."
],
"top_n": 2,
"return_documents": true
}'

The response contains a results array, sorted by relevance:

{
"id": "rerank-...",
"results": [
{
"index": 0,
"relevance_score": 0.98,
"document": {"text": "noris does not persist prompts."}
},
{
"index": 1,
"relevance_score": 0.03,
"document": {"text": "The weather in Nuremberg is sunny."}
}
],
"model": "vllm/release/bge-reranker-v2-m3"
}

In a RAG pipeline, vector search returns a rough candidate set; the reranker refines this ordering before the top documents are passed to the LLM.