Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Embeddings and reranking

MiRMiR discovers the task from the checkpoint structure. A generation model cannot be used as an embedding or sequence-scoring model.

Embeddings

curl http://127.0.0.1:8080/v1/embeddings \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "embedding",
    "input": ["first text", "second text"],
    "encoding_format": "float"
  }'
FieldTypeNotes
modelstringLoaded embedding model.
inputstring or string[]One input or an ordered batch.
dimensionsintegerOptional prefix dimension, capped by the native size.
prompt_namestringOptional prompt preset declared by the checkpoint.
encoding_formatstringOnly float is supported.

The output follows the OpenAI list shape and returns normalized f32 vectors plus prompt token usage.

Reranking

curl http://127.0.0.1:8080/v1/rerank \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "reranker",
    "query": "native inference",
    "documents": ["Rust and Metal", "a hosted Python service"],
    "return_documents": true
  }'
FieldTypeNotes
modelstringLoaded sequence-scoring model.
querystringRequired non-empty query.
documentsstring[]Required non-empty candidate list.
max_lengthintegerPair token limit, capped by model context.
raw_scoresbooleanReturn logits instead of logistic relevance scores.
return_documentsbooleanInclude each original document in results.

Results are sorted from highest to lowest relevance while retaining the original document index.