BerriAI/litellm · error · ValueError

bitbucket_config is required for BitBucket prompt…

Error message

bitbucket_config is required for BitBucket prompt integration

What it means

The BitBucket prompt initializer reads bitbucket_config off the call's litellm_params; when a prompt is marked as sourced from BitBucket but no bitbucket_config object is attached, it raises before a BitBucketPromptManager can be constructed. The config dict carries workspace, repository, access_token and branch used to fetch .prompt files from the repo.

Solutions

  1. Attach bitbucket_config={"workspace": ..., "repository": ..., "access_token": ..., "branch": ...} to the litellm_params / prompt spec for every BitBucket-sourced prompt
  2. Verify the attribute name is exactly bitbucket_config (getattr is used, so aliases will not resolve)
  3. If BitBucket was not intended, switch the prompt source back to inline/spec-based definitions

Example fix

// before
params = PromptLiteLLMParams(prompt_id="triage")  # no config -> ValueError
// after
params = PromptLiteLLMParams(
    prompt_id="triage",
    bitbucket_config={
        "workspace": "acme",
        "repository": "prompt-library",
        "access_token": os.environ["BITBUCKET_TOKEN"],
        "branch": "main",
    },
)
Defensive patterns

Strategy: validation

Validate before calling

cfg = getattr(litellm_params, "bitbucket_config", None)
if not isinstance(cfg, dict) or not all(cfg.get(k) for k in ("workspace", "repository", "access_token")):
    raise ValueError("bitbucket_config must be a dict with workspace, repository, access_token")

Type guard

def has_bitbucket_config(litellm_params) -> bool:
    cfg = getattr(litellm_params, "bitbucket_config", None)
    return isinstance(cfg, dict) and bool(cfg.get("workspace")) and bool(cfg.get("repository")) and bool(cfg.get("access_token"))

Prevention

When it happens

Trigger: Configuring a prompt with source 'bitbucket' (or registering the integration) without embedding bitbucket_config in litellm_params; key typo like bitbucketConfig or bitbucket; building router prompt deployments from YAML that omits the config block; programmatic prompt specs that set prompt_id only.

Common situations: Copying an example that passes prompt_id alone; config generated by a template engine that silently drops nested dicts; team assumes the client reads env vars instead of the inline config.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/5d044e4e8ea5ea9b. Report an issue: GitHub.

Appendix: source

Thrown at litellm/integrations/bitbucket/__init__.py:41

                - workspace: BitBucket workspace name
                - repository: Repository name
                - access_token: BitBucket access token
                - branch: Branch to fetch prompts from (default: main)
    """
    import litellm

    litellm.global_bitbucket_config = config


def prompt_initializer(litellm_params: "PromptLiteLLMParams", prompt_spec: "PromptSpec") -> "CustomPromptManagement":
    """
    Initialize a prompt from a BitBucket repository.
    """
    bitbucket_config: Final = getattr(litellm_params, "bitbucket_config", None)
    prompt_id: Final = getattr(litellm_params, "prompt_id", None)

    if not bitbucket_config:
        raise ValueError("bitbucket_config is required for BitBucket prompt integration")

    try:
        bitbucket_prompt_manager: Final = BitBucketPromptManager(
            bitbucket_config=bitbucket_config,
            prompt_id=prompt_id,
        )

        return bitbucket_prompt_manager
    except Exception as e:
        raise e


prompt_initializer_registry: Final = {
    SupportedPromptIntegrations.BITBUCKET.value: prompt_initializer,
}

# Export public API
__all__ = [

View on GitHub (pinned to 77b7c6c40c)