BerriAI/litellm · error · ValueError

GCS Bucket logging is a premium feature. Please upgrade to…

Error message

GCS Bucket logging is a premium feature. Please upgrade to use it. {CommonProxyErrors.not_premium_user.value}

What it means

GCSBucketLogger.__init__ raises ValueError when premium_user (imported from litellm.proxy.proxy_server) is not True — GCS bucket logging is gated as a litellm enterprise/premium feature. The check runs at callback construction time, so the proxy fails as soon as the 'gcs_bucket' callback is loaded, not at first log.

Solutions

  1. If you have an enterprise license, ensure it is configured so premium_user resolves to True (see litellm enterprise docs for premium_user).
  2. Otherwise remove 'gcs_bucket' from callbacks and use a non-gated destination (e.g. the FOCUS GCS/S3 export integrations, or another logging callback).
  3. Do not try to force premium_user=True without a license — that is a licensing violation and breaks support.
  4. Move GCS upload responsibilities to an external job if enterprise is not an option.

Example fix

# before (config.yaml)
litellm_settings:
  callbacks: [gcs_bucket]  # raises ValueError on OSS proxy

# after
litellm_settings:
  callbacks: [gcs_pubsub]  # or another supported non-premium callback
Defensive patterns

Strategy: try-catch

Validate before calling

from litellm.proxy.proxy_server import premium_user
if premium_user is not True and 'gcs_bucket' in config.litellm_settings.callbacks:
    raise SystemExit('gcs_bucket logging requires a litellm enterprise license; remove it or license the proxy')

Try / catch

try:
    GCSBucketLogger()
except ValueError as e:
    if 'premium feature' in str(e):
        # remove callback from config instead of retrying; licensing cannot be fixed at runtime
        disable_callback('gcs_bucket')
    raise

Prevention

When it happens

Trigger: Adding 'gcs_bucket' to litellm_settings.callbacks (or GCS_BUCKET_NAME being set such that the callback activates) on a proxy where premium_user is False; running the open-source proxy without an enterprise license key.

Common situations: Following GCS logging docs that assume an enterprise deployment; self-hosted users enabling enterprise-only callbacks; forgetting that premium gating applies to GCS logging unlike S3/other handlers.

Related errors


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

Appendix: source

Thrown at litellm/integrations/gcs_bucket/gcs_bucket.py:50

        super().__init__(bucket_name=bucket_name)

        self.batch_size = int(os.getenv("GCS_BATCH_SIZE", GCS_DEFAULT_BATCH_SIZE))
        self.flush_interval = int(os.getenv("GCS_FLUSH_INTERVAL", GCS_DEFAULT_FLUSH_INTERVAL_SECONDS))
        self.use_batched_logging = (
            os.getenv("GCS_USE_BATCHED_LOGGING", str(GCS_DEFAULT_USE_BATCHED_LOGGING).lower()).lower() == "true"
        )
        self.flush_lock = asyncio.Lock()
        super().__init__(
            flush_lock=self.flush_lock,
            batch_size=self.batch_size,
            flush_interval=self.flush_interval,
        )
        self.log_queue: asyncio.Queue[GCSLogQueueItem] = asyncio.Queue(maxsize=LITELLM_ASYNCIO_QUEUE_MAXSIZE)
        asyncio.create_task(self.periodic_flush())
        AdditionalLoggingUtils.__init__(self)

        if premium_user is not True:
            raise ValueError(
                f"GCS Bucket logging is a premium feature. Please upgrade to use it. {CommonProxyErrors.not_premium_user.value}"
            )

    #### ASYNC ####
    async def async_log_success_event(self, kwargs, response_obj, start_time, end_time):
        from litellm.proxy.proxy_server import premium_user

        if premium_user is not True:
            raise ValueError(
                f"GCS Bucket logging is a premium feature. Please upgrade to use it. {CommonProxyErrors.not_premium_user.value}"
            )
        try:
            verbose_logger.debug(
                "GCS Logger: async_log_success_event logging kwargs: %s, response_obj: %s",
                kwargs,
                response_obj,
            )
            logging_payload: Final[StandardLoggingPayload | None] = kwargs.get("standard_logging_object", None)

View on GitHub (pinned to 77b7c6c40c)