AI on demand: BAAI/bge-reranker-v2-m3: Difference between revisions

From MediaWiki
Jump to navigation Jump to search
(Created page with "== Calling the model == <syntaxhighlight lang="bash"> # Set your personal key: STONEY_KEY=sk-... # Set the desired model: MODEL=BAAI/bge-reranker-v2-m3 curl -s https://llm.stoney-cloud.com/v1/rerank \ -H "Authorization: Bearer $STONEY_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "'"$MODEL"'", "query": "Which Swiss ski resorts are best for beginners?", "documents": [...")
 
No edit summary
 
Line 7: Line 7:
MODEL=BAAI/bge-reranker-v2-m3
MODEL=BAAI/bge-reranker-v2-m3


curl -s https://llm.stoney-cloud.com/v1/rerank \
curl https://llm.stoney-cloud.com/v1/rerank \
         -H "Authorization: Bearer $STONEY_KEY" \
         --silent --fail --show-error \
         -H 'Content-Type: application/json' \
        --header "Authorization: Bearer $STONEY_KEY" \
         -d '{
         --header 'Content-Type: application/json' \
         --data '{
                 "model": "'"$MODEL"'",
                 "model": "'"$MODEL"'",
                 "query": "Which Swiss ski resorts are best for beginners?",
                 "query": "Which Swiss ski resorts are best for beginners?",

Latest revision as of 11:49, 7 May 2026

Calling the model

# Set your personal key:
STONEY_KEY=sk-...

# Set the desired model:
MODEL=BAAI/bge-reranker-v2-m3

curl https://llm.stoney-cloud.com/v1/rerank \
        --silent --fail --show-error \
        --header "Authorization: Bearer $STONEY_KEY" \
        --header 'Content-Type: application/json' \
        --data '{
                "model": "'"$MODEL"'",
                "query": "Which Swiss ski resorts are best for beginners?",
                "documents": [
                        "Zermatt offers challenging slopes and views of the Matterhorn.",
                        "Grindelwald has beginner-friendly slopes and good ski schools.",
                        "St. Moritz is known for luxury skiing and advanced runs.",
                        "Arosa provides gentle slopes ideal for beginners and families."
                ]
        }' \
        | jq

Example output:

{
  "id": "score-b22e866ab7c49d40",
  "model": "BAAI/bge-reranker-v2-m3",
  "usage": {
    "prompt_tokens": 119,
    "total_tokens": 119
  },
  "results": [
    {
      "index": 1,
      "document": {
        "text": "Grindelwald has beginner-friendly slopes and good ski schools.",
        "multi_modal": null
      },
      "relevance_score": 0.319301038980484
    },
    {
      "index": 3,
      "document": {
        "text": "Arosa provides gentle slopes ideal for beginners and families.",
        "multi_modal": null
      },
      "relevance_score": 0.050355106592178345
    },
    {
      "index": 2,
      "document": {
        "text": "St. Moritz is known for luxury skiing and advanced runs.",
        "multi_modal": null
      },
      "relevance_score": 0.01756473444402218
    },
    {
      "index": 0,
      "document": {
        "text": "Zermatt offers challenging slopes and views of the Matterhorn.",
        "multi_modal": null
      },
      "relevance_score": 0.013464285060763359
    }
  ]
}