{"slug": "skills-on-steroids-on-demand-capabilities-in-pydantic-ai", "title": "Skills on steroids: on-demand capabilities in Pydantic AI", "summary": "Pydantic AI released on-demand capabilities that allow AI models to defer loading instructions, tools, and settings until needed, reducing token costs. The feature, requested by users, uses a `defer_loading=True` parameter and a `load_capability` call to inject full capability bundles only when the model requests them. This progressive disclosure approach aims to minimize context size and lower inference expenses.", "body_md": "We asked our users which features they wanted and skills came up on top. We dug into what they actually meant when they said \"skills\", and it was the same answer every time: ** progressive disclosure**.\n\n*(My colleague David Sanchez shared this on our call when we were designing the feature.)*\n\nThe problem with upfront capabilities\n\nBefore this, adding a capability meant loading everything onto the model immediately: instructions, tools, all of it, every request, whether it was needed or not.\n\nAI stopped being a free lunch a while ago. Input tokens cost money, and loading context that has no chance of being useful on a given turn is a colossal waste.\n\nHow to use on-demand capabilities\n\nMark a capability with `defer_loading=True`\n\nand give it an `id`\n\n. That's it. In context, the full bundle collapses to a single line: just the `id`\n\nand an optional `description`\n\n.\n\nThe model starts with a catalog of what's available and nothing more. When it decides it needs a capability, it calls `load_capability`\n\n, and we inject the full bundle in one shot. The model asks for it, the model gets it.\n\n``` python\nfrom pydantic_ai import Agent\nfrom pydantic_ai.capabilities import Capability\n\norders = Capability(\n    id='orders',\n    description='Use for order tracking and delivery status.',\n    instructions='Always quote the order ID when discussing an order.',\n    defer_loading=True,\n)\n\n@orders.tool\ndef order_status(ctx, order_id: str) -> str:\n    \"\"\"Look up shipping status for an order.\"\"\"\n    return f'Order {order_id}: in transit'\n\nagent = Agent(\n    'anthropic:claude-sonnet-4-6',\n    instructions='You are a customer support agent.',\n    capabilities=[orders],\n)\n```\n\nDefer everything\n\nInstructions? Served only when the model actually needs them.\n\nModel settings? Set per capability, applied when it loads.\n\nHooks? Structurally gated. Only triggers if the capability is loaded.\n\nThat's the whole idea. Your agent knows what it has available. It reaches for what it needs. Everything else stays out of the way until it's useful.\n\nMark your capabilities with `defer_loading=True`\n\nand watch your token costs tank.\n\nGetting started\n\nOn-demand capabilities are in Pydantic AI now:\n\n```\nuv add pydantic-ai\n```\n\nMark your heaviest capabilities with `defer_loading=True`\n\n, give each an `id`\n\n, and let the model reach for them when it needs them.\n\nThe [capabilities docs](https://pydantic.dev/docs/ai/core-concepts/capabilities/#on-demand-capabilities) have the full reference.\n\nIf it shrinks your context (and your bill), a star on [GitHub](https://github.com/pydantic/pydantic-ai) helps other people find it.\n\nWant to see which capabilities your agents actually load, token by token? [Pydantic Logfire](https://pydantic.dev/logfire) monitors Pydantic AI out of the box, with full-stack and AI traces in one platform. New Team and Growth accounts get a [$10 starter credit](https://pydantic.dev/articles/ai-gateway-starter-credit?utm_source=blog&utm_medium=cta&utm_campaign=pydantic-ai-capabilities) for inference through Pydantic AI Gateway, applied automatically when you upgrade.", "url": "https://wpnews.pro/news/skills-on-steroids-on-demand-capabilities-in-pydantic-ai", "canonical_source": "https://pydantic.dev/articles/pydantic-ai-capabilities", "published_at": "2026-06-22 09:00:00+00:00", "updated_at": "2026-07-16 14:31:11.268346+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "artificial-intelligence", "large-language-models"], "entities": ["Pydantic AI", "David Sanchez", "Pydantic Logfire", "Pydantic AI Gateway", "GitHub", "Anthropic", "Claude Sonnet"], "alternates": {"html": "https://wpnews.pro/news/skills-on-steroids-on-demand-capabilities-in-pydantic-ai", "markdown": "https://wpnews.pro/news/skills-on-steroids-on-demand-capabilities-in-pydantic-ai.md", "text": "https://wpnews.pro/news/skills-on-steroids-on-demand-capabilities-in-pydantic-ai.txt", "jsonld": "https://wpnews.pro/news/skills-on-steroids-on-demand-capabilities-in-pydantic-ai.jsonld"}}