← Back to Reading
Daily Dose of DS 2026-10-13

A Model Decision Is Only as Safe as the System That Executes It

Uzu is an open-source inference engine developed by Mirai that significantly outperforms traditional local decoding engines on Apple Silicon. When running Qwen3.5 9B on an Apple M5 MacBook Pro, Uzu achieved 92.1 tokens per second, surpassing the theoretical memory-bandwidth limit of roughly 29 tokens per second observed in tools like llama.cpp and MLX. It bypasses this bottleneck by employing speculative decoding, drafting up to 16 positions with Weaver and verifying multiple candidate sequences in a tree structure. Uzu also incorporates custom quantized checkpoints and Metal kernels that leverage the M5 GPU's accelerated int8 matrix path. This article discusses the challenges of ensuring safety and architectural integrity when deploying AI-generated code. Using Claude Code, developers quickly built an automated incident-response agent powered by Jev, an AI model providing probability-scored decisions rather than open-ended text. While the generated code passed all unit tests and ran smoothly, automated review via CodeRabbit revealed critical architectural and security vulnerabilities, including a logic flaw that misassigned action probabilities and a stored cross-site scripting (XSS) vulnerability. The example demonstrates that AI-generated code requires holistic governance and agentic change management across file boundaries before merging into production. Successfully loading an LLM into GPU memory does not guarantee successful inference because weights represent only one of four major VRAM allocations. Serving an LLM also requires dynamic memory for the KV cache, intermediate activations and workspace, and software runtime overhead. KV cache memory expands with context length and concurrency, while activation memory peaks vary between the prefill and decode phases. Therefore, model parameter count alone cannot determine whether a GPU setup can handle a particular inference workload.

Read the original ↗
Contents 3 sections
  1. 014x faster LLM inference engine than llama.cpp:
  2. 02A model decision is only as safe as the system that executes it
  3. 03How LLM inference uses GPU memory
OPEN-SOURCE

4x faster LLM inference engine than llama.cpp:

Uzu is an open-source inference engine developed by Mirai that significantly outperforms traditional local decoding engines on Apple Silicon. When running Qwen3.5 9B on an Apple M5 MacBook Pro, Uzu achieved 92.1 tokens per second, surpassing the theoretical memory-bandwidth limit of roughly 29 tokens per second observed in tools like llama.cpp and MLX. It bypasses this bottleneck by employing speculative decoding, drafting up to 16 positions with Weaver and verifying multiple candidate sequences in a tree structure. Uzu also incorporates custom quantized checkpoints and Metal kernels that leverage the M5 GPU's accelerated int8 matrix path.

  • Running Qwen3.5 9B on a base M5 MacBook Pro yielded 22.0 tokens/s with llama.cpp, 25.1 tokens/s with MLX, and 92.1 tokens/s with Uzu.
  • A base M5 MacBook Pro has approximately 153 GB/s memory bandwidth, imposing a theoretical ceiling of around 29 tokens/s for single-token autoregressive passes streaming 5.2 GB of weights.
  • Uzu averages 7.5 output tokens per verification pass of the 9B model by leveraging speculative decoding.
  • Uzu drafts up to 16 positions, uses Weaver to assemble coherent sequences, and verifies potential sequences organized as a tree.
  • Uzu is an open-source engine developed by Mirai featuring custom quantized checkpoints, Metal kernels with accelerated int8 matrix execution on M5, and bindings for Rust, Swift, Python, and TypeScript.
HANDS-ON

A model decision is only as safe as the system that executes it

This article discusses the challenges of ensuring safety and architectural integrity when deploying AI-generated code. Using Claude Code, developers quickly built an automated incident-response agent powered by Jev, an AI model providing probability-scored decisions rather than open-ended text. While the generated code passed all unit tests and ran smoothly, automated review via CodeRabbit revealed critical architectural and security vulnerabilities, including a logic flaw that misassigned action probabilities and a stored cross-site scripting (XSS) vulnerability. The example demonstrates that AI-generated code requires holistic governance and agentic change management across file boundaries before merging into production.

  • Jev captured nearly 13% of paid teams on Vercel AI Gateway within its first 24 hours by offering constrained choice selection paired with probabilities instead of open-ended text.
  • Claude Code generated a 30-file, 3,383-line incident-response agent whose unit tests completely passed despite harboring architectural bugs.
  • A fallback in decisions.py erroneously paired the highest available probability with a selected action missing its own score, risking unauthorized automated actions like paging teams.
  • CodeRabbit's automated code review flagged the merge risk as High and surfaced critical vulnerabilities including an unencoded stored XSS vulnerability and unauthorized API endpoints.
  • Relying solely on unit tests and file-by-file diffs can miss cross-component safety and security flaws in agent-generated applications.
LLMOps

How LLM inference uses GPU memory

Successfully loading an LLM into GPU memory does not guarantee successful inference because weights represent only one of four major VRAM allocations. Serving an LLM also requires dynamic memory for the KV cache, intermediate activations and workspace, and software runtime overhead. KV cache memory expands with context length and concurrency, while activation memory peaks vary between the prefill and decode phases. Therefore, model parameter count alone cannot determine whether a GPU setup can handle a particular inference workload.

  • Total inference VRAM consists of model weights, KV cache, peak activations and workspace, and runtime overhead.
  • A 70B parameter model requires approximately 140 GB in FP16/BF16, 70 GB in INT8, and 35 GB in INT4 just for model weights.
  • KV cache memory scales with context length and concurrency, but can be reduced via grouped-query attention or multi-query attention.
  • The prefill phase processes multiple prompt tokens in parallel, requiring different activation and workspace capacity than the decode phase.
  • Runtime overhead including CUDA contexts, memory allocators, communication buffers, and fragmentation can exhaust available memory despite apparent free VRAM.