Embeddings and rerank¶
Turn text into vectors with an embeddings model, or sort documents by relevance with a scoring model.
Embeddings¶
POST /v1/embeddings takes OpenAI's request and returns OpenAI's response.
curl -s https://ai.example.internal/v1/embeddings \
-H "Authorization: Bearer $FADEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model": "team-embeddings", "input": ["How do I reset the line controller?"]}'
Use a model whose kind is embeddings in /v1/models. A chat model answers with 400 model_kind_mismatch.
Rerank¶
POST /v1/rerank sorts documents by how well they answer a query, in the request shape Cohere and Jina use.
curl -s https://ai.example.internal/v1/rerank \
-H "Authorization: Bearer $FADEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "team-reranker",
"query": "How do I reset the line controller?",
"documents": ["Resetting the controller", "Ordering spare parts", "Shift handover"],
"top_n": 2,
"return_documents": true
}'
Use a model whose kind is scoring.