速度テストモデルベンチマークレンタルレポートハードウェアデコード計算機組織ProAPIドキュメント送信
言語
Actual Computer — Every computer, one endpoint

速度テスト

Qwen4-35B-A3B-NVFP4

RTX PRO 6000 Blackwell Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · NVFP4

puretensor検証済み2026/12/05

デコード

209tok/s

プリフィル

21.7ktok/s

最初のトークンまでの時間

130ms

合計

491tok/s

ピーク VRAM

—

コンテキスト長

40K

KV 深度

0

バッチサイズ

1

同時実行数

1

消費電力

—

検証

未検証 — 実験的な結果

検証済みの実行は標準テストプロンプトを使い、結果を確認できるだけのデータを記録しています。

  • The run did not use one of the standard test prompts.

起動コマンド

docker run --gpus all --ipc=host --shm-size 32g lmsysorg/sglang:qwen4 python3 -m sglang.launch_server --model-path RadixArk/Qwen4-35B-A3B-NVFP4 --served-model-name RadixArk/Qwen4-35B-A3B-NVFP4 --trust-remote-code --tp-size 2 --mem-fraction-static 0.6 --disable-radix-cache --max-running-requests 64 --context-length 40960 --random-seed 42

Theoretical memory ceiling

2,123.6–2,199.1 tok/s

3,584 GB/s memory bandwidth (spec sheet) · 28.50 GB model weights · 16-bit KV cache · 1–2,830 tokens of context

9–10%

of the ceiling reached

Medium confidence

The fastest this hardware's memory could serve a single request; real runs are slower. Model details from RadixArk/Qwen4-35B-A3B-NVFP4; size from NVFP4 estimate. Hardware source · Open calculator

モデル

GPU
RTX PRO 6000 Blackwell Workstation Edition
数
2
VRAM
96 GB
OS
Ubuntu 24.04.5 LTS

エンジン

エンジン
sglang
バージョン
0.5.24.dev1+gcd1dc28
Build
lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
Commit
cd1dc28
量子化
NVFP4
バックエンド
cuda
TP
2
GPUメモリ使用率
0.6
プレフィックスキャッシュ
いいえ
最大実行シーケンス数
64

実行設定

コンテキスト
40,960 トークン
深度
0 トークン
バッチサイズ
1
プロンプトトークン
2830
プリフィル tok/s
21.7K tok/s
出力トークン
2048
メモ
PureTensor lab, fox-n0: two RTX PRO 6000 Blackwell Workstation Edition cards (600 W limit), Threadripper 7970X, 256 GB RAM. SGLang official Qwen4 image, pinned by digest, TP2. Target RadixArk NVFP4 (W4A4 experts), no speculative decoding: the control for the DFlash2 arm. CPU in a performance window (boost on, performance governor, C2 off). Radix (prefix) cache off as in the drafter model card. A small reranker (2.3 GB) stayed loaded on GPU 0. Thinking off (enable_thinking=false). Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s).

記録された証跡

プロンプトハッシュ (SHA-256)
5a6b7bc1cbbc…
プロンプトサンプル · 2,000 chars
[LocalMaxxing cache-bust nonce: bc51c6318686e91a5dddb154ae6134ab]
I have a FastAPI service that receives webhook events from a payment provider and stores them in Postgres with asyncpg. The current handler:

```python
@app.post("/webhooks/payments")
async def payments_webhook(request: Request) -> dict[str, str]:
    payload = await request.json()
    if payload["type"] == "invoice.paid":
        await pool.execute(
            "INSERT INTO invoices (id, amount) VALUES ($1, $2)",
            payload["data"]["id"], payload["data"]["amount"],
        )
    return {"status": "ok"}
```

Problems: the `X-Signature` header is never verified, retried deliveries insert the same invoice twice, and any exception returns a 500 so the provider retries forever.

Rewrite this as a proper module: verify the signature with HMAC-SHA256 over the raw body and reject stale timestamps, make inserts idempotent on the event id, dispatch event types through a registry instead of if-chains, and return 2xx for event types we don't handle. Use pydantic models, full type hints, and no bare except. Include the SQL for the idempotency table and a pytest test for the signature check, then list the failure modes you would alert on.

I have a FastAPI service that receives webhook events from a payment provider and stores them in Postgres with asyncpg. The current handler:

