AI

trustrt Custom CUDA Guardrail Runtime: NVIDIA L4 Latency, PyTorch Comparison, and Benchmark Caveats

Measured on December 3, 2026, NeuralTrust's trustrt custom C++ CUDA runtime replaces PyTorch on GPU to evaluate seven guardrail models in 3.0–4.8 ms on a single NVIDIA L4 (860 req/s peak). Here is the hardware breakdown, CPU vs. GPU cost math, and key vendor-benchmark caveats.

By 0xScorPionSon

8 min read

trustrt Custom CUDA Guardrail Runtime: NVIDIA L4 Latency, PyTorch Comparison, and Benchmark Caveats

trustrt custom C++ CUDA guardrail inference pipeline on NVIDIA L4 GPU achieving 3.0-4.8ms latency and 860 req/s peak

Executive Summary

On December 3, 2026, AI security vendor NeuralTrust published a performance benchmark for TrustGuard running on trustrt, a custom C++ inference runtime using handwritten CUDA kernels to replace PyTorch on GPU (NeuralTrust Benchmark). Measured on a single NVIDIA L4 Tensor Core GPU with caching disabled and every token scored, NeuralTrust reported 3.0 to 4.8 ms latency per 128-token prompt across seven detection models, 32.8 ms for a 4,000-token indirect prompt-injection scan, and 860 requests per second (req/s) peak throughput (NeuralTrust Benchmark).

Against NeuralTrust's previous PyTorch-based firewall on the same L4 hardware, trustrt delivered 2.30x median req/s (up to 3.67x), 1.89x faster single-request median latency, and 72% less RAM per worker, with 0 failed requests across 558,180 sustained-load checks (NeuralTrust Benchmark).

Confidence and skepticism assessment: High confidence in the architectural mechanism (custom C++ CUDA kernels eliminating Python/PyTorch overhead on small classification/guardrail models); Moderate-to-Low confidence in generalizability until independent third-party benchmarks appear. NeuralTrust explicitly discloses that the tests were run in-house by NeuralTrust engineer Martí Jordà with one worker and no network time (NeuralTrust Benchmark).

Architecture & How It Works: trustrt vs. PyTorch on NVIDIA L4

Traditional LLM guardrail pipelines often wrap small encoder or classifier models inside Python and PyTorch serving stacks. While convenient for prototyping, Python GIL contention, framework dispatch overhead, and PyTorch allocator memory footprints dominate execution time when scoring short 128-token prompts in a few milliseconds.

trustrt removes the Python/PyTorch runtime on GPU by executing guardrail models through compiled C++ and custom CUDA kernels (NeuralTrust Benchmark). This aligns closely with the hardware profile of the NVIDIA L4 Tensor Core GPU (Ada Lovelace architecture), which is designed specifically for low-power, high-density inference (NVIDIA L4; NVIDIA L4 Datasheet):

NVIDIA L4 Specification Verified Value Operational Impact on Guardrail Inference
Architecture & Form Factor Ada Lovelace, 1-slot low-profile PCIe Gen4 x16 Fits dense 1U/edge servers (1–8 GPUs per node) (NVIDIA L4)
Max Thermal Design Power (TDP) 72 W Low power envelope keeps always-on guardrail TCO predictable (NVIDIA L4)
GPU Memory & Bandwidth 24 GB GDDR6, 300 GB/s Holds all 7 small detection models resident simultaneously without swapping (AceCloud / NVIDIA Datasheet)
FP8 / INT8 Tensor Core 485 TFLOPS (FP8*) / 485 TOPS (INT8*) Quantized encoder/classifier passes saturate compute fast with sparsity (*with sparsity) (NVIDIA L4)
FP16 / BF16 Tensor Core 242 TFLOPS* High-precision fallback without memory bandwidth starvation (AceCloud / NVIDIA Datasheet)
flowchart LR
    A[Incoming Prompt / 4K Doc] --> B[API Gateway / Apache APISIX ai-neuraltrust-guard]
    B -->|POST /v1/evaluate| C[trustrt C++ Runtime]
    C -->|GPU Path: Custom CUDA Kernels| D[NVIDIA L4 24GB: 7 Guardrail Models]
    C -->|CPU Fallback: 1 Thread| E[CPU Inference: 174-538ms at 128 tok]
    D -->|3.0-4.8ms / 32.8ms| F{Policy Verdict}
    E --> F
    F -->|Monitor / Block / Redact| G[Upstream LLM Provider or Client]

