概要
Reranker
クエリと候補ドキュメントを入力に、関連度スコアで並び替える。RAG パイプラインの末端、検索結果の精度改善、FAQ マッチング、商品検索の精度向上などに使う。
- エンドポイント
- /v1/rerank
- 例: モデル
- bge-reranker-v2-m3
API
API サンプル
# 1) discover an online reranker — Grid's set changes constantly,
# don't hardcode an id in your code.
MODEL=$(curl -s https://api.openalchemy.io/v1/models \
-H "Authorization: Bearer $OPENALCHEMY_API_KEY" \
| jq -r '.data[] | select(.online and .endpoint_type=="rerank") | .id' \
| head -1)
# 2) rerank — results come back as {index, relevance_score},
# index points into your documents array
curl https://api.openalchemy.io/v1/rerank \
-H "Authorization: Bearer $OPENALCHEMY_API_KEY" \
-H "X-Project-Id: $YOUR_PROJECT_ID" \
-H "Content-Type: application/json" \
-d "{
\"model\": \"$MODEL\",
\"query\": \"Where is the best ramen in Tokyo?\",
\"documents\": [
\"Ichiran has 24-hour shops in Shibuya.\",
\"Tsuta in Sugamo holds a Michelin star.\",
\"The Tsukiji market is famous for sushi.\",
\"Afuri serves yuzu shio ramen in Ebisu.\"
],
\"top_n\": 4
}"ステータス
クォータ/料金(プロジェクト粒度)
利用枠とレート制限は API キーを発行したプロジェクトに対して適用される。さらにドメイン単位の細粒度ポリシーで、特定オリジンからの呼び出しを制限できる。
START TODAY
推論コストを、錬金術にかける準備はできていますか。
登録するだけで 2,000 クレジット($2 相当)を無料で付与。クレジットカードは不要。