BerriAI/litellm · error · NotImplementedError

acreate_sandbox must be implemented by provider

Error message

acreate_sandbox must be implemented by provider

What it means

Error "acreate_sandbox must be implemented by provider" thrown in BerriAI/litellm.

Solutions

  1. Use a provider that supports sandbox creation; acreate_sandbox is abstract in the base class.
  2. Implement acreate_sandbox in the custom provider's transformation class.
  3. Verify the provider name in the request matches a supported sandbox provider.

When it happens

Trigger: Thrown at litellm/llms/base_llm/sandbox/transformation.py:61 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/eead9be5e10ec95b. Report an issue: GitHub.

Appendix: source

Thrown at litellm/llms/base_llm/sandbox/transformation.py:61

    _hidden_params: dict = PrivateAttr(default_factory=dict)


class BaseSandboxConfig:
    """Provider-agnostic sandbox operations."""

    def validate_environment(self, api_key: str | None = None, **kwargs) -> str:
        raise NotImplementedError("validate_environment must be implemented by provider")

    async def acreate_sandbox(
        self,
        *,
        template: str | None = None,
        timeout: int | None = None,
        allow_internet_access: bool | None = None,
        api_key: str | None = None,
        **kwargs,
    ) -> ContainerHandle:
        raise NotImplementedError("acreate_sandbox must be implemented by provider")

    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:

View on GitHub (pinned to 77b7c6c40c)