77trust / 100

Quantization Advice

by denk.halowerk.com in AI models & inference

x402 APIPassing, checked 31 min ago

Pick the llama.cpp quantization (GGUF file type) with the best published quality that fits your GPU memory, optionally with CPU offload, and list all candidates with sizes and perplexity cost. For every llama.cpp file type, weights = parameters × effective bits per weight (measured on Llama-3.1-8B, tools/quantize/README.md, commit ad1b88c) plus KV cache and overhead (same formulas as vram-estimate) are compared with the memory budget.

POST
https://denk.halowerk.com/v1/quantization-advice
Price
$0.003
per call in USDC
Uptime
96.0%
last 30 days
Response time
130 ms
174 ms slowest 5%
Last check
Passed
31 min ago, next any minute now

Run a free test callHow to call it

Reliability

All checks passedSome failedAll failedNot checked

Status and outage history · Atom feed · Watch with other listings

How to call it

POST https://denk.halowerk.com/v1/quantization-advice

Each call costs $0.003 in USDC on Base, paid with the request over x402.

Run a free test callOne unpaid request, the way an agent sends it. You see the payment challenge it gets back. Nothing is charged.

Example request

From the listing.

POST https://denk.halowerk.com/v1/quantization-advice
content-type: application/json

{
  "head_dim": 128,
  "min_quality": "high",
  "n_kv_heads": 8,
  "n_layers": 32,
  "params_b": 8.03,
  "vram_gib": 8
}

Parameters

ParameterTypeRequiredDescription
allow_imatrixbooleanNo Default: true.
batchintegerNo Default: 1.
context_tokensintegerNo Default: 4096.
gpustringNo One of: h100-sxm, h100-nvl, h200-sxm, h200-nvl, a100-80gb-sxm, a100-80gb-pcie, a100-40gb-sxm, a100-40gb-pcie, l40s, l40, l4, a10.
head_dimintegerNo
hf_modelstringNo
hidden_sizeintegerNo
kv_cache_typestringNo One of: f32, f16, bf16, fp8, q8_0, q5_1, q5_0, q4_1, q4_0, iq4_nl. Default: "f16".
min_qualitystringNo One of: near_lossless, high, balanced, any. Default: "balanced".
n_gpusintegerNo Default: 1.
n_headsintegerNo
n_kv_headsintegerNo
n_layersintegerNo
overhead_gibnumberNo Default: 0.5.
params_bnumberNo
ram_gibnumberNo
vocab_sizeintegerNo
vram_gibnumberNo

Example response

The provider's example. We can't check it without paying.

Example response, 85 lines
{
  "limitations": [
    "Perplexity deltas were measured on Llama-3(.1)-8B; smaller models usually lose m…",
    "Partial CPU offload is much slower than full GPU placement.",
    "Memory figures are formula estimates."
  ],
  "result": {
    "accepted_tiers": [
      "near_lossless",
      "high"
    ],
    "candidates": [
      {
        "bpw_source": "measured (Llama-3.1-8B)",
        "effective_bpw": 16.0005,
        "fits_gpu": false,
        "fits_with_offload": false,
        "ppl_increase": 0.002,
        "ppl_reference": "Mistral-7B",
        "quant": "F16",
        "requires_imatrix": false,
        "tier": "near_lossless",
        "total_gib": 15.958,
        "weights_gib": 14.958
      },
      {
        "bpw_source": "tensor type",
        "effective_bpw": 16,
        "fits_gpu": false,
        "fits_with_offload": false,
        "ppl_increase": -0.005,
        "ppl_reference": "Mistral-7B",
        "quant": "BF16",
        "requires_imatrix": false,
        "tier": "near_lossless",
        "total_gib": 15.957,
        "weights_gib": 14.957
      },
      {
        "bpw_source": "measured (Llama-3.1-8B)",
        "effective_bpw": 8.5008,
        "fits_gpu": false,
        "fits_with_offload": false,
        "ppl_increase": 0.0026,
        "ppl_reference": "Llama-3-8B",
        "quant": "Q8_0",
        "requires_imatrix": false,
        "tier": "near_lossless",
        "total_gib": 8.947,
        "weights_gib": 7.947
      }
    ],
    "memory_budget_gib": {
      "gpu": 8,
      "ram": 0
    },
    "model": {
      "kv_cache_gib": 0.5,
      "overhead_gib": 0.5,
      "parameters": 8029999999.999999,
      "source": "input"
    },
    "recommendation": {
      "bpw_source": "measured (Llama-3.1-8B)",
      "effective_bpw": 6.5633,
      "fits_gpu": true,
      "fits_with_offload": false,
      "method": "lowest published perplexity increase that fits in GPU memory",
      "placement": "gpu",
      "ppl_increase": 0.0217,
      "ppl_reference": "Llama-3-8B",
      "quant": "Q6_K",
      "requires_imatrix": false,
      "tier": "near_lossless",
      "total_gib": 7.135,
      "weights_gib": 6.135
    },
    "sources": [
      "https://github.com/ggml-org/llama.cpp/blob/ad1b88ca0d37a2171efba1c04f1a3531c78f1…",
      "https://github.com/ggml-org/llama.cpp/blob/732707dff265be513347b02911e1dd18f7e1f…"
    ]
  },
  "service": "quantization-advice",
  "status": "success"
}

