स्पीड टेस्टमॉडलबेंचमार्करेंटलरिपोर्टहार्डवेयरडिकोड कैलकुलेटरसंगठनProAPI दस्तावेज़सबमिट करें
भाषा
Actual Computer — Every computer, one endpoint

स्पीड टेस्ट

Qwen4-35B-A3B-NVFP4

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

puretensorसत्यापित4 दिस॰ 2026

डिकोड

208tok/s

प्रीफ़िल

23.7ktok/s

पहले टोकन तक का समय

120ms

कुल

490tok/s

पीक VRAM

—

कॉन्टेक्स्ट लंबाई

40K

KV गहराई

0

बैच आकार

1

समवर्तीता

1

बिजली खपत

—

सत्यापन

असत्यापित — प्रयोगात्मक परिणाम

सत्यापित रन एक मानक टेस्ट प्रॉम्प्ट का उपयोग करते हैं और परिणाम जाँचने के लिए पर्याप्त डेटा दर्ज करते हैं।

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

Launch command

docker run --gpus device=2,3 --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.5–2,199.1 tok/s

3,584 GB/s memory bandwidth (spec sheet) · 28.50 GB model weights · 16-bit KV cache · 1–2,834 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 Max-Q Workstation Edition
Count
2
VRAM
96 GB
OS
Ubuntu 26.04.1 LTS

इंजन

इंजन
sglang
Version
0.5.24.dev1+gcd1dc28
Build
lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
Commit
cd1dc28
Quant
NVFP4
Backend
cuda
TP
2
GPU mem util
0.6
Prefix caching
नहीं
Max running seqs
64

Run config

Context
40,960 tokens
गहराई
0 tokens
Batch size
1
Prompt tokens
2834
Prefill tok/s
23.7K tok/s
Output tokens
2048
नोट्स
PureTensor lab, tensor-core: two of four RTX PRO 6000 Blackwell Max-Q cards (GPUs 2,3; 325 W limit), Threadripper PRO 9975WX, 512 GB DDR5. SGLang official Qwen4 image, pinned by digest, TP2. Target RadixArk NVFP4 (W4A4 experts), no speculative decoding: the control for the DFlash2 arm. Host P2P settings (amd_iommu=off, NVIDIA P2P registry keys). CPU in a performance window (boost on, performance governor, C2 off). Radix (prefix) cache off as in the drafter model card. A small embedding server (12 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: 99c43ba910b97776997c0c000a374cc8]
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 Webhook Handler

## 1. Idempotency Table (SQL)

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

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

---

## 2. Full Module: `webhooks.py`

```python
"""
webhooks.py – Secure, idempotent payment-webhook receiver.

Responsibilities:
  1. Verify HMAC-SHA256 signature + reject stale timestamps.
  2. Parse payload through Pydantic models.
  3. Dispatch to registered handlers via event-type registry.
  4. Guarantee idempotency via a Postgres dedup table.
  5. Return 2xx for unhandled event types (no infinite retries).
"""

from __future__ import annotations

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

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

logger = logging.getLogger(__name__)

# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------

MAX_TIMESTAMP_AGE_SECONDS: Final[int] = 300  # 5 minutes


# ---------------------------------------------------------------------------
# Pydantic Models
# ---------------------------------------------------------------------------

class WebhookEvent(BaseModel):
    """Envelope for every incoming webhook delivery."""

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

    @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


class InvoicePaidData(BaseModel):
    """Typed payload for the invoice.paid event."""

    invoice_id: str
    amount: int  # cents
    currency: str = "usd"


# ---------------------------------------------------------------------------
# Signature Verification
# ---------------------------------------------------------------------------

class SignatureError(Exception):
    """Raised when signature verification fails."""


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

    Expected headers:
        X-Timestamp: unix seconds
        X-Signature: hex-encoded HMAC-SHA256 of "{timestamp}.{raw_body}"

    Raises:
        SignatureError: on any verification failure.
    """
    # --- timestamp freshness ---
    try:
        ts: int = int(timestamp_header)
    except (ValueError, TypeError) as exc:
        raise SignatureError(
            f"Invalid timestamp header: {timestamp_header!r}"
        ) from exc

    now: int = int(time.time())
    if abs(now - ts) > max_age_seconds:
        raise SignatureError(
            f"Timestamp {ts} is outside acceptable window "
            f"(now={now}, max_age={max_age_seconds}s)"
        )

    # --- HMAC computation ---
    signed_payload: bytes = f"{timestamp_header}.".encode() + raw_body
    computed: bytes = hmac.new(
        secret, signed_payload, hashlib.sha256
    ).digest()

    try:
        provided: bytes = bytes.fromhex(signature_header)
    except ValueError as exc:
        raise SignatureError(
            f"Signature header is not valid hex: {signature_header!r}"
        ) from exc

    if not hmac.compare_digest(computed, provided):
        raise SignatureError("HMAC mismatch")


# ----------------------------

इस हार्डवेयर पर इस मॉडल के और runs