{"id":23977,"library":"llama-index-llms-vertex","title":"LlamaIndex LLMs Vertex","description":"LlamaIndex integration for Google Vertex AI LLMs (e.g., Gemini, PaLM). Allows using Vertex AI models as LLMs within LlamaIndex. Current version 0.7.0, release cadence is frequent (weekly/biweekly).","status":"active","version":"0.7.0","language":"python","source_language":"en","source_url":"https://github.com/run-llama/llama_index/tree/main/llama-index-integrations/llms/llama-index-llms-vertex","tags":["llama-index","llm","vertex-ai","google-cloud","gemini"],"install":[{"cmd":"pip install llama-index-llms-vertex","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required for Vertex AI API calls","package":"google-cloud-aiplatform","optional":false}],"imports":[{"note":"Correct import is the submodule path, not the top-level llms.","wrong":"from llama_index.llms import Vertex","symbol":"Vertex","correct":"from llama_index.llms.vertex import Vertex"}],"quickstart":{"code":"import os\nfrom llama_index.llms.vertex import Vertex\n\n# Ensure credentials are set\nos.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'path/to/service-account.json'\n\nllm = Vertex(\n    model='gemini-2.0-flash-001',\n    project='your-project-id',\n    location='us-central1',\n)\nresp = llm.complete('Hello, who are you?')\nprint(resp)","lang":"python","description":"Initialize Vertex LLM with a Gemini model and call complete()."},"warnings":[{"fix":"Explicitly set model parameter to your desired model (e.g., 'text-bison@001').","message":"Version 0.7.0 changed default model from 'text-bison' to 'gemini-2.0-flash-001'. Existing code using default model will break if you rely on PaLM behavior.","severity":"breaking","affected_versions":">=0.7.0"},{"fix":"Pass generation config via generation_config dict or kwargs at call time instead of constructor.","message":"The 'temperature', 'max_tokens', etc. kwargs in the constructor are deprecated in favor of passing them to the call (complete/chat) methods. Constructor params may be removed in future version.","severity":"deprecated","affected_versions":">=0.6.0"},{"fix":"Ensure credentials are set via environment variable or `google.auth.default()` is configured.","message":"Authentication requires a service account JSON or ADC. Forgetting to set GOOGLE_APPLICATION_CREDENTIALS raises a vague google.auth.exceptions.DefaultCredentialsError.","severity":"gotcha","affected_versions":"all"},{"fix":"Refer to Vertex AI documentation for exact model names. Use `Vertex.available_models()` to list supported models.","message":"Model names must match exactly what Vertex AI expects (e.g., 'gemini-2.0-flash-001', not 'gemini-pro'). Using an invalid model raises a 404 or 400 error.","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 environment variable to the path of your service account JSON, or run `gcloud auth application-default login`.","cause":"Missing or misconfigured Google Cloud credentials (service account file or ADC).","error":"google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials."},{"fix":"Double-check model name and location. Use `Vertex.available_models()` to see supported models for your project.","cause":"Invalid model name or region. For example, using 'gemini-pro' instead of 'gemini-2.0-flash-001'.","error":"google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument."},{"fix":"Use correct import: `from llama_index.llms.vertex import Vertex`.","cause":"Wrong import path. Users often try `from llama_index.llms import Vertex` but that doesn't work.","error":"ModuleNotFoundError: No module named 'llama_index.llms.vertex'"},{"fix":"Pass temperature and other generation config as keyword arguments to `llm.complete()` or `llm.chat()` instead of constructor.","cause":"Constructor parameters like temperature, max_tokens are deprecated/removed in recent versions.","error":"TypeError: __init__() got an unexpected keyword argument 'temperature'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}