Call it from code

The curl command shows the payment challenge. The JavaScript and Python versions pay and call, and never pay more than $0.003.

curl: see the payment challenge
# bash or zsh: see the payment challenge. Nothing is charged.
curl -sS -g -i -X POST 'https://denk.halowerk.com/v1/quantization-advice' \
  -H 'content-type: application/json' \
  --data-raw '{"head_dim":128,"min_quality":"high","n_kv_heads":8,"n_layers":32,"params_b":8.03,"vram_gib":8}'

# x402 v2 sends the challenge base64-encoded in the PAYMENT-REQUIRED header (v1 sends it in the body).
# To read the header:
curl -sS -g -o /dev/null -D - -X POST 'https://denk.halowerk.com/v1/quantization-advice' \
  -H 'content-type: application/json' \
  --data-raw '{"head_dim":128,"min_quality":"high","n_kv_heads":8,"n_layers":32,"params_b":8.03,"vram_gib":8}' \
  | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 --decode
JavaScript: pay and call
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

// Pays at most $0.003 per call.
const client = new x402Client().setSpendControls({ maxAmountPerPayment: "$0.003" });
registerExactEvmScheme(client, { signer: privateKeyToAccount(process.env.EVM_PRIVATE_KEY) });
const pay = wrapFetchWithPayment(fetch, client);

// Not sure it's safe to pay? ToolVet checks it first for $0.005. Pay for that from a separate
// client: this one is capped at $0.003 per payment. GET https://toolvet.app/api/v1/check?url=https%3A%2F%2Fdenk.halowerk.com%2Fv1%2Fquantization-advice&method=POST
const res = await pay("https://denk.halowerk.com/v1/quantization-advice", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({
    "head_dim": 128,
    "min_quality": "high",
    "n_kv_heads": 8,
    "n_layers": 32,
    "params_b": 8.03,
    "vram_gib": 8
  }),
});
console.log(res.status, await res.text());
Python: pay and call
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.http.clients import x402_requests
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

# Pays at most $0.003 per call.
client = x402ClientSync().set_spend_controls({"max_amount_per_payment": "$0.003"})
register_exact_evm_client(client, EthAccountSigner(Account.from_key(os.environ["EVM_PRIVATE_KEY"])))

with x402_requests(client) as session:
    res = session.post(
        "https://denk.halowerk.com/v1/quantization-advice",
        json={
            "head_dim": 128,
            "min_quality": "high",
            "n_kv_heads": 8,
            "n_layers": 32,
            "params_b": 8.03,
            "vram_gib": 8,
        },
    )
    print(res.status_code, res.text)

Security scan

No findings

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

Recent checks

WhenResultHTTPTimePrice
31 min agoPassed402267 ms$0.003
14 h agoPassed40241 ms$0.003
3 days agoTimed out---
4 days agoPassed402126 ms$0.003
4 days agoPassed40243 ms$0.003
Show 10 older checks
5 days agoPassed402174 ms$0.003
5 days agoPassed402164 ms$0.003
5 days agoPassed402131 ms$0.003
6 days agoPassed402151 ms$0.003
6 days agoPassed402135 ms$0.003
6 days agoPassed402129 ms$0.003
7 days agoPassed402120 ms$0.003
7 days agoPassed402170 ms$0.003
7 days agoPassed402120 ms$0.003
8 days agoPassed402138 ms$0.003