DocsInference
Embeddings & rerank
Encode queries and documents with the same embedding model, then rank the candidates by relevance. To teach a catalog model new terms from labeled examples, see Native BGE training.
Embeddings
curl https://ragnarok-ai.com/api/v1/embeddings \
-H "Authorization: Bearer sk-ft-…" \
-H "Content-Type: application/json" \
-d '{
"model": "BAAI/bge-m3",
"input": ["first passage", "second passage"]
}'Working embedding models are BGE-M3, BGE Small, and BGE Base. Billed at $0.0041 per 1M tokens.
Rerank
curl https://ragnarok-ai.com/api/v1/rerank \
-H "Authorization: Bearer sk-ft-…" \
-H "Content-Type: application/json" \
-d '{
"model": "BAAI/bge-reranker-base",
"query": "how do I reset my password?",
"documents": ["…", "…", "…"],
"top_n": 3
}'
# → results ordered by relevance, each with an index and scoreUse rerank as a second stage after vector search: retrieve 50 candidates with embeddings, rerank, then send the selected passages as context in a chat request.