Kiểm tra tốc độMô hìnhĐánh giá chuẩnCho thuêBáo cáoPhần cứngMáy tính decodeTổ chứcProTài liệu APIGửi
Ngôn ngữ
Actual Computer — Every computer, one endpoint

Kiểm tra tốc độ

Qwen3.8-Flash-Next-NVFP4

RTX PRO 6000 Blackwell Workstation Edition 96GB ×2 · vllm · v0.33.0rc1.dev320+g335dd77b0 · NVFP4

puretensorĐã xác minh1 thg 11, 2026

Decode

289tok/s

Prefill

14.7ktok/s

Thời gian đến token đầu tiên

193ms

Tổng

1.0ktok/s

VRAM đỉnh

—

Độ dài ngữ cảnh

32K

Độ sâu KV

0

Kích thước batch

1

Đồng thời

1

Công suất tiêu thụ

—

Xác minh

Chưa xác minh — kết quả thử nghiệm

Lượt chạy đã xác minh dùng prompt kiểm thử chuẩn và ghi lại đủ dữ liệu để kiểm tra kết quả.

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

Lệnh khởi chạy

docker run -d --name maxxloop-2g --gpus '"device=0,1"' --ipc=host --shm-size 16g -p 127.0.0.1:8664:8000 -v /mnt/storage/models:/models:ro -v /mnt/storage/maxxloop/cache-2g:/root/.cache  vllm/vllm-openai:nightly-335dd77b09161c5d63139b4e7ae51bb9928305b1 --model /models/qwen3.8-flash-next-nvfp4 --served-model-name qwen38-flash-next --trust-remote-code --tensor-parallel-size 2 --max-model-len 32768 --gpu-memory-utilization 0.90 --language-model-only --speculative-config '{"method":"mtp","num_speculative_tokens":4}'

Theoretical memory ceiling

426.9–430.4 tok/s

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

Includes speculative decoding: 3.80 tokens accepted per model step on average (112.2–113.2 steps/s) · measured 76.1 steps/s

67–68%

of the ceiling reached

Medium confidence

The fastest this hardware's memory could serve a single request; real runs are slower. Model details from nvidia/Qwen3.8-Flash-Next-NVFP4; size from NVFP4 estimate. Hardware source · Open calculator

Phần cứng

GPU
RTX PRO 6000 Blackwell Workstation Edition
Số lượng
2
VRAM
96 GB
OS
Ubuntu 24.04.5 LTS

Engine

Engine
vllm
Phiên bản
0.33.0rc1.dev320+g335dd77b0
Build
vllm/vllm-openai@sha256:66f19872e759e7d74f0729c4c7068eaaf71bc8b35f613573c36062a81be8cb3d
Commit
335dd77b0
Quant
NVFP4
Backend
cuda
TP
2
KV cache
auto
GPU mem util
0.9
Prefix caching
có
Chunked prefill
có
Spec decode
bật
MTP
bật

Cấu hình chạy

Context
32.768 tokens
Độ sâu
0 tokens
Kích thước batch
1
Prompt tokens
2820
Prefill tok/s
14.7K tok/s
Output tokens
1024
Ghi chú
PureTensor lab, fox-n0: two RTX PRO 6000 Blackwell Workstation Edition (600 W) on PCIe, whole cards, TP2, Threadripper 7970X, 256 GB RAM. NVIDIA's NVFP4 checkpoint (ModelOpt) on upstream vLLM nightly (Docker), text-only (--language-model-only). Config found by our maxxloop tuning harness: one-variable sweeps, quality and degeneration gates, interleaved fresh-boot confirms. Confirmed x2.247 [95% CI 2.215-2.283] over the engine defaults in 3+3 interleaved boots. Engine config vs its defaults: spec='{"method":"mtp","num_speculative_tokens":4}'. Image vllm/vllm-openai@sha256:66f19872e759e7d74f0729c4c7068eaaf71bc8b35f613573c36062a81be8cb3d. CPU in a performance window (performance governor, C2 off, boost on). Thinking off. Batch 1, temperature 0, streamed; median of 5 runs after 2 warmup(s). 269 verify steps, 3.80 tokens/step, 13.1 ms/step.

Giải mã suy đoán

Phương pháp
MTP
Được chấp nhận mỗi bước
3,8 token
Tỷ lệ chấp nhận
70%
Token nháp
1.076
Token được chấp nhận
754