```python
@app.post("/webhooks/payments")
async def payments_webhook(request: Request) -> dict[str, str]:
    payload = await request.json()
    if payload["type"] == "invoice.paid":
        await pool.execute(
            "INSERT INTO invoices (id, amount) VALUES ($1, $2)",
            payload["data"]["id"], payload["data"]["amount"],
        )
    return {"status": "ok"}
```

Problems: the `X-Signature` header is never verified, retried deliveries insert the same invoice twice, and any exception returns a 500 so the provider retries forever.

Rewrite this as a proper module: verify the signature with HMAC-SHA256 over the raw bod
出力サンプル · 4,000 chars
# Production-Grade Payment Webhook Handler

## 1. SQL — Idempotency Table

```sql
CREATE TABLE webhook_events (
    event_id    TEXT        PRIMARY KEY,
    event_type  TEXT        NOT NULL,
    received_at TIMESTZONE  NOT NULL DEFAULT now(),
    processed_at TIMESTAMPTZ
);

-- Optional: prune old events after 30 days
CREATE INDEX idx_webhook_events_received_at
    ON webhook_events (received_at);
```

The `event_id` primary key is the idempotency gate — `INSERT … ON CONFLICT DO NOTHING` makes every handler safe to retry.

---

## 2. Full Module — `webhooks/payments.py`

```python
"""
Payment-provider webhook receiver.

Responsibilities:
  1. Verify HMAC-SHA256 signature + reject stale timestamps.
  2. Parse & validate the payload with Pydantic.
  3. Dispatch to registered handlers via an event-type registry.
  4. Guarantee idempotency via a DB-level dedup table.
  5. Always return 2xx for events we recognise (or deliberately skip),
     so the provider stops retrying.
"""

from __future__ import annotations

import hashlib
import hmac
import logging
import time
from collections.abc import Awaitable, Callable
from typing import Annotated, Any

import asyncpg
from fastapi import APIRouter, Depends, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator

logger = logging.getLogger(__name__)

# ---------------------------------------------------------------------------
# Configuration (inject via settings / env in production)
# ---------------------------------------------------------------------------

WEBHOOK_SECRET: str = "whsec_replace_me"  # loaded from env / vault
MAX_TIMESTAMP_AGE_SECONDS: int = 300  # 5 minutes


# ---------------------------------------------------------------------------
# Pydantic models
# ---------------------------------------------------------------------------

class InvoicePaidData(BaseModel):
    id: str
    amount: int  # in smallest currency unit (cents)
    currency: str = "usd"
    paid_at: str | None = None


class WebhookEvent(BaseModel):
    """Top-level envelope sent by the payment provider."""

    id: str = Field(..., description="Unique event ID (e.g. evt_abc123)")
    type: str = Field(..., description="Event type, e.g. invoice.paid")
    created: int = Field(..., description="Unix timestamp of event creation")
    data: dict[str, Any]

    @field_validator("id")
    @classmethod
    def id_must_be_non_empty(cls, v: str) -> str:
        if not v.strip():
            raise ValueError("event id must not be empty")
        return v


# ---------------------------------------------------------------------------
# Signature verification
# ---------------------------------------------------------------------------

def compute_signature(secret: str, timestamp: str, body: bytes) -> str:
    """
    Compute the expected HMAC-SHA256 hex digest.

    Signed material: ``{timestamp}.{raw_body}`` — matches the convention
    used by Stripe, Adyen, and most modern providers.
    """
    signed_payload = f"{timestamp}.".encode() + body
    return hmac.new(
        key=secret.encode(),
        msg=signed_payload,
        digestmod=hashlib.sha256,
    ).hexdigest()


def verify_signature(
    *,
    secret: str,
    signature_header: str,
    timestamp_header: str,
    body: bytes,
    max_age_seconds: int = MAX_TIMESTAMP_AGE_SECONDS,
) -> None:
    """
    Verify the webhook signature and timestamp freshness.

    Raises ``HTTPException(403)`` on any failure.
    """
    # --- timestamp freshness --------------------------------------------------
    try:
        event_timestamp = int(timestamp_header)
    except (ValueError, TypeError) as exc:
        raise HTTPException(
            status_code=403, detail="Malformed timestamp header"
        ) from exc

    now = int(time.time())
    if abs(now - event_timestamp) > max_age_seconds:
        raise HTTPException(
            status_code=403,
            detail=f"Timestamp too old (delta={now - event_timestamp}

このハードウェアでのこのモデルの他の実行