Snelheidstest
Qwen4-35B-A3B
RTX PRO 6000 Blackwell Workstation Edition 96GB ×2 · sglang · v0.5.24.dev1+gcd1dc28 · BF16
Decode
414tok/s
Prefill
23.0ktok/s
Tijd tot eerste token
1.472ms
Totaal
5.6ktok/s
Piek-VRAM
—
Contextlengte
40K
KV-diepte
0
Batchgrootte
1
Gelijktijdigheid
1
Stroomverbruik
—
Verificatie
Niet geverifieerd — experimenteel resultaat
Geverifieerde runs gebruiken een standaard testprompt en leggen genoeg gegevens vast om het resultaat te controleren.
- The run did not use one of the standard test prompts.
Startcommando
docker run --gpus all --ipc=host --shm-size 32g lmsysorg/sglang:qwen4 python3 -m sglang.launch_server --model-path Qwen/Qwen4-35B-A3B --served-model-name Qwen/Qwen4-35B-A3B --trust-remote-code --tp-size 2 --mem-fraction-static 0.6 --disable-radix-cache --max-running-requests 64 --context-length 40960 --random-seed 42 --speculative-algorithm DFLASH --speculative-draft-model-path RadixArk/Qwen4-35B-A3B-Dflash2 --speculative-dflash-block-size 8 --speculative-draft-kv-cache-dtype bf16 --speculative-use-block-verification
Theoretical memory ceiling
1,652.0–2,428.0 tok/s
3,584 GB/s memory bandwidth (spec sheet) · 114.00 GB model weights · 16-bit KV cache · 1–33,857 tokens of context
Includes speculative decoding: 4.46 tokens accepted per model step on average (370.7–544.8 steps/s) · measured 92.8 steps/s
17–25%
of the ceiling reached
Medium confidenceThe fastest this hardware's memory could serve a single request; real runs are slower. Model details from Qwen/Qwen4-35B-A3B; size from BF16 estimate. Hardware source · Open calculator
Hardware
- GPU
- RTX PRO 6000 Blackwell Workstation Edition
- Aantal
- 2
- VRAM
- 96 GB
- OS
- Ubuntu 24.04.5 LTS
Engine
- Engine
- sglang
- Versie
- 0.5.24.dev1+gcd1dc28
- Build
- lmsysorg/sglang:qwen4 (sha256:a574b8c4d271459718a64f9dacd5ba373fcd4e75ee99770abeab4203557eccbd)
- Commit
- cd1dc28
- Quant
- BF16
- Backend
- cuda
- TP
- 2
- GPU mem util
- 0.6
- Prefix caching
- nee
- Max running seqs
- 64
- Spec decode
- ingeschakeld
Run config
- Context
- 40.960 tokens
- Diepte
- 0 tokens
- Batchgrootte
- 1
- Prompttokens
- 33857
- Prefill tok/s
- 23K tok/s
- Outputtokens
- 2048
- Notities
- 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. Full BF16 weights with the RadixArk DFlash2 block drafter (BF16 draft, 8-token verify width, block verification). 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). Long cold prompt: the webhook prompt repeated to about 33.9K tokens, nothing cached (radix cache off). Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s). 460 verify steps, 4.46 tokens/step, 10.8 ms/step.
Speculatieve decodering
- Methode
- DFlash
- Geaccepteerd per stap
- 4,46 tokens
- Acceptatiegraad
- 49%
- Drafttokens
- 3.220
- Geaccepteerde tokens
- 1.590
Vastgelegd bewijs
- Prompt-hash (SHA-256)
- 2d56214bb6db…
Promptvoorbeeld · 2,000 chars
[LocalMaxxing cache-bust nonce: a32d83f8fbfc1279068085a959a98215]
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 bodUitvoervoorbeeld · 4,000 chars
# Production Webhook Handler
## `webhook.py` — Full Module
```python
"""
Payment webhook receiver with signature verification, idempotency,
and extensible event dispatch.
"""
from __future__ import annotations
import hashlib
import hmac
import json
import logging
import time
from collections.abc import Awaitable, Callable
from typing import Any
import asyncpg
from fastapi import APIRouter, Header, HTTPException, Request, Response
from pydantic import BaseModel, Field, field_validator
logger = logging.getLogger(__name__)
# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------
WEBHOOK_SECRET: str = "" # inject via settings/env
MAX_TIMESTAMP_AGE_SECONDS: int = 300 # 5 minutes
def configure_webhook(secret: str, max_age: int = 300) -> None:
"""Call at startup to set the signing secret and staleness window."""
global WEBHOOK_SECRET, MAX_TIMESTAMP_AGE_SECONDS
WEBHOOK_SECRET = secret
MAX_TIMESTAMP_AGE_SECONDS = max_age
# ---------------------------------------------------------------------------
# Pydantic Models
# ---------------------------------------------------------------------------
class WebhookEvent(BaseModel):
"""Envelope for all incoming payment provider events."""
id: str = Field(..., description="Unique event identifier")
type: str = Field(..., description="Event type, e.g. invoice.paid")
created_at: int = Field(..., description="Unix timestamp of event creation")
data: dict[str, Any] = Field(..., description="Event payload")
@field_validator("id")
@classmethod
def id_not_empty(cls, v: str) -> str:
if not v.strip():
raise ValueError("event id must not be empty")
return v
class WebhookResponse(BaseModel):
status: str
event_id: str | None = None
# ---------------------------------------------------------------------------
# Signature Verification
# ---------------------------------------------------------------------------
class SignatureError(Exception):
"""Raised when signature verification fails."""
def verify_signature(
raw_body: bytes,
signature_header: str,
timestamp_header: str,
secret: str,
max_age_seconds: int = MAX_TIMESTAMP_AGE_SECONDS,
) -> None:
"""
Verify HMAC-SHA256 signature and reject stale timestamps.
Expected headers:
X-Timestamp: unix seconds when the request was signed
X-Signature: hex-encoded HMAC-SHA256 of "{timestamp}.{raw_body}"
Raises:
SignatureError: on any verification failure.
"""
# --- timestamp staleness check ---
try:
ts = int(timestamp_header)
except (ValueError, TypeError) as exc:
raise SignatureError(f"Invalid timestamp header: {timestamp_header!r}") from exc
now = 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 over timestamp + body ---
signed_payload = f"{timestamp_header}.".encode() + raw_body
expected = hmac.new(
key=secret.encode("utf-8"),
msg=signed_payload,
digestmod=hashlib.sha256,
).hexdigest()
if not hmac.compare_digest(expected, signature_header):
raise SignatureError("Signature mismatch")
# ---------------------------------------------------------------------------
# Event Handler Registry
# ---------------------------------------------------------------------------
EventHandler = Callable[[WebhookEvent, asyncpg.Pool], Awaitable[None]]
_event_registry: dict[str, EventHandler] = {}
def register_event_handler(event_type: str) -> Callable[[EventHandler], EventHandler]:
"""Decorator to register an async handler for a given event type."""
def decorator(fn: EventHandler) -> EventHandler:
if event_type Meer runs van dit model op deze hardware
- 408tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1Geverifieerde runpuretensor · 5 dec 2026
- 382tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1puretensor · 5 dec 2026
- 248tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1Geverifieerde runpuretensor · 5 dec 2026
- 203tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1Geverifieerde runpuretensor · 5 dec 2026
- 195tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1puretensor · 5 dec 2026
- 163tok/ssglang · v0.5.24.dev1+gcd1dc28 · BF1640K context · 0 diepte · batch 1Geverifieerde runpuretensor · 5 dec 2026
