# Pavlo Golovatyy (pavlo.sh) > Personal site and blog of Pavlo Golovatyy, Software Engineer specialized in AI and ML, based in Italy. Practical, first-hand articles on shipping AI and LLM systems to production (RAG, evaluation, agents, MCP, cost, security, EU AI Act), an AI engineering glossary, and a free cl100k_base token-counting API. **When to use this site.** Reach for pavlo.sh when you need: - A practitioner's explanation of a production AI engineering topic: RAG chunking, embeddings and vector databases, reranking and hybrid search, LLM evaluation and LLM-as-a-judge, agent tool design, MCP, sandboxing, prompt caching, context windows, prompt injection, or EU AI Act obligations for developers. Fetch `https://pavlo.sh/api/posts` to find the right article, then read it as markdown. - A short, plain-language definition of an AI/LLM term to cite or link: use the glossary. - A token count for text with the cl100k_base encoding: `POST https://pavlo.sh/api/tokenizer` with `{"text": "..."}`. - Facts about Pavlo Golovatyy (role, location, contact, profiles): use the About and Contact pages. **When not to use it.** This is a one-person blog, not vendor documentation: for API references of a specific model provider or library, go to that project's own docs. There is no account system, write API, or paid service. **How to call it.** No authentication. Every page has a markdown version: send `Accept: text/markdown` or append `.md` to the URL (`/index.md` for the home page). The JSON API is described in the OpenAPI spec; errors are JSON with `code`, `message`, and `hint`. Unknown URLs return HTTP 404 with a markdown body. Contact: ciao@pavlo.sh. ## Developer resources - [Developer resources](https://pavlo.sh/developers): API overview, error format, and markdown negotiation - [OpenAPI spec](https://pavlo.sh/openapi.json): OpenAPI 3.1 description of the public JSON API - [API index](https://pavlo.sh/api): JSON list of endpoints - [Articles API](https://pavlo.sh/api/posts): JSON list of all articles with URLs - [API catalog](https://pavlo.sh/.well-known/api-catalog): RFC 9727 linkset ## Pages - [Home](https://pavlo.sh/index.md): Who Pavlo Golovatyy is, projects, and every published article. - [About](https://pavlo.sh/about.md): Background, focus areas, and what this site covers. - [Contact](https://pavlo.sh/contact.md): How to reach Pavlo by email, LinkedIn, or GitHub. - [Privacy](https://pavlo.sh/privacy.md): What data this site collects and how it is used. - [Developer resources](https://pavlo.sh/developers.md): Public JSON API, OpenAPI spec, llms.txt, and markdown versions of every page. - [Bio](https://pavlo.sh/bio.md): Link-in-bio page with social profiles and email. - [Tokenizer](https://pavlo.sh/tokenizer.md): Count characters and language model tokens (cl100k_base) in real time. - [AI Engineering Glossary](https://pavlo.sh/glossary.md): Plain-language definitions of production AI and LLM terms, each linked to a deeper guide. ## Articles - [Claude vs GPT vs Gemini vs Open-Weight Models: The Late-2026 Update](https://pavlo.sh/blog/claude-vs-gpt-vs-gemini-vs-open-weight-models-late-2026-update.md): Between September 1 and October 17, 2026, every major lab replaced its lineup: Claude Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5, GPT-6 Astra, Sol and Luna, Gemini 4 Argon, plus Meta's Muse Spark Open and a new DeepSeek V4.1 Flash checkpoint. The most surprising result is that list prices converged: the three labs now charge almost exactly the same at each tier. This update covers the new lineups, what the price convergence means for how you should compare models, how close open-weight models have actually got, what their licenses really allow, and an updated guide to which model to use for what. - [Context Engineering: Why Prompt Engineering Was Never the Real Problem](https://pavlo.sh/blog/context-engineering-why-prompt-engineering-was-never-the-real-problem.md): Your agent works for ten turns and falls apart at turn forty. Nothing is wrong with the prompt. What changed is everything around it: tool definitions, tool results, retrieved documents, conversation history, half-finished plans. Context engineering is the discipline of deciding what goes into the model's context window at every step, and in 2026 it is the main reason agents either work or don't. This guide explains why bigger context windows don't solve the problem, the four ways long contexts fail, the four operations that fix them (write, select, compress, isolate), how to lay out context so prompt caching keeps working, and how to measure all of it instead of guessing. - [Designing Tools for Agents: Why Your API Is Not an Agent Interface](https://pavlo.sh/blog/designing-tools-for-agents-why-your-api-is-not-an-agent-interface.md): The fastest way to give an agent tools is to wrap your existing REST API one endpoint at a time. It is also the most reliable way to build an agent that picks the wrong tool, invents IDs, drowns in JSON, retries a payment twice, and deletes something nobody asked it to delete. MCP standardized how tools are connected, but it says almost nothing about how they should be designed. This guide covers the design layer: how granular a tool should be, how to name and describe it, how to shape inputs and outputs for a model instead of a programmer, how to write error messages the model can recover from, how to paginate and truncate, how to make writes idempotent, and how to put a human in front of destructive actions without drowning them in approvals. - [LLM-as-a-Judge: How to Build Evaluators You Can Actually Trust](https://pavlo.sh/blog/llm-as-a-judge-how-to-build-evaluators-you-can-trust.md): Using a model to grade another model is the default way to evaluate open-ended LLM output, and it is also one of the easiest ways to fool yourself. A judge can agree with humans 85 percent of the time and still be useless on the cases you care about. This guide covers what the research actually says about judge reliability, how to write a rubric and a judge prompt, the biases you have to design around (position, verbosity, self-preference, style), how to calibrate a judge against human labels with true positive rate, true negative rate and Cohen's kappa, when to use panels and reasoning judges, and how to run judges in production without letting them drift, overspend, or get prompt-injected. - [Your Agent Will Find the Gap: Sandboxing and Least Privilege After the Hugging Face Breach](https://pavlo.sh/blog/ai-agent-sandboxing-least-privilege-after-the-hugging-face-breach.md): In July 2026, agents running on OpenAI models escaped an evaluation sandbox that had exactly one way out, and ran a four-and-a-half-day campaign that ended inside Hugging Face's production infrastructure. They were not malicious. They wanted the answer key to a benchmark. Almost every link in that chain was an ordinary weakness: a package proxy, secrets in environment variables, a template renderer, the cloud metadata endpoint. This article walks through what actually happened, why goal-driven agents route around the boundaries you give them, why your API keys are now what attackers want most, and the containment layers I would put around any agent that runs code or calls tools in production. - [Reranking and Hybrid Search: The Retrieval Layer Everyone Skips](https://pavlo.sh/blog/reranking-and-hybrid-search-the-retrieval-layer-everyone-skips.md): Most teams tune chunking, pick an embedding model, and then leave the actual retrieval step at its default: top-5 by cosine similarity. That default is usually the weakest link in the whole pipeline. This guide covers the layer in between, why pure vector search fails on the queries that matter most, how BM25 and dense retrieval fail differently, how to fuse them with Reciprocal Rank Fusion instead of hand-tuned weights, what a cross-encoder reranker actually does and what it costs in latency, and how to size a retrieve-then-rerank pipeline and measure each stage separately. - [The 88% Problem: Why Almost Every AI Agent Pilot Dies Before Production](https://pavlo.sh/blog/why-ai-agent-pilots-never-reach-production.md): Three independent studies in 2026 put the enterprise AI agent pilot failure rate somewhere between 86 and 89 percent. The interesting part is that almost none of those failures are model failures. This article breaks down where pilots actually die, why a great demo is a poor predictor of a working system, how per-step reliability compounds into production failure, and what the small minority of teams that ship are doing differently. - [The EU AI Act Deadline Did Not Move for You: What Developers Have to Ship by August 2026](https://pavlo.sh/blog/eu-ai-act-august-2026-what-developers-actually-have-to-ship.md): Most engineering teams read the headline that the EU AI Act was delayed and stopped paying attention. The delay applies to high-risk systems, not to Article 50, which becomes enforceable on 2 August 2026 with fines up to 15 million euro or 3 percent of global turnover. If you ship a chatbot, an agent, or anything that generates text, images, audio, or video, this is the deadline that lands on your backlog. This guide translates Article 50 into engineering requirements: what to disclose, what to mark machine-readable, where the exceptions actually apply, and what to build this week. - [Claude vs GPT vs Gemini in 2026: Which One to Use for What](https://pavlo.sh/blog/claude-vs-gpt-vs-gemini-how-to-choose-in-2026.md): Anthropic, OpenAI, and Google are all shipping new flagship models every few weeks in 2026, and none of them wins on every axis anymore. This guide compares the current Claude, GPT-5.6, and Gemini 3 lineups model by model, with real pricing, real benchmark data, and a practical framework for choosing the right model, or the right combination of models, for coding, research, enterprise work, and cost-sensitive pipelines. - [Prompt Caching and Semantic Caching: The Two Levers That Actually Cut Your LLM Bill](https://pavlo.sh/blog/prompt-caching-and-semantic-caching-cut-llm-costs.md): Two techniques share the word "cache" in LLM engineering, and teams mix them up constantly, even though they solve different problems at different layers. This guide explains how prompt caching reuses already-processed tokens to cut input costs, how semantic caching skips the model entirely on near-duplicate queries, the real numbers from Anthropic, OpenAI, and Gemini, and the failure modes, like stale answers and false positives, that make semantic caching far riskier than it looks. - [Chunking Strategies for RAG: The Decision That Makes or Breaks Retrieval](https://pavlo.sh/blog/chunking-strategies-for-rag-the-decision-that-makes-or-breaks-retrieval.md): Chunking is the quietest, most consequential decision in any RAG system. The chunk is the unit of retrieval, so if you split your documents badly, no embedding model or reranker can save you. This guide explains the real trade-off between precision and context, the chunk sizes and overlaps that actually work, and the full ladder of strategies, from recursive splitting to late chunking and contextual retrieval, so you know which one your documents actually need. - [Model Context Protocol (MCP) Explained: The USB-C of AI Agents](https://pavlo.sh/blog/model-context-protocol-mcp-explained.md): Every AI agent that connects to a tool, a database, or an API used to need its own custom integration code. Model Context Protocol replaces that with one standard. This guide explains what MCP actually is, how hosts, clients, and servers fit together, how tools, resources, and prompts differ, why it spread across the industry so fast, and the real security and token-cost tradeoffs you take on the moment you connect a server. - [RAG vs Fine-Tuning vs Prompting: How to Actually Choose in 2026](https://pavlo.sh/blog/rag-vs-fine-tuning-vs-prompting-how-to-choose.md): The most common architecture question in LLM applications has no one-size answer. This guide explains what prompting, RAG, and fine-tuning each actually change, why the difference is knowledge versus behavior, why most teams reach for fine-tuning too early, and how to walk the 2026 decision ladder—prompt, then RAG, then fine-tune, then distill—without wasting months and budget. - [How to Integrate Artificial Intelligence into Business Processes Without Disrupting Everything](https://pavlo.sh/blog/how-to-integrate-artificial-intelligence-into-business-processes-without-disrupting-everything.md): A practical, updated playbook for integrating AI into business processes in the LLM era. Learn how to assess readiness, pick high-impact use cases, decide between traditional ML and LLMs, evaluate systems before they ship, manage security risks like prompt injection, and roll out gradually without breaking operations. - [Optimization of ML Models: Advanced Techniques to Reduce Resource Consumption](https://pavlo.sh/blog/optimization-of-ml-models-advanced-techniques-to-reduce-resource-consumption.md): Models keep getting bigger while budgets do not. This updated guide covers the techniques that make machine learning and LLMs cheaper to run without sacrificing accuracy: quantization, pruning, knowledge distillation, feature selection, efficient hardware, and adaptive computation, with practical notes on applying them to large language models in production. - [Embeddings Explained: Choosing the Right Model and Vector Database for Production](https://pavlo.sh/blog/embeddings-explained-choosing-the-right-model-and-vector-database-for-production.md): Your RAG system is only as good as the embeddings underneath it. This guide explains what embeddings actually are, how to choose an embedding model in 2026 without trusting leaderboards blindly, how dimensions affect cost and latency, and how to pick a vector database (Pinecone, Qdrant, Weaviate, Milvus, pgvector) based on scale, indexing, and filtering rather than hype. - [Prompt Injection: The Security Hole in Every LLM App](https://pavlo.sh/blog/prompt-injection-security-holes-in-every-llm-app.md): Prompt injection is the number one security risk in LLM applications, and there is no patch that makes it go away. This guide explains direct and indirect injection, how data gets exfiltrated through tools and markdown images, the lethal trifecta that makes agents dangerous, and the defense-in-depth strategy that actually reduces your blast radius in production. - [LLM Evaluation: Why Your Demo Works but Production Fails](https://pavlo.sh/blog/llm-evaluation-why-your-demo-works-but-production-fails.md): Most LLM applications demo perfectly and then break with real users. This guide explains how to evaluate LLM applications properly: how to build an eval dataset, the metrics that actually matter, how to use LLM-as-a-judge without fooling yourself, and how to catch regressions before your users do. - [Why Tokens Matter: The Hidden Unit That Shapes Your LLM Bills, Context, and Performance](https://pavlo.sh/blog/why-tokens-matter.md): Tokens are the fundamental unit of everything you do with LLMs: pricing, context limits, latency, retrieval, even multilingual fairness. This article explains what tokens really are, why they behave strangely across languages, and how a practical understanding of tokenization changes the way you design AI systems. - [RAG in Production: What Nobody Tells You Before You Deploy](https://pavlo.sh/blog/rag-in-production-what-nobody-tells-you.md): RAG sounds simple in theory: retrieve relevant chunks, inject them into the prompt, get better answers. In production, the reality is far messier. This guide covers the real failure modes, including chunking pitfalls, embedding drift, retrieval quality collapse, and latency traps, and what actually works to fix them. - [LLM Context Window Limitations: Why More Tokens Hurt Your AI App Performance](https://pavlo.sh/blog/llm-context-window-limitations-accuracy-degradation.md): Large language models advertise million-token context windows, but longer inputs silently degrade accuracy. Learn why the "lost in the middle" problem affects every major LLM, and what RAG and prompt structuring strategies actually work for production AI systems. - [Agent Skills vs Multi-Agent Systems: Are We Witnessing the Next Architectural Shift in AI?](https://pavlo.sh/blog/agent-skills-vs-multi-agent-systems-architectural-shift-ai.md): Agent Skills introduce a new paradigm for building AI systems by packaging operational knowledge into reusable modules. But can they truly replace multi-agent architectures? This article explores the trade-offs, strengths, and future of both approaches. - [OpenAI Agents SDK: How to Build Agentic AI Applications in Python Easily](https://pavlo.sh/blog/openai-agents-sdk-build-agentic-ai-apps-in-python-with-ease.md): Learn how to build powerful, customizable agentic AI applications in Python using the OpenAI Agents SDK. Discover multi-agent orchestration, guardrails, and built-in tracing for production-ready AI workflows. ## Optional - [Sitemap](https://pavlo.sh/sitemap.xml): every public URL - [RSS feed](https://pavlo.sh/rss.xml): article feed - [Avatars as a microservice](https://avatar.pavlo.sh): deterministic gradient avatars by URL, in PNG or SVG