{"record":{"id":"0628f72e8cf52163","repo":"BerriAI/litellm","slug":"vertexai-rag-module-not-found-vertex-ai-rag-requi","errorCode":null,"errorMessage":"vertexai.rag module not found. Vertex AI RAG requires google-cloud-aiplatform>=1.60.0. Install with: pip install 'google-cloud-aiplatform>=1.60.0'","messagePattern":"vertexai\\.rag module not found\\. Vertex AI RAG requires google-cloud-aiplatform>=1\\.60\\.0\\. Install with: pip install 'google-cloud-aiplatform>=1\\.60\\.0'","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"litellm/llms/vertex_ai/rag_engine/ingestion.py","lineNumber":175,"sourceCode":"                os.environ[\"GCS_BUCKET_NAME\"] = original_bucket\n            elif \"GCS_BUCKET_NAME\" in os.environ:\n                del os.environ[\"GCS_BUCKET_NAME\"]\n\n    async def _import_file_to_corpus_via_sdk(\n        self,\n        gcs_uri: str,\n    ) -> None:\n        \"\"\"\n        Import file into RAG corpus using the Vertex AI SDK.\n\n        The REST API endpoint for importRagFiles is not publicly available,\n        so we use the Python SDK.\n        \"\"\"\n        try:\n            from vertexai import init as vertexai_init\n            from vertexai import rag\n        except ImportError:\n            raise ImportError(\n                \"vertexai.rag module not found. Vertex AI RAG requires \"\n                \"google-cloud-aiplatform>=1.60.0. Install with: \"\n                \"pip install 'google-cloud-aiplatform>=1.60.0'\"\n            )\n\n        # Initialize Vertex AI\n        vertexai_init(project=self.vertex_project, location=self.vertex_location)\n\n        # Get chunking config from ingest_options (unified interface)\n        transformation_config: Final = self._build_transformation_config()\n\n        corpus_name: Final = self._get_corpus_name()\n        verbose_logger.debug(\"Importing %s into corpus %s\", gcs_uri, self.corpus_id)\n\n        if self.wait_for_import:\n            # Synchronous import - wait for completion\n            response: Final = rag.import_files(\n                corpus_name=corpus_name,","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/llms/vertex_ai/rag_engine/ingestion.py#L157-L193","documentation":"ImportError raised when `from vertexai import rag` fails inside _import_file_to_corpus_via_sdk. The REST endpoint for importRagFiles is not publicly available, so Vertex RAG ingestion uses the Python SDK, which requires google-cloud-aiplatform>=1.60.0; without it the import step cannot run.","triggerScenarios":"Running Vertex RAG file ingestion in an environment where google-cloud-aiplatform is missing or older than 1.60.0; dependency resolution downgrading aiplatform below the required version.","commonSituations":"Slim Docker images that skip optional deps; aiplatform pinned to an older version by another library; stale virtualenvs after upgrading litellm.","solutions":["pip install 'google-cloud-aiplatform>=1.60.0'","Verify the import works: python -c 'from vertexai import rag'","If another package pins an older aiplatform, upgrade that pin or isolate in a separate venv","Rebuild the deployment image so the dependency ships with it"],"exampleFix":"# before: ImportError from litellm Vertex RAG ingestion\n\n# after\npip install 'google-cloud-aiplatform>=1.60.0'\npython -c 'from vertexai import rag; print(\"ok\")'","handlingStrategy":"validation","validationCode":"def vertex_rag_available() -> bool:\n    try:\n        from vertexai import rag  # noqa: F401\n        return True\n    except ImportError:\n        return False\n\nassert vertex_rag_available(), \"pip install 'google-cloud-aiplatform>=1.60.0'\"","typeGuard":null,"tryCatchPattern":"try:\n    corpus_id, gcs_uri = await run_vertex_rag_ingestion(...)\nexcept ImportError as e:\n    raise SystemExit(f'Missing SDK dependency: {e}')","preventionTips":["Declare google-cloud-aiplatform>=1.60.0 in your requirements alongside litellm","Add a startup smoke test that imports vertexai.rag","Lock dependency versions in Docker builds so images always ship the SDK"],"tags":["vertex-ai","rag","import-error","dependency"],"backgroundTag":"missing-dependency","analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","schemaVersion":2},"datasetVersion":"2026-08-30T08:17:16.595Z"}