80trust / 100

Rerank

by Tanod mlpeek in AI models & inference

x402 APIPassing, checked 9 min ago

mlpeek (Tanod) rerank: up to 100 documents scored against a query (cross-encoder).

POST https://tanod.dev/v1/rerank

Last 30 days

All checks passedSome failedAll failedNot checked
Uptime
100%
Response time
281 ms typical, 339 ms slowest 5%
Last check
9 min ago
Next check
in 20 min

How to call it

# See the payment challenge (nothing is charged)
curl -i -X POST "https://tanod.dev/v1/rerank" \
  -H "content-type: application/json" \
  -d '{"documents":["Berlin has 3.7 million inhabitants.","Paris is the capital of France."],"query":"how many people live in berlin"}'
import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client().register(
  "eip155:8453",
  new ExactEvmScheme(privateKeyToAccount(process.env.AGENT_KEY)),
);
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? Preflight it first for $0.005:
// GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Ftanod.dev%2Fv1%2Frerank
const res = await pay("https://tanod.dev/v1/rerank", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"documents":["Berlin has 3.7 million inhabitants.","Paris is the capital of France."],"query":"how many people live in berlin"}),
});
console.log(await res.json());

Example input

{
  "documents": [
    "Berlin has 3.7 million inhabitants.",
    "Paris is the capital of France."
  ],
  "query": "how many people live in berlin"
}

Example output

{
  "max_tokens_per_pair": 512,
  "model": {
    "id": "ms-marco-MiniLM-L6-v2",
    "license": "Apache-2.0",
    "revision": "233902d25c440f23af6f7d6e94d2946bac0bee0a",
    "source": "cross-encoder/ms-marco-MiniLM-L6-v2"
  },
  "note": "score = sigmoid(logit), a relevance in (0, 1); English model. Pairs longer than the window are truncated, longest side first (truncated: true).",
  "results": [
    {
      "index": 0,
      "logit": 8.7,
      "rank": 1,
      "score": 0.999833,
      "tokens": 17,
      "truncated": false
    },
    {
      "index": 1,
      "logit": -11.3182,
      "rank": 2,
      "score": 0.000012,
      "tokens": 16,
      "truncated": false
    }
  ],
  "usage": {
    "documents": 2,
    "tokens": 33,
    "truncated": 0
  }
}

Security scan

  • No findings. We scan names, descriptions and tool definitions for hidden instructions and other prompt-injection patterns.

Recent checks

WhenResultHTTPTimePrice
9 min agoPassed402305 ms$0.002
4 h agoPassed402273 ms$0.002
7 h agoPassed402264 ms$0.002
11 h agoPassed402281 ms$0.002
15 h agoPassed402287 ms$0.002
18 h agoPassed402338 ms$0.002
22 h agoPassed402259 ms$0.002
26 h agoPassed402339 ms$0.002
29 h agoPassed402359 ms$0.002
34 h agoPassed402271 ms$0.002