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.
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
2. Route through LiteLLM
For an OpenAI-compatible LiteLLM gateway, set: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:
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: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, choosepydantic-deepagents as the runtime,
select a model, and set a system prompt.
Or via the API:
5. Start a session and stream events
MCP verification
Use the deterministic Pydantic AItest model to verify the bridge and MCP
plumbing without a provider API key:
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
| Variable | Default | Purpose |
|---|---|---|
PORT | 8080 | HTTP port |
DB_PATH | /data/agents.db | SQLite persistence path |
PYDANTIC_DEEP_WORKDIR_ROOT | /data/workspaces | Root directory for per-session workspaces |
DEFAULT_MODEL | anthropic:claude-sonnet-4-6 | Model used when agent creation omits one |
ANTHROPIC_API_KEY | none | Direct Anthropic provider key |
OPENAI_API_KEY | none | Direct OpenAI provider key |
OPENAI_BASE_URL | none | OpenAI-compatible base URL |
LITELLM_BASE_URL | none | LiteLLM gateway base URL for model discovery and model calls |
LITELLM_API_KEY | none | LiteLLM gateway API key |
LITELLM_API_FORMAT | openai | Gateway API shape: openai for /v1/chat/completions, anthropic for /v1/messages |
LITELLM_MODELS | none | Comma-separated fallback model IDs for /v1/models |
RUNTIME_API_KEY | none | Runtime key expected from LAP via x-api-key; when unset, any non-empty key is accepted for local development |
PYDANTIC_DEEP_EXECUTE | true | Enables the Pydantic Deep execute tool |
PYDANTIC_DEEP_TODO | true | Enables todo tools |
PYDANTIC_DEEP_FILESYSTEM | true | Enables filesystem tools |
PYDANTIC_DEEP_SUBAGENTS | true | Enables subagent tools |
PYDANTIC_DEEP_SKILLS | true | Enables skill tools |
PYDANTIC_DEEP_BUILTIN_SUBAGENTS | true | Enables built-in subagent tools |
PYDANTIC_DEEP_PLAN | true | Enables planning tools |
PYDANTIC_DEEP_MEMORY | true | Enables persistent memory tools |
PYDANTIC_DEEP_WEB_SEARCH | true | Enables web search tools |
PYDANTIC_DEEP_WEB_FETCH | true | Enables web fetch tools |
PYDANTIC_DEEP_THINKING | false in Anthropic gateway mode, otherwise high | Enables Pydantic Deep thinking effort; use false, true, or an effort like low, medium, high |
PYDANTIC_DEEP_CONTEXT_MANAGER | true | Enables context management |
PYDANTIC_DEEP_COST_TRACKING | true | Enables cost tracking |
PYDANTIC_DEEP_FORKING | false | Enables live run forking tools |
PYDANTIC_DEEP_CHECKPOINTS | false | Enables checkpoint tools |
PYDANTIC_DEEP_TEAMS | false | Enables team tools |
PYDANTIC_DEEP_LITEPARSE | false | Enables LiteParse document tools |