Bằng chứng đã ghi

Mã băm prompt (SHA-256)
5a6b7bc1cbbc…
Mẫu prompt · 2,000 chars
[LocalMaxxing cache-bust nonce: dec581f7196063872643277f5396efea]
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
Mẫu đầu ra · 4,000 chars
Here is a robust, production-ready implementation of the webhook handler.

### 1. Database Schema (SQL)

We need an `invoices` table and an `webhook_events` table to handle idempotency. The `webhook_events` table acts as a ledger of processed event IDs.

```sql
-- Table to store processed webhook events for idempotency
CREATE TABLE IF NOT EXISTS webhook_events (
    event_id TEXT PRIMARY KEY,
    event_type TEXT NOT NULL,
    processed_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
    payload JSONB NOT NULL
);

-- Table to store invoices
CREATE TABLE IF NOT EXISTS invoices (
    id TEXT PRIMARY KEY,
    amount NUMERIC(10, 2) NOT NULL,
    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

-- Index for faster lookups if you ever need to query by type or time
CREATE INDEX IF NOT EXISTS idx_webhook_events_processed_at ON webhook_events (processed_at);
```

### 2. Python Module (`webhooks.py`)

This module includes:
- **Pydantic Models**: For strict validation of the webhook payload.
- **Signature Verification**: HMAC-SHA256 with timestamp tolerance.
- **Event Registry**: A decorator-based system to map event types to handlers.
- **Idempotency**: Uses `INSERT ... ON CONFLICT DO NOTHING` to ensure events are processed exactly once.
- **Error Handling**: Returns 200 OK for unhandled events (to stop retries) and 4xx/5xx only for genuine errors.

```python
import hashlib
import hmac
import json
import logging
import time
from typing import Any, Callable, Coroutine, Dict, Optional

import asyncpg
from fastapi import APIRouter, HTTPException, Request, status
from pydantic import BaseModel, Field, ValidationError

# --- Configuration ---
WEBHOOK_SECRET = "your-secret-key-from-env"  # Load from env in production
TIMESTAMP_TOLERANCE_SECONDS = 300  # 5 minutes

# --- Logging ---
logger = logging.getLogger(__name__)

# --- Pydantic Models ---

class WebhookPayload(BaseModel):
    """
    Standard structure for payment provider webhooks.
    Adjust field names to match your specific provider (e.g., Stripe, Adyen).
    """
    id: str = Field(..., description="Unique event ID")
    type: str = Field(..., description="Event type, e.g., 'invoice.paid'")
    data: Dict[str, Any] = Field(..., description="Event-specific data")
    timestamp: Optional[int] = Field(None, description="Unix timestamp of event creation")

# --- Event Registry ---

# Type alias for handler functions
EventHandler = Callable[[Dict[str, Any], asyncpg.Pool], Coroutine[None, None, None]]

class EventRegistry:
    """
    Registry to map event types to their handler functions.
    """
    def __init__(self) -> None:
        self._handlers: Dict[str, EventHandler] = {}

    def register(self, event_type: str) -> Callable[[EventHandler], EventHandler]:
        """
        Decorator to register a handler for a specific event type.
        """
        def decorator(func: EventHandler) -> EventHandler:
            self._handlers[event_type] = func
            return func
        return decorator

    def get_handler(self, event_type: str) -> Optional[EventHandler]:
        return self._handlers.get(event_type)

registry = EventRegistry()

# --- Signature Verification ---

def verify_signature(raw_body: bytes, signature_header: str, secret: str) -> bool:
    """
    Verifies the HMAC-SHA256 signature of the webhook payload.
    
    Args:
        raw_body: The raw bytes of the request body.
        signature_header: The value of the X-Signature header.
        secret: The shared secret key.
        
    Returns:
        True if signature is valid, False otherwise.
    """
    if not signature_header:
        return False

    # Expected format: "sha256=<hex_digest>"
    try:
        scheme, _, provided_sig = signature_header.partition("=")
        if scheme != "sha256":
            return False
    except ValueError:
        return False

    # Compute expected signature
    expected_sig = hmac.new(
        secret.encode("utf-8"),
        raw_body,
        hashlib.sha256
    ).hexdigest()

Các lượt chạy khác của mô hình này trên phần cứng này