Kiểm tra tốc độ
Kimi-K2.6-GGUF
RTX PRO 6000 Blackwell Max-Q Workstation Edition 96GB ×4 · llama.cpp · b8070 · UD-Q2_K_XL
puretensorĐã xác minh22 thg 10, 2026
Decode
46.7tok/s
Prefill
415tok/s
Thời gian đến token đầu tiên
19.012ms
Tổng
158tok/s
VRAM đỉnh
—
Độ dài ngữ cảnh
16K
Độ 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
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.
Phần cứng
- GPU
- RTX PRO 6000 Blackwell Max-Q Workstation Edition
- Số lượng
- 4
- VRAM
- 96 GB
- OS
- Ubuntu 26.04.1 LTS
Engine
- Engine
- llama.cpp
- Phiên bản
- b8070
- Commit
- cc45f2ada
- Quant
- UD-Q2_K_XL
- Backend
- cuda
- TP
- 4
- GPU layers
- 999
- Flash Attn
- có
Cấu hình chạy
- Context
- 16.384 tokens
- Độ sâu
- 0 tokens
- Kích thước batch
- 1
- Prompt tokens
- 7881
- Prefill tok/s
- 414.5 tok/s
- Output tokens
- 2048
- Ghi chú
- 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).
Bằng chứng đã ghi
- Mã băm prompt (SHA-256)
- ea528ad859a0…
Mẫu prompt · 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 bodMẫu đầu ra · 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
# --------Các lượt chạy khác của mô hình này trên phần cứng này
- 50.6tok/sllama.cpp · b8070 · UD-Q2_K_XLNgữ cảnh 16K · độ sâu 0 · batch 1Lượt chạy đã xác minhpuretensor · 22 thg 10, 2026
- 49.9tok/sllama.cpp · b8070 · UD-Q2_K_XLNgữ cảnh 16K · độ sâu 0 · batch 1Lượt chạy đã xác minhpuretensor · 22 thg 10, 2026
- 48.3tok/sllama.cpp · b8070 · UD-Q2_K_XLNgữ cảnh 16K · độ sâu 0 · batch 1puretensor · 22 thg 10, 2026
