Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

refactor(types): host ObjectPermissionDict in litellm/types/ for SDK reuse

yucheng-berriaib9e58758e091
diff --git a/litellm/proxy/_types.py b/litellm/proxy/_types.py
index 7d470fba08b..5fe17d79ab5 100644
--- a/litellm/proxy/_types.py
+++ b/litellm/proxy/_types.py
@@ -1005,23 +1005,9 @@ class LiteLLM_ObjectPermissionBase(LiteLLMPydanticObjectBase):
search_tools: Optional[List[str]] = None
-class ObjectPermissionDict(TypedDict, total=False):
- """Plain-dict mirror of LiteLLM_ObjectPermissionBase used by validators
- that need to mutate the payload before persistence (e.g. MCP server
- identifier normalization in object_permission_utils)."""
-
- mcp_servers: Optional[list[str]]
- mcp_access_groups: Optional[list[str]]
- mcp_tool_permissions: Optional[dict[str, list[str]]]
- mcp_toolsets: Optional[list[str]]
- blocked_tools: Optional[list[str]]
- vector_stores: Optional[list[str]]
- agents: Optional[list[str]]
- agent_access_groups: Optional[list[str]]
- models: Optional[list[str]]
- search_tools: Optional[list[str]]
-
-
+from litellm.types.object_permission import ( # noqa: E402
+ ObjectPermissionDict as ObjectPermissionDict,
+)
from litellm.models.team import BudgetLimitEntry as BudgetLimitEntry # noqa: E402
diff --git a/litellm/types/object_permission.py b/litellm/types/object_permission.py
new file mode 100644
index 00000000000..ff932dccd5d
--- /dev/null
+++ b/litellm/types/object_permission.py
@@ -0,0 +1,26 @@
+"""
+TypedDict mirror of ``LiteLLM_ObjectPermissionBase`` for in-memory dict
+payloads passed through validators that mutate before persistence (e.g.
+MCP server identifier normalization in object_permission_utils).
+
+Lives in ``litellm/types/`` so SDK-side modules (``litellm.types.agents``)
+can adopt the type without violating the SDK-must-not-import-from-proxy
+layering rule.
+"""
+
+from typing import Optional
+
+from typing_extensions import TypedDict
+
+
+class ObjectPermissionDict(TypedDict, total=False):
+ mcp_servers: Optional[list[str]]
+ mcp_access_groups: Optional[list[str]]
+ mcp_tool_permissions: Optional[dict[str, list[str]]]
+ mcp_toolsets: Optional[list[str]]
+ blocked_tools: Optional[list[str]]
+ vector_stores: Optional[list[str]]
+ agents: Optional[list[str]]
+ agent_access_groups: Optional[list[str]]
+ models: Optional[list[str]]
+ search_tools: Optional[list[str]]