{"record":{"id":"3d575276d67bc419","repo":"BerriAI/litellm","slug":"pg-vector-api-base-url-is-required-set-pg-vector","errorCode":null,"errorMessage":"PG Vector API base URL is required. Set PG_VECTOR_API_BASE environment variable or pass api_base in litellm_params.","messagePattern":"PG Vector API base URL is required\\. Set PG_VECTOR_API_BASE environment variable or pass api_base in litellm_params\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/llms/pg_vector/vector_stores/transformation.py","lineNumber":65,"sourceCode":"                \"Content-Type\": \"application/json\",\n            }\n        )\n\n        return headers\n\n    def get_complete_url(\n        self,\n        api_base: str | None,\n        litellm_params: dict,\n    ) -> str:\n        \"\"\"\n        Get the complete URL for PG vector service endpoints\n        \"\"\"\n        # Get API base from various sources\n        api_base = api_base or get_secret_str(\"PG_VECTOR_API_BASE\")\n\n        if not api_base:\n            raise ValueError(\n                \"PG Vector API base URL is required. Set PG_VECTOR_API_BASE environment variable or pass api_base in litellm_params.\"\n            )\n\n        # Remove trailing slashes\n        api_base = api_base.rstrip(\"/\")\n\n        return f\"{api_base}/v1/vector_stores\"\n\n    def transform_search_vector_store_request(\n        self,\n        vector_store_id: str,\n        query: str | list[str],\n        vector_store_search_optional_params: VectorStoreSearchOptionalRequestParams,\n        api_base: str,\n        litellm_logging_obj: LiteLLMLoggingObj,\n        litellm_params: dict,\n        extra_body: dict[str, Any] | None = None,\n    ) -> tuple[str, dict]:","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/pg_vector/vector_stores/transformation.py#L47-L83","documentation":"Configuration guard in the PG Vector get_complete_url: neither the api_base argument nor the PG_VECTOR_API_BASE secret is set, so the client has no service URL to target and endpoint construction fails.","triggerScenarios":"Triggered when calling a PG Vector vector store without an API base URL: PG_VECTOR_API_BASE env var unset and no api_base passed in litellm_params.","commonSituations":"See trigger scenarios.","solutions":["Set the PG_VECTOR_API_BASE environment variable to your PG Vector endpoint.","Pass api_base in litellm_params for the pg_vector vector store."],"exampleFix":"os.environ[\"PG_VECTOR_API_BASE\"] = \"https://pgvector.example.com\"","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}