Integrating Guardrail Evaluation Into API Gateways

On December 3, 2026, NeuralTrust also published an integration for Apache APISIX (v3.18+) via the ai-neuraltrust-guard Lua plugin alongside ai-proxy or ai-proxy-multi (NeuralTrust APISIX Guide). Rather than modifying application code, the gateway forwards prompts (and optionally completions) to TrustGuard's /v1/evaluate endpoint before returning responses, supporting Observe and Enforce modes with Block or Transform (DLP PII redaction) verdicts (NeuralTrust APISIX Guide).

{
  "policy": {
    "enforcement_mode": "Enforce",
    "collector": "apisix-ai-proxy",
    "rules": [
      { "phase": "Input", "detector": "Prompt Guard", "action": "Block" },
      { "phase": "Input", "detector": "Indirect Prompt Injection", "action": "Block" },
      { "phase": "Input", "detector": "DLP PII (Email, Card, IBAN)", "action": "Transform" },
      { "phase": "Output", "detector": "Toxicity Detection", "action": "Block" }
    ]
  }
}

Benchmarks, Cost & Latency Analysis

NeuralTrust's December 3 benchmark measured seven detection models under strict conditions: caching turned off and every token scored (NeuralTrust Benchmark). Comparing GPU (1x NVIDIA L4) against single-thread CPU and the prior PyTorch-based runtime highlights where custom CUDA kernels pay off:

Benchmark Dimension trustrt on 1x NVIDIA L4 GPU trustrt on 1 CPU Thread trustrt vs. Previous PyTorch Firewall
128-Token Prompt Latency 3.0 to 4.8 ms across 7 models 174 to 538 ms 1.89x faster single request at median (GPU) (NeuralTrust Benchmark)
4,000-Token Doc Scan 32.8 ms (indirect prompt injection) Seconds (grows with length) Not separately reported for prior PyTorch (NeuralTrust Benchmark)
Peak / Sustained Throughput 860 req/s peak (>1.6M checks/hr) 1.15x median RPS vs. prior 2.30x median RPS on L4 (up to 3.67x) (NeuralTrust Benchmark)
Worker RAM Footprint 72% less RAM per worker vs. prior 22% to 45% less RAM per worker Eliminates PyTorch runtime memory overhead (NeuralTrust Benchmark)
Reliability Under Load 0 failed of 558,180 requests 0 failed (combined load test) Single-worker sustained stability test (NeuralTrust Benchmark)

Critical Benchmark Caveats and Hardware Economics

Before sizing production clusters from these numbers, AI engineering teams should factor in four explicit limitations:

  1. No Network or Serialization Overhead Included: The 3.0–4.8 ms figure measures in-process inference inside one worker—not real-world round-trip HTTP/gRPC latency between Apache APISIX (ai-neuraltrust-guard) and the guardrail service (NeuralTrust Benchmark; NeuralTrust APISIX Guide). Adding TLS termination, JSON parsing, and gateway hops typically adds 1–5 ms in-VPC (and far more cross-AZ).
  2. Single-Worker Test Scope: Measuring one worker isolates per-worker RAM savings (72% reduction) and raw kernel speed, but does not prove multi-worker PCIe contention behavior or horizontal autoscaling under bursty multi-tenant traffic (NeuralTrust Benchmark).
  3. Vendor-Run Without Independent Leaderboard Validation: Unlike public LLM leaderboards (e.g., Artificial Analysis or LMSYS), trustrt throughput and accuracy were measured solely by NeuralTrust (Martí Jordà) (NeuralTrust Benchmark). Detection recall/false-positive rates across the seven models were not benchmarked against independent adversarial datasets in this post.
  4. CPU vs. L4 Cost Trade-Off: At 174–538 ms per 128-token check (and seconds for 4,000-token RAG documents) on one CPU thread, CPU-only guardrails add unacceptable TTFT penalties for interactive chat or agent tool loops (NeuralTrust Benchmark). Because a single 72W NVIDIA L4 can sustain >1.6M checks/hour at <5 ms, dedicating one L4 GPU for synchronous guardrail checks is far more cost-effective than over-provisioning high-core-count CPU nodes for transformer inference.

