{"id":23976,"library":"llama-index-embeddings-vertex","title":"LlamaIndex Vertex AI Embeddings","description":"LlamaIndex integration for Google Vertex AI embeddings. Version 0.5.0 supports Gemini models (text-embedding-004, text-embedding-005) and legacy Gecko models. Requires Python >=3.10 and a Google Cloud project with Vertex AI enabled. Release cadence: irregular, tied to llama-index core updates.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/embeddings/llama-index-embeddings-vertex","tags":["llama-index","vertex-ai","embeddings","google-cloud","llm"],"install":[{"cmd":"pip install llama-index-embeddings-vertex","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Base classes and embeddings interface","package":"llama-index-core","optional":false},{"reason":"Vertex AI SDK for API calls","package":"google-cloud-aiplatform","optional":false},{"reason":"Authentication and service account handling","package":"google-auth","optional":false}],"imports":[{"note":"Common mistake: using 'vertex_ai' instead of 'vertex'.","wrong":"from llama_index.embeddings.vertex_ai import VertexEmbedding","symbol":"VertexEmbedding","correct":"from llama_index.embeddings.vertex import VertexEmbedding"},{"note":"Incorrect module path: Google provider is separate.","wrong":"from llama_index.embeddings.google import VertexEmbedding","symbol":"VertexEmbedding","correct":"from llama_index.embeddings.vertex import VertexEmbedding"}],"quickstart":{"code":"import os\nfrom llama_index.embeddings.vertex import VertexEmbedding\n\n# Set credentials (recommended: service account JSON path)\nos.environ[\"GOOGLE_APPLICATION_CREDENTIALS\"] = \"path/to/service-account.json\"\n\nembed_model = VertexEmbedding(\n    model_name=\"text-embedding-004\",  # or \"textembedding-gecko@003\"\n    project=\"your-gcp-project-id\",\n    location=\"us-central1\",\n)\n\nembeddings = embed_model.get_text_embedding(\"Hello, world!\")\nprint(len(embeddings))  # 768 for text-embedding-004","lang":"python","description":"Initialize VertexEmbedding with model name and project. Authentication via GOOGLE_APPLICATION_CREDENTIALS env var (service account) or default credentials."},"warnings":[{"fix":"Change 'from llama_index.embeddings.vertex_ai import VertexEmbedding' to 'from llama_index.embeddings.vertex import VertexEmbedding'.","message":"Version 0.2.0 moved VertexEmbedding from llama_index.embeddings.vertex_ai to llama_index.embeddings.vertex. Old import will break.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Set model_name='text-embedding-004' or 'text-embedding-005' (if available).","message":"Legacy Gecko models (textembedding-gecko@001, @002, @003) are deprecated and may be removed in future versions. Use text-embedding-004 or later.","severity":"deprecated","affected_versions":"0.5.0"},{"fix":"Always pass 'project' explicitly to VertexEmbedding().","message":"The 'project' parameter is required; omitting it defaults to the project set in gcloud config, which may be unexpected.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Set GOOGLE_APPLICATION_CREDENTIALS to path to service account JSON, or run 'gcloud auth application-default login'.","cause":"No valid Google Cloud credentials found in environment (missing GOOGLE_APPLICATION_CREDENTIALS or gcloud auth).","error":"google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials."},{"fix":"Upgrade: pip install --upgrade llama-index-embeddings-vertex. If version <0.2.0, use old import: from llama_index.embeddings.vertex_ai import VertexEmbedding.","cause":"Outdated library version; import path changed in v0.2.0.","error":"ImportError: cannot import name 'VertexEmbedding' from 'llama_index.embeddings.vertex'"},{"fix":"Verify model availability in your region: https://cloud.google.com/vertex-ai/generative-ai/docs/embeddings/get-text-embeddings#supported_models. Use location 'us-central1' for most models.","cause":"Specified model is not deployed or not available in the chosen GCP region.","error":"ValueError: Model 'text-embedding-004' not found or not supported in location 'us-central1'."}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}