Skip to main content
Pydantic Deep Agents is an open-source deep-agent framework built on top of Pydantic AI by Vstorm, with planning, subagents, persistent memory, sandboxed execution, live-run forking, and cost control. This runtime exposes it to LiteLLM Agent Platform through a small bridge server that speaks the Anthropic Managed Agents API, so agents and sessions use the same event stream shape as Claude Managed Agents. This page covers the Pydantic Deep Agents bridge template. For the LangChain Deep Agents Compose runtime, see Deep Agents.
Pydantic Deep Agents is an independent open-source project built and maintained by Vstorm, contributors to and partners across the broader Pydantic AI ecosystem. It is built on top of Pydantic AI but is not an official Pydantic library.
The bridge stores agents, environments, sessions, and event history in SQLite. Each session gets its own Pydantic Deep LocalBackend workspace under PYDANTIC_DEEP_WORKDIR_ROOT.

Prerequisites

  • Python 3.12 or newer
  • LiteLLM Agent Platform running locally or deployed
  • A model provider key, or a LiteLLM gateway the bridge can call

1. Start the bridge

Run the smoke test against the bridge:

2. Route through LiteLLM

For an OpenAI-compatible LiteLLM gateway, set:
When LITELLM_BASE_URL is set in OpenAI mode, bare model names are normalized to openai:<model> for Pydantic AI, and /v1/models proxies LiteLLM model discovery with a local fallback. For an Anthropic Messages-compatible gateway, set:
In Anthropic gateway mode, bare model names are normalized to anthropic:<model>. The bridge passes the gateway root URL to Pydantic AI’s AnthropicModel, and the Anthropic SDK appends /v1/messages when sending requests.

3. Register the custom runtime

Register the running bridge in LiteLLM Agent Platform:
The alias becomes the runtime ID for agents and sessions. The api_spec tells LiteLLM Agent Platform to drive the bridge through the existing Claude Managed Agents protocol.

4. Create an agent

In the UI, click New Agent, choose pydantic-deepagents as the runtime, select a model, and set a system prompt. Or via the API:

5. Start a session and stream events

The stream emits Anthropic Managed Agents-compatible event frames:

MCP verification

Use the deterministic Pydantic AI test model to verify the bridge and MCP plumbing without a provider API key:
Then run the DeepWiki MCP smoke:
The smoke creates an agent with https://mcp.deepwiki.com/mcp, sends a managed-agent event, and asserts the SSE stream contains agent.tool_use, agent.tool_result, agent.message, and session.status_idle.

Configuration

Do not put model provider keys in browser-visible LAP config. Provider keys belong in the bridge environment or in the LiteLLM gateway the bridge calls.