BerriAI/litellm · error · ValueError

LiteLLM Error, trying to use Supabase but url or key not…

Error message

LiteLLM Error, trying to use Supabase but url or key not passed. Create a table and set `litellm.supabase_url=<your-url>` and `litellm.supabase_key=<your-key>`

What it means

Supabase logger init found neither SUPABASE_URL nor SUPABASE_KEY in the environment (and no litellm.supabase_url/key overrides), so there is no database to write request_logs to; the message points at the required settings.

Solutions

  1. Set litellm.supabase_url and litellm.supabase_key with your Supabase project URL and key.

Example fix

litellm.supabase_url='https://xyz.supabase.co'; litellm.supabase_key='<service-key>'
Defensive patterns

Strategy: validation

When it happens

Trigger: Using the Supabase callback without configuring url and key.

Common situations: Missing one of the two settings, or settings applied after the logger initialized.


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

Appendix: source

Thrown at litellm/integrations/supabase.py:28

import litellm


class Supabase:
    # Class variables or attributes
    supabase_table_name = "request_logs"

    def __init__(self):
        # Instance variables
        self.supabase_url = os.getenv("SUPABASE_URL")
        self.supabase_key = os.getenv("SUPABASE_KEY")
        try:
            import supabase
        except ImportError:
            subprocess.check_call([sys.executable, "-m", "pip", "install", "supabase"])
            import supabase

        if self.supabase_url is None or self.supabase_key is None:
            raise ValueError(
                "LiteLLM Error, trying to use Supabase but url or key not passed. Create a table and set `litellm.supabase_url=<your-url>` and `litellm.supabase_key=<your-key>`"
            )
        self.supabase_client = supabase.create_client(self.supabase_url, self.supabase_key)

    def input_log_event(self, model, messages, end_user, litellm_call_id, print_verbose):
        try:
            print_verbose(f"Supabase Logging - Enters input logging function for model {model}")
            supabase_data_obj: Final = {
                "model": model,
                "messages": messages,
                "end_user": end_user,
                "status": "initiated",
                "litellm_call_id": litellm_call_id,
            }
            data, count = self.supabase_client.table(self.supabase_table_name).insert(supabase_data_obj).execute()
            print_verbose(f"data: {data}")
        except Exception:
            print_verbose(f"Supabase Logging Error - {traceback.format_exc()}")

View on GitHub (pinned to 77b7c6c40c)