Production Deployment & Trade-Offs

For teams deciding how to deploy runtime guardrails in late 2026, the architectural choice hinges on where inspection runs and how much lock-in you accept:

  • Dedicated GPU Guardrail Node (trustrt / L4) vs. CPU Sidecars: Only use CPU-based guardrail inference for asynchronous post-hoc auditing or low-QPS internal tools where 200–500 ms of added latency is invisible. For synchronous agent loops (especially 4,000-token RAG/tool outputs vulnerable to indirect prompt injection), a 32.8 ms L4 GPU scan keeps total turn latency acceptable (NeuralTrust Benchmark).
  • Apache APISIX Plugin vs. Native AI Gateway (TrustGate): If your organization already runs Apache APISIX (3.18+) for API management, adding ai-neuraltrust-guard provides per-route Monitor, Block, and Redact controls without re-architecting traffic—though APISIX plugins inspect one request at a time without native session memory and do not evaluate MCP tool calls (NeuralTrust APISIX Guide; NeuralTrust vs. APISIX). Conversely, if you need session-level memory and MCP tool-call inspection, a purpose-built AI gateway (or custom MCP proxy) is required (NeuralTrust vs. APISIX).
  • Custom C++ CUDA Runtime Lock-In: Replacing PyTorch with a proprietary C++ CUDA runtime (trustrt) yields major latency and RAM wins, but ties your deployment to vendor-supported CUDA/driver matrices and makes swapping in custom Hugging Face PyTorch classifiers harder than in standard Triton/vLLM stacks.

Safe Rollout Pattern: Observe Mode Before Enforce Mode

When deploying trustrt-backed guardrails in front of production LLM endpoints, NeuralTrust's own integration guides recommend a staged five-step rollout—policy creation, plugin installation, collector key injection, route configuration, and synthetic verification—starting strictly in Observe mode (NeuralTrust APISIX Guide; NeuralTrust Gemini Guide). In Observe mode, Prompt Guard, Indirect Prompt Injection, and DLP PII detectors log verdicts to the Activity view without blocking live traffic, allowing platform engineers to measure false-positive rates and actual end-to-end p99 latency before flipping the policy to Enforce (NeuralTrust APISIX Guide). Importantly, a collector with no attached policy silently returns allow and inspects nothing, so CI/CD deployment checks should verify non-empty policy bindings before cutover (NeuralTrust APISIX Guide).

Frequently Asked Questions (FAQ)

What is trustrt and why did NeuralTrust replace PyTorch on GPU?

trustrt is NeuralTrust's custom C++ inference runtime written with custom CUDA kernels to replace PyTorch on GPU (NeuralTrust Benchmark). Removing Python and PyTorch runtime overhead delivered 2.30x median RPS (up to 3.67x), 1.89x faster median single-request latency, and 72% less RAM per worker on an NVIDIA L4 GPU (NeuralTrust Benchmark).

How fast is TrustGuard on an NVIDIA L4 GPU vs. CPU?

On one NVIDIA L4 GPU, TrustGuard evaluates a 128-token prompt in 3.0 to 4.8 ms across seven detection models (peaking at 860 req/s), and scans a 4,000-token document for indirect prompt injection in 32.8 ms (NeuralTrust Benchmark). On a single CPU thread, the 128-token check slows to 174 to 538 ms, and 4,000-token scans take seconds (NeuralTrust Benchmark).

Are NeuralTrust's 3.0–4.8 ms benchmark numbers independently verified?

No. The December 3, 2026 benchmarks were run in-house by NeuralTrust engineer Martí Jordà on one worker with no network time included (NeuralTrust Benchmark). Teams should measure end-to-end p95/p99 latency including gateway and network hops in their own staging environment.

Can TrustGuard inspect Apache APISIX LLM routes and MCP tool calls?

TrustGuard integrates with Apache APISIX (3.18+) via the ai-neuraltrust-guard plugin on ai-proxy and ai-proxy-multi routes to monitor, block, or redact prompts and completions, though that plugin does not evaluate MCP tool calls (NeuralTrust APISIX Guide). Note that the plugin proposal for upstream Apache APISIX was still open as of December 3, 2026, requiring external plugin installation until merged (NeuralTrust APISIX Guide).

Why does the NVIDIA L4 GPU fit synchronous guardrail workloads well?

The NVIDIA L4 packs 24 GB GDDR6 memory (300 GB/s bandwidth) and 485 TFLOPS FP8 / 485 TOPS INT8 Tensor Core compute (with sparsity) into a 72W single-slot PCIe card, letting all seven detection models stay memory-resident on one low-power GPU (NVIDIA L4; AceCloud / NVIDIA Datasheet).

Sources

  1. NeuralTrust (December 3, 2026) — TrustGuard Firewall Guardrail Benchmark (Primary)
  2. NVIDIA — L4 Tensor Core GPU for AI & Graphics (Primary)
  3. NVIDIA — NVIDIA L4 GPU Datasheet (Primary)
  4. NeuralTrust (December 3, 2026) — TrustGuard Now Works with Apache APISIX (Primary)
  5. NeuralTrust (July 16, 2026) — NeuralTrust vs Apache APISIX: AI Gateway (Secondary)
  6. AceCloud (November 2025) — NVIDIA L4 Tensor Core GPU Datasheet Mirror (Secondary)

More on AI

AI

Axel Labs Runs Unmodified 748B DeepSeek-V4.1-Flash on a Single RTX 4090: Architecture, Benchmarks, and Trade-Offs

Axel Labs demonstrated an unmodified 510.3 GB FP8/MXFP4 checkpoint of DeepSeek-V4.1-Flash-1017 running on a single 24 GB NVIDIA RTX 4090 paired with an AMD EPYC 9534 CPU and 468.1 GiB of resident host RAM. Across self-reported tests, the custom Axel Engine achieved 78.76 tok/s average decode on a 6,862-token SVG generation task, 42.81 tok/s across 18 short coding and prose prompts, and accurate 127,993-token retrieval with a 196.90-second time to first token. This analysis examines the memory split, hardware constraints, and production caveats.

9 min read

AI

Black Forest Labs FLUNG 8B: Variational Flow Matching Decodes 4.8–6.5 Tokens/Pass—Under CC BY-NC 4.0

Black Forest Labs—the lab behind FLUX—quietly uploaded FLUNG 8B on December 4, 2026 alongside arXiv:2612.06003. Trained from scratch on 1T tokens with variational flow matching, it denoises 128-token blocks in parallel at 4.8–6.5 tokens per forward pass. Here is the full architectural breakdown, early-stopping benchmark trade-offs, and why CC BY-NC 4.0 and a 16K context limit keep it in the lab.

8 min read

AI

DeepSeek AI Systemic Risk Policy: L1–L3 Release Tiers, Bare-Model Testing, and When Frontier Weights Stay Closed

DeepSeek published its AI Systemic Risk Management Policy Summary in December 2026, formalizing L1–L3 capability tiers across cyber, CBRN, manipulation, and loss-of-control risks. While reaffirming its commitment to MIT-licensed open weights, the policy mandates guardrail-free testing for downloadable checkpoints and bars L3 frontier weights unless red-line analysis proves a safety margin.

8 min read

Tell us what is not working

A thirty-minute call, no deck and no obligation. You will leave with a straight answer about whether this is worth building - including if that answer is no.

Start a project

Direct line

hello@codebumble.net
Dhaka, Bangladesh  :   local timeCalls in English or Bangla