BerriAI/litellm · error · NotImplementedError
adelete_sandbox must be implemented by provider
Error message
adelete_sandbox must be implemented by provider
What it means
Raised by the abstract async adelete_sandbox stub on the base sandbox transformation class. It fires when a provider config never overrode async sandbox deletion, meaning the base implementation was invoked on a provider that has no sandbox-teardown support wired up.
Solutions
- Use a provider that supports sandbox deletion; adelete_sandbox is abstract.
- Implement adelete_sandbox in the custom provider's transformation class.
- Verify the provider name routes to a supported sandbox provider.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at litellm/llms/base_llm/sandbox/transformation.py:80 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/7b8dd433de41f232.
Report an issue: GitHub.
Appendix: source
Thrown at litellm/llms/base_llm/sandbox/transformation.py:80
async def arun_code(
self,
*,
container: ContainerHandle | str,
code: str,
api_key: str | None = None,
**kwargs,
) -> CodeExecutionResult:
raise NotImplementedError("arun_code must be implemented by provider")
async def adelete_sandbox(
self,
*,
container: ContainerHandle | str,
api_key: str | None = None,
**kwargs,
) -> bool:
raise NotImplementedError("adelete_sandbox must be implemented by provider")
async def _read_capped_lines(self, response: httpx.Response) -> list[str]:
lines: Final[list[str]] = []
total = 0
async for line in response.aiter_lines():
total += len(line.encode("utf-8"))
if total > SANDBOX_MAX_OUTPUT_BYTES:
raise ValueError(
f"Sandbox output exceeded {SANDBOX_MAX_OUTPUT_BYTES} bytes; aborting to avoid unbounded memory use."
)
lines.append(line)
return lines
View on GitHub (pinned to 77b7c6c40c)