Topic

System Design

All digests tagged System Design

Deep dive on LLM Inference at Scale — Harshul Jain, Audible & Tanmay Sah, Independent AI Researcher thumbnail

· 1:28:12

Deep dive on LLM Inference at Scale — Harshul Jain, Audible & Tanmay Sah, Independent AI Researcher

This workshop provides a deep dive into optimizing Large Language Model (LLM) inference at scale. The core challenge is managing the high computational and memory costs associated with LLMs, particularly as context length and concurrent users increase. Solutions are categorized into two areas: model optimizations (e.g., quantization, Grouped Query Attention, Flash Attention) to reduce size/compute, and serving optimizations (e.g., Paged Attention, Continuous Batching, Prefix Caching) to improve throughput and memory efficiency. The session concludes with a comparative analysis of leading inference engines like vLLM and SGLang.

Key takeaways

  1. Inference Cost Drivers 0:05

    The primary pain points are: 1) Memory consumption that grows with context length (due to the KV cache); 2) Time To First Token (TTFT) degradation as input size increases; and 3) Throughput collapse when requests are processed sequentially.

  2. Memory Scaling is Critical 0:10

    The Key-Value (KV) cache memory usage scales significantly: for a Mistral 7B model, the KV size per token is approximately 131 KB. Serving multiple users with long contexts quickly exhausts GPU VRAM (e.g., 80 concurrent users and 4K context can require 42 GB).

  3. Serving Optimizations are Essential 0:24

    To maximize throughput, techniques like Paged Attention (borrowed from OS paging) solve memory fragmentation; Continuous Batching keeps the GPU occupied by processing multiple requests efficiently; and Prefix Caching saves computation when handling similar prompts across different users.

  4. Engine Selection Trade-offs 0:46

    While vLLM and SGLang show no statistical difference on standard workloads, SGLang demonstrated a significant advantage (three to four times better) when handling complex agentic branching workflows.

Watch on YouTube Full article

Agentic Engineering Operating Level: WHERE to FOCUS your AGENTS? thumbnail

· 36:32

Agentic Engineering Operating Level: WHERE to FOCUS your AGENTS?

The video introduces the 'Agentic Operating Level,' a framework that maps where an engineer and their agents should focus attention when building software. The core principle is that higher leverage does not guarantee success; engineers must dynamically choose between maximizing speed/leverage (moving up) or gaining control/understanding (moving down). Moving up requires deep domain expertise, while moving down is necessary when the system is unfamiliar, high-risk, or performance details matter.

Key takeaways

  1. Higher Is NOT Better 17:53

    Gaining leverage without understanding (moving too high on the stack) leads to limited capability and poor debugging ability. The goal is finding a dynamic *range* of operation, not just moving up.

  2. Leverage vs. Control Trade-off 3:30

    The choice must be dictated by the problem: Choose control when the system is unfamiliar or high-risk; choose leverage when the domain is understood and work is repetitive.

  3. Importance of Domain Expertise 26:44

    Domain expertise allows an engineer to know when automation (leverage) is appropriate. If the work is familiar and repeated, it's a strong signal to automate.

Watch on YouTube Full article

How I Fight AI Brain Rot. Friction Maxxing With Codex, Grok And Claude. thumbnail

· 27:19

How I Fight AI Brain Rot. Friction Maxxing With Codex, Grok And Claude.

Instead of viewing AI as a tool for friction removal, the speaker advocates for 'friction maxxing'—deliberately adding resistance to maintain critical judgment. This involves constantly comparing outputs across multiple models (Codex, Grok, Claude) and incorporating human feedback to challenge assumptions. The goal is not just efficiency, but developing a robust mental model of agent capabilities, failure boundaries, and the limits of current AI interfaces.

Key takeaways

  1. The Value of Disagreement

    True insight comes from disagreement. By forcing multiple models (e.g., Codex, Grok, Claude) to argue or solve a problem, the resulting solution is more robust than any single model's initial output. The speaker emphasizes that 'disagreement is like a rep for my brain.'

  2. Testing Agent Boundaries (The Wrong Spreadsheet) 23:40

    When testing new agents, focus not on the stated claims but on their ability to transparently disclose what they can and cannot access. A dangerous failure mode is when an agent presents a completed draft while having used outdated or inaccessible data (e.g., pulling an old spreadsheet copy because it couldn't reach the downloads folder).

  3. Resisting Gradient Descent 17:33

    Most AI interfaces encourage 'relentless gradient descent,' pushing users toward simple corrections (e.g., fixing a bug or improving a paragraph). The challenge for humans is to ask if the iteration changes our thinking and pushes us creatively, rather than just moving the output closer to the center of the model's known distribution.

  4. The Human Feedback Loop

    Human community feedback is crucial for developing a sophisticated world model. By cycling human critique (e.g., 'this design is confusing') back into the AI, users can ask models to explain which assumptions led to the flawed output, thereby deepening understanding.

Watch on YouTube Full article

MCP Goes Stateless | ​John Dellenbaugh & Pankaj Kumar | MCP Release Party - Seattle thumbnail

· 22:41

MCP Goes Stateless | ​John Dellenbaugh & Pankaj Kumar | MCP Release Party - Seattle

This session details the transition of the MCP protocol to a stateless architecture, significantly simplifying horizontal scaling for AI agent workflows. Previously, maintaining state required complex infrastructure like sticky gateways and dedicated session stores. The new stateless specification eliminates this dependency, allowing agents to interact with services across multiple instances using standard load balancing techniques while preserving conversational context.

Key takeaways

  1. MCP Protocol Goes Stateless 2:25

    The updated MCP specification (2026-07-28) makes the protocol stateless, eliminating session management at the protocol level. This removes a major architectural bottleneck for scaling.

  2. Scaling Challenges in Stateful Systems 5:40

    In stateful setups, scaling out instances leads to 'session not found' errors because subsequent requests may land on an instance that does not hold the session data created by a previous instance.

  3. Infrastructure Overhead of State Management 7:30

    To maintain state in legacy systems, developers must implement complex infrastructure like sticky gateways (mapping Session ID to Instance ID) and dedicated session stores, adding significant overhead.

  4. Stateless Scaling Benefits 10:50

    The stateless model allows for standard load balancing across multiple instances without requiring external state management infrastructure. The cart ID effectively replaces the need for a dedicated session store.

Watch on YouTube Full article

Understanding AI Agent Hallucination in AI Systems thumbnail

· 10:51

Understanding AI Agent Hallucination in AI Systems

AI hallucination occurs when an AI system confidently provides information that is factually incorrect. As systems evolve from basic LLMs to autonomous agents (which plan, reason, and take action), the risk landscape changes significantly. While advanced agents can increase error opportunities, grounding them with tools (like search or APIs) dramatically reduces hallucination by allowing verification. Mitigation requires implementing robust design choices: connecting agents to verified 'sources of truth,' enforcing tool-based reasoning, strictly controlling operational scope boundaries, and maintaining a human in the loop for critical decisions.

Key takeaways

  1. Hallucination Definition 0:13

    Hallucination is when an AI system confidently provides information that is totally incorrect (1:25). This risk increases as systems move from simple chatbots to autonomous agents.

  2. Agentic Risk Profile 0:02

    Agents do hallucinate less when grounded with tools (e.g., search tools, data connectors, RAG) because they can verify information instead of guessing (2:08). However, they introduce more danger because a wrong action (like updating a field or scheduling a meeting) can be taken with complete confidence (3:15).

  3. Mitigation Strategy: Grounding and Tools 0:07

    The fastest way to reduce hallucination is to connect the agent to reliable 'sources of truth' (e.g., SharePoint, CRM systems) and enforce tool-based reasoning rather than pure text prediction (7:30).

Watch on YouTube Full article

Notion's Token Town — Sarah Sachs, Notion thumbnail

· 23:55

Notion's Token Town — Sarah Sachs, Notion

The presentation argues that building sustainable AI-native products requires shifting focus from optimizing token economics to mastering product architecture and optionality. The speaker warns against vendor lock-in due to volatile model pricing (the 'token town' trap) and advocates for strategies like implementing an 'auto model,' leveraging open weight models, prioritizing CPUs over GPUs for deterministic tasks, and building robust multi-agent orchestration systems.

Key takeaways

  1. Vendor Lock-In is the Primary Risk 12:08

    Relying solely on a single AI provider creates significant risk because pricing structures are volatile. The speaker asserts that 'your supplier is your competitor' (7:28), making model agnosticism crucial for business viability.

  2. Win on Product, Not Tokens 14:04

    Instead of competing on the lowest cost per token, companies must build data flywheels and orchestration layers that solve unique customer problems. The value should come from the product's workflow, not just its underlying model capability (8:44).

  3. Implement Model Agnosticism 22:05

    To maintain optionality, systems must be designed to route traffic across multiple models and providers (e.g., Notion’s 'auto model' handling 75% of traffic) to mitigate pricing shocks or provider deprecations (13:25).

  4. Prioritize CPUs for Deterministic Tasks

    For tasks that do not require complex reasoning—such as turning a CSV into a PDF, running deterministic SQL queries, or simple tool calls—CPUs are often more cost-effective and efficient than relying on GPUs/LLMs (17:00).

Watch on YouTube Full article

Knowing When Not to Use AI: AI Agents vs Rules vs ML thumbnail

· 10:35

Knowing When Not to Use AI: AI Agents vs Rules vs ML

System design requires disciplined choices regarding intelligence types—Human judgment, Rules/Code, Machine Learning, or Generative AI—rather than defaulting to AI agents for every problem. The choice must balance trade-offs across accuracy, cost, complexity, and risk. Successful modern systems are typically hybrid, combining the determinism of code with the pattern recognition of ML and the flexibility of LLMs.

Key takeaways

  1. Human Judgment 2:00

    Best for high-stakes decisions, ambiguity, ethical considerations, or situations requiring accountability (e.g., medical diagnosis, legal interpretation). Trade-offs include being expensive, slow, and difficult to scale.

  2. Rules/Code-Based Solutions 3:00

    Ideal for tasks requiring clear, stable logic, consistent exact outputs, and zero error tolerance (e.g., payment processing, input validation, security access control). Code is fast, cheap, reliable, and highly interpretable.

  3. Machine Learning (ML) 4:10

    Excels at finding patterns in structured data and making probabilistic predictions when rules are too complex to define manually (e.g., fraud detection, customer churn prediction). Requires monitoring for model drift.

  4. Generative AI (LLMs/Agents) 5:40

    Best used when inputs are unstructured (text, documents) and tasks require reasoning or transformation. Flexibility is prioritized over precision, and some error is tolerated (e.g., summarization, intent understanding). Trade-offs include non-determinism and higher cost at scale.

Watch on YouTube Full article

Why I switched to Pi... thumbnail

· 15:19

Why I switched to Pi...

The video provides a deep technical comparison of coding agents, arguing that Pi Agent offers superior flexibility for building complex agentic systems compared to competitors like Cloud Code and CodeX. Its core strength lies in its 'extension' system, which allows users to programmatically modify the agent's entire harness—including tools, contexts, hooks, and even the UI—making it ideal for advanced build engineering projects and product development.

Key takeaways

  1. Pi Agent's Core Advantage 3:30

    Unlike other agents where modifications are limited by their SDK/CLI structure, Pi Agent's design philosophy allows the harness to adapt to the user. This flexibility enables deep customization across tools, contexts, and hooks.

  2. Extensibility and Customization 5:40

    Pi Agents can be extended using new extension files (written by humans or agents) to add custom tools (e.g., clipboard access), modify system prompts, or implement complex logic like permission gates.

  3. Advanced System Building 10:30

    The Pi Agent SDK can be used not just as a coding agent but as an entire product scaffold. This includes packages for the AI SDK, agent loop management, and task scheduling (upgrader package), enabling the creation of complex, autonomous systems like 'Post AI'.

  4. Web Deployment Considerations 13:40

    When deploying a Pi Agent to a web-hosted environment (non-local file system), developers must manually manage session state and wrap default tools (like `read` or `bash`) within user-specific sandboxes, even if using the SDK.

Watch on YouTube Full article