速度測試模型基準評測租用報告硬體解碼計算器組織ProAPI文件提交
語言
Actual Computer — Every computer, one endpoint

速度測試

Kimi-K2.6-GGUF

RTX PRO 6000 Blackwell Max-Q Workstation Edition 96GB ×4 · llama.cpp · b8070 · UD-Q2_K_XL

puretensor已驗證2026年10月22日

解碼

46.7tok/s

預填

415tok/s

首個 token 延遲

19,012ms

總計

158tok/s

峰值 VRAM

—

上下文長度

16K

KV 深度

0

批次大小

1

並行數

1

功耗

—

驗證

未驗證 — 實驗性結果

已驗證的執行使用標準測試提示詞,並記錄足夠的資料以核對結果。

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

啟動命令

llama-server -m Kimi-K2.6-UD-Q2_K_XL-00001-of-00008.gguf -ngl 999 -sm layer -c 16384 -fa on --jinja -np 1 -t 32

Theoretical memory ceiling

This mixture-of-experts model doesn't list how many parameters are used per token, so a ceiling can't be estimated.

模型

GPU
RTX PRO 6000 Blackwell Max-Q Workstation Edition
數量
4
VRAM
96 GB
OS
Ubuntu 26.04.1 LTS

引擎

引擎
llama.cpp
版本
b8070
Commit
cc45f2ada
量化
UD-Q2_K_XL
後端
cuda
TP
4
GPU 層
999
Flash Attn
是

執行設定

上下文
16,384 個 token
深度
0 個 token
批次大小
1
提示詞 token
7881
預填 tok/s
414.5 tok/s
輸出 token
2048
備註
PureTensor lab, tensor-core: RTX PRO 6000 Blackwell Max-Q (300 W) cards on PCIe 5.0 x16, Threadripper PRO 9975WX, 512 GB DDR5. Host P2P settings (amd_iommu=off, NVIDIA P2P registry keys). CPU in a performance window (boost on, performance governor, C2 off). Thinking off. llama.cpp b8070 (cc45f2ada), CUDA, all layers on 4 GPU(s), layer split, flash attention, one slot, no speculative decoding. Batch 1, temperature 0, streamed; median of 3 runs after 1 warmup(s).

已記錄的證據

提示詞雜湊(SHA-256)
ea528ad859a0…
提示詞樣本 · 2,000 chars
[LocalMaxxing cache-bust nonce: de56cebb1a4003d675c0be2a315aa7bc]
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
I'll build a production-grade webhook handler addressing all the issues. Here's the complete module:

## SQL Schema

```sql
-- Idempotency and event tracking table
CREATE TABLE webhook_events (
    event_id        TEXT PRIMARY KEY,
    event_type      TEXT NOT NULL,
    received_at     TIMESTAMPTZ NOT NULL DEFAULT now(),
    processed_at    TIMESTAMPTZ,
    signature_valid BOOLEAN NOT NULL DEFAULT false,
    payload_hash    TEXT NOT NULL,
    error_message   TEXT,
    retry_count     INTEGER NOT NULL DEFAULT 0
);

-- Invoices table (separate from events, idempotent via event_id FK)
CREATE TABLE invoices (
    id              TEXT PRIMARY KEY,
    event_id        TEXT NOT NULL REFERENCES webhook_events(event_id),
    amount          NUMERIC(20, 8) NOT NULL,
    currency        TEXT NOT NULL DEFAULT 'USD',
    status          TEXT NOT NULL,
    created_at      TIMESTAMPTZ NOT NULL DEFAULT now()
);

-- Index for efficient event lookups
CREATE INDEX idx_webhook_events_type ON webhook_events(event_type, processed_at);
```

## Module: `webhooks.py`

```python
"""
Production-grade payment webhook handler with HMAC verification,
idempotency, registry-based dispatch, and graceful degradation.
"""

from __future__ import annotations

import hashlib
import hmac
import json
import logging
import time
from collections.abc import Awaitable, Callable
from dataclasses import dataclass
from typing import Any, ClassVar, Final, TypeVar

import asyncpg
from fastapi import FastAPI, Header, HTTPException, Request, status
from pydantic import BaseModel, Field, ValidationError, validator

logger = logging.getLogger(__name__)

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

WEBHOOK_SECRET: Final[bytes] = b"your-secret-key-from-env"  # Load from secure source
MAX_TIMESTAMP_AGE_SEC: Final[int] = 300  # 5 minutes
TIMESTAMP_TOLERANCE_SEC: Final[int] = 30  # Clock skew tolerance


# ---------------------------------------------------------------------------
# Exceptions
# ---------------------------------------------------------------------------

class WebhookError(Exception):
    """Base exception for webhook processing failures."""
    pass


class SignatureError(WebhookError):
    """HMAC signature verification failed."""
    pass


class TimestampError(WebhookError):
    """Event timestamp is stale or from future."""
    pass


class DuplicateEventError(WebhookError):
    """Event has already been processed."""
    pass


class EventTypeError(WebhookError):
    """Unknown or unsupported event type."""
    pass


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

class InvoiceData(BaseModel):
    """Nested invoice data from payment provider."""
    id: str
    amount: int  # cents
    currency: str = "USD"
    status: str

    @validator("amount")
    @classmethod
    def amount_must_be_positive(cls, v: int) -> int:
        if v <= 0:
            raise ValueError("amount must be positive")
        return v


class WebhookPayload(BaseModel):
    """Validated webhook payload structure."""
    type: str
    id: str = Field(..., description="Unique event ID from provider")
    created_at: int = Field(..., description="Unix timestamp of event creation")
    data: dict[str, Any]

    @validator("created_at")
    @classmethod
    def timestamp_not_in_future(cls, v: int) -> int:
        now: int = int(time.time())
        if v > now + TIMESTAMP_TOLERANCE_SEC:
            raise ValueError("timestamp is in the future")
        return v


class InvoicePaidPayload(WebhookPayload):
    """Specific payload for invoice.paid events."""
    type: str = Field("invoice.paid", const=True)
    data: InvoiceData


# ---------------------------------------------------------------------------
# Registry and Handler Types
# --------

此模型在此硬體上的更多執行