This chapter is divided into eight parts; they are: • Metrics for LLM Inference • Measuring a Single Request • Warmup and Synchronization • Measuring GPU Work with CUDA Events • Measuring Memory Usage • Measuring Concurrent Requests • Multiple GPUs and Multiple Machines • Cost per Token The most common inference metrics are: • Latency: How long a request takes from start to finish.
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
This chapter is divided into eight parts; they are: • Metrics for LLM Inference • Measuring a Single Request • Warmup and Synchronization • Measuring GPU Work with CUDA Events • M…
In this article, you will learn how static, dynamic, and continuous batching work in LLM inference, and why the differences between them matter at production...
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
In this article, you will learn how static, dynamic, and continuous batching work in LLM inference, and why the differences between them matter at production...
This chapter is divided into nine parts; they are: • Reading Logits from a Model • Greedy Decoding • Temperature Sampling • Top-$k$ Sampling • Nucleus Sampling • Repetition Penalties • Beam Search • Stop Conditions • Structured Output Constraints The model returns a vector of logits for every position in the input sequence.
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
This chapter is divided into nine parts; they are: • Reading Logits from a Model • Greedy Decoding • Temperature Sampling • Top-$k$ Sampling • Nucleus Sampling • Repetition Penalt…
This chapter is divided into four parts; they are: • Autoregressive Generation • Prefill and Decode • A Simple KV Cache • Memory Usage of the KV Cache A decoder-only transformer model predicts the next token from the tokens that came before it.
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
This chapter is divided into four parts; they are: • Autoregressive Generation • Prefill and Decode • A Simple KV Cache • Memory Usage of the KV Cache A decoder-only transformer m…
In this article, you will learn the seven architectural components that separate a production-grade agentic AI system from a demo script, and how each one...
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
In this article, you will learn the seven architectural components that separate a production-grade agentic AI system from a demo script, and how each one...
In this article, you will learn how Ollama, LM Studio, and llama.cpp differ across the dimensions that matter most to practitioners, and how to choose...
AI generation is temporarily unavailable; this entry was preserved with deterministic fallback metadata.
In this article, you will learn how Ollama, LM Studio, and llama.cpp differ across the dimensions that matter most to practitioners, and how to choose...
This article introduces five architectural patterns for managing persistent memory and state in AI agents: In-Context Working Buffer, Execution Checkpointing, Semantic Memory, Episodic Event Logs, and Multi-Scope Segregation. These patterns address short-term execution, fault tolerance, cross-session knowledge, historical reflection, and multi-tenant data privacy respectively.
Distinguishing between state (snapshot of current task) and memory (information carrier across boundaries) is crucial.
The five patterns cover short-term execution, fault tolerance, cross-session knowledge, historical reflection, and privacy isolation.
This article explores two paradigms for managing agent state—stateless and stateful—analyzing their scalability tradeoffs and illustrating implementations with Groq API code examples. Stateless agents are easy to scale horizontally but require the client to resend full conversation history, while stateful agents manage memory via a database but add architectural complexity.
Stateless agents treat each request independently, enabling easy horizontal scaling, but multi-turn conversations require the frontend to resend the entire history, leading to growing token usage.
Stateful agents manage their own conversation history, allowing the client to send only the new prompt and session ID, facilitating complex workflows but necessitating a database layer and caching strategies for scaling.
Loop engineering is the practice of designing self-running cycles for AI agents, allowing them to operate autonomously without constant human intervention. The concept gained traction in June 2026, building on earlier research such as ReAct (2022) and Reflexion (2023), and represents the latest layer in the progression from prompt engineering to context engineering to harness engineering. This article explores the definition, origin, anatomy, and challenges of building reliable loops.
Loop engineering involves designing autonomous cycles for AI agents, replacing turn-by-turn human prompting.
It emerged in June 2026 after viral posts by Peter Steinberger and Addy Osmani, building on years of research.
Agentic AI architecture has evolved by mid-2026 with native reasoning models replacing orchestrated loops, multi-agent swarms, and standardized tool protocols via MCP. This article covers how to design stateless specialist agents, memory graphs, and security patterns.
Native reasoning models make complex orchestration frameworks redundant.
Multi-agent swarms with stateless specialist agents connected via handoff tools.
This article provides a comprehensive guide to building agentic workflows in Python using LangGraph, covering everything from a single model call to a tool-using agent with persistent conversation memory. It explains state, nodes, edges, message history management, model invocation, tool registration and routing, and the ReAct reasoning loop.
LangGraph represents agents as graphs with state, nodes, and edges, making execution flow visible and inspectable.
MessagesState automatically manages conversation history with the add_messages reducer for accumulation.
This article examines prompt injection and tool misuse threats in agentic AI systems and presents five foundational defense strategies: strict least privilege, open-source guardrails, sandboxed execution, human-in-the-loop checkpoints, and monitoring/auditing.
Prompt injection and tool misuse are critical threats that can hijack AI agents or misuse their permissions.
Traditional security measures are insufficient for autonomous, reasoning AI systems.
Learn to install Ollama, download a small language model, and chat completely offline in under 15 minutes. Covers quantization basics and common troubleshooting.
Ollama simplifies local AI deployment: install, pull, and chat in three steps.
4-bit quantization reduces model size by 60%+ (e.g., Llama 3.2 3B ~2GB).
This article explains how scikit-ollama bridges scikit-learn with locally running Ollama models for zero-shot text classification, eliminating the need for cloud APIs. It walks through setting up the environment, loading a movie review sentiment dataset, instantiating a classifier backed by a local Llama 3 model, and using the fit/predict pattern with insights into the underlying mechanism.
scikit-ollama integrates local Ollama models into scikit-learn workflows via scikit-llm.
Performs zero-shot sentiment classification on movie reviews using a local Llama 3 model.
A comparison of three open-source LLM evaluation frameworks—RAGAS, DeepEval, and Promptfoo—detailing their purposes, use cases, and the importance of understanding LLM-as-a-judge biases. Includes code walkthroughs for faithfulness checking and CI-gated evaluation.
RAGAS specializes in RAG-specific scoring with academic-grade metrics; DeepEval is pytest-native for CI/CD quality gates; Promptfoo excels at multi-model comparison and red-teaming.
Common metrics include faithfulness, context precision/recall, answer relevancy, and G-Eval.
This article outlines architectural and operational anti-patterns that cause AI agent projects to fail, including premature multi-agent systems, tool sprawl, hardcoded logic, missing memory design, lack of observability, ungoverned write access, context drift, and skipping evaluation. It emphasizes starting simple, building for observability, and adding complexity only when measurable returns justify it.
AI agent failures are often due to architecture and design mistakes, not the model itself.
Premature multi-agent architecture adds coordination overhead; start with a single agent.
A comparison of LangChain, LlamaIndex, and raw API calls for LLM applications, covering their strengths, trade-offs, and a decision framework for choosing the right abstraction level.
LangChain excels at orchestrating complex workflows and agents but can introduce overhead and debugging complexity.
LlamaIndex specializes in retrieval-augmented generation (RAG) with strong data ingestion and indexing capabilities.
This article explains how to decide whether agent functionality should be a tool or a subagent, and how to avoid over-engineering. Tools execute code deterministically; subagents execute reasoning in separate contexts. A three-question framework helps make the choice, and the costs of subagents are outlined.
Tools are deterministic operations like API calls; subagents are independent reasoning loops.
Use tools for well-defined tasks without multi-step reasoning; use subagents for complex reasoning, context isolation, or parallel tasks.
A comprehensive guide on how to maintain tool selection accuracy in AI agents as the tool catalog scales, covering techniques like gating, retrieval-based selection, semantic routing, planning, fallback logic, and benchmarking.
Tool selection accuracy degrades as tool count grows beyond 15-20 due to context crowding and 'lost in the middle' effects.
Gating filters out conversational turns before expensive selection, reducing latency and cost.
This article explains the distinct roles of context engineering and memory engineering in agentic AI systems. Context engineering focuses on selecting, compressing, and placing information within a single inference call. Memory engineering deals with persisting, retrieving, and maintaining information across calls and sessions. They intersect at the retrieval boundary, where poor management leads to common failures like context pollution or stale data.
Context engineering optimizes the information used in a single LLM call through selective inclusion, placement, and compression.
Memory engineering covers write policy, storage backends, retrieval strategies, and maintenance for long-term reliability.
This article presents five practical strategies for managing context windows in long-running AI agent applications, along with the key tradeoffs each approach introduces.
Sliding windows are simple and fast but cause digital amnesia.
Recursive summarization compresses history for long-term memory but loses details.
Model Context Protocol (MCP) is an open standard by Anthropic that standardizes communication between AI applications and external tools/data sources. This article explains MCP at three levels: why it matters, its architecture and request flow, and production considerations including transport, security, and deployment.
MCP reduces integration complexity from M×N custom adapters to M+N protocol implementations.
The architecture involves Host, Client, and Server; the Client handles protocol mechanics while the Server bridges to external systems.
This article explains the seven-layer production AI agent stack, from foundation models to deployment infrastructure. It covers each layer's function, code examples, and technology choices for prototyping, startup, and enterprise scenarios.
AI agents consist of seven layers: foundation model, orchestration framework, memory, retrieval (RAG), tools, observability, and deployment.
Foundation models like GPT-5.5, Claude Sonnet 4.6, Gemini 3.1 Pro, and open-weight models serve as the cognitive core.
This article explains how to distinguish agentic workflows from autonomous agents by focusing on who owns control flow—a human writing code in advance, or a model reasoning at runtime. It covers deterministic workflows, orchestrated workflows, reactive agents (ReAct loop), and autonomous multi-agent systems with runnable code examples. The real axis is predictability versus autonomy, not whether an LLM is involved. Workflows dominate production today, and hybrid architectures are the emerging pattern.
The core distinction is who determines the next step: human-written code vs. model runtime reasoning.
Deterministic workflows have fixed paths; orchestrated workflows have predefined branches; reactive agents decide paths at runtime; multi-agent systems delegate among sub-agents.
This article explains why large context windows are not the same as agent memory, and how retrieval, compression, and summarization techniques fit together in an agent’s cognitive stack.
Context windows are a stateless scratchpad, not persistent memory.
Retrieval-augmented generation (RAG) fetches relevant data but may introduce contradictions.
Learn how to build a text clustering pipeline using large language model embeddings and HDBSCAN to automatically discover topics in unlabeled text data. Covers embedding generation with sentence-transformers, dimensionality reduction with UMAP, and clustering with HDBSCAN.
Generate text embeddings using a pre-trained sentence-transformers model
Reduce embedding dimensionality with UMAP for clustering
This article explains how to build AI agents that can browse and interact with real websites using Playwright, browser-use, and LangGraph. It covers Playwright's advantages over Selenium (30-50% faster, persistent WebSocket, built-in auto-waiting, realistic events), setup steps, dynamic page scraping, multi-step form filling, anti-bot detection handling, session persistence, and Docker deployment. Through code examples, readers will create a working browser agent that navigates sites, fills forms, extracts structured data, and uses an LLM for decision-making.
Playwright outperforms Selenium with persistent WebSocket connections, 30-50% faster operations, and built-in auto-waiting and realistic mouse/keyboard events.
Setup requires Python 3.10+, an OpenAI API key, and a few pip installs, including Playwright browser binaries.