BerriAI/litellm · error · ValueError
GCS bucket_name is required
Error message
GCS bucket_name is required
What it means
Validation when building the GCS upload target for a Vertex AI file: no bucket_name was configured (via litellm_params or default), so there is no destination bucket for the managed upload.
Source
Thrown at litellm/llms/vertex_ai/files/transformation.py:728
## 1. If jsonl, derive the object name from the first entry's model
first_entry: Final = next(_iter_openai_jsonl_entries(file_data), None)
if first_entry is not None:
return self._get_gcs_object_name_from_batch_jsonl([first_entry])
## 2. If not jsonl, store under a server-generated managed object name
filename, _ = extract_file_metadata(file_data)
return build_managed_cloud_object_name(
prefix=f"{VERTEX_AI_MANAGED_GCS_PREFIX}uploads/",
filename=filename,
fallback_filename="file",
)
def _get_configured_bucket_name(self, litellm_params: dict) -> str:
bucket_name: Final = (
litellm_params.get("gcs_bucket_name") or litellm_params.get("bucket_name") or os.getenv("GCS_BUCKET_NAME")
)
if not bucket_name:
raise ValueError("GCS bucket_name is required")
return bucket_name
def get_complete_file_url(
self,
api_base: str | None,
api_key: str | None,
model: str,
optional_params: dict,
litellm_params: dict,
data: CreateFileRequest,
) -> str:
"""
Get the complete url for the request
"""
bucket_name = self._get_configured_bucket_name(litellm_params)
bucket_name, object_prefix = split_configured_cloud_bucket_name(bucket_name)
file_data: Final = data.get("file")
purpose: Final = data.get("purpose")View on GitHub (pinned to 77b7c6c40c)
Solutions
- Provide the GCS bucket_name for file storage.
Example fix
# pass bucket_name in litellm_params for the files call.
Defensive patterns
Strategy: validation
When it happens
Trigger: Triggered when a Vertex AI files operation requires a GCS bucket_name but none is provided.
Common situations: See trigger scenarios.
AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18).
Data as JSON: /api/errors/26078bb5b0c31cbc.
Report an issue: GitHub.