Registry / llm-agents / llama-index-llms-vertex

llama-index-llms-vertex

JSON →
library0.7.0pypypi✓ verified 84d ago

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).

pip install llama-index-llms-vertex
INSTALL
IMPORT
SIG · LLAMA-INDEX-LLMS-V
L
llama-index-llms-vertex
llm-agentspythonv0.7.0
Install
30.6s avg
Import
19829ms
Disk
479MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.7.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 20.478s · 457.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 30.6s · import 11.248s · 451MB
479MB installed
● package 479MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Vertex
from llama_index.llms.vertex import Vertex
from llama_index.llms import Vertex
Correct import is the submodule path, not the top-level llms.

Initialize Vertex LLM with a Gemini model and call complete().

import os from llama_index.llms.vertex import Vertex # Ensure credentials are set os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = 'path/to/service-account.json' llm = Vertex( model='gemini-2.0-flash-001', project='your-project-id', location='us-central1', ) resp = llm.complete('Hello, who are you?') print(resp)
Debug
Known issues
breakingVersion 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.
fix
Explicitly set model parameter to your desired model (e.g., 'text-bison@001').
affects: >=0.7.0
deprecatedThe '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.
fix
Pass generation config via generation_config dict or kwargs at call time instead of constructor.
affects: >=0.6.0
gotchaAuthentication requires a service account JSON or ADC. Forgetting to set GOOGLE_APPLICATION_CREDENTIALS raises a vague google.auth.exceptions.DefaultCredentialsError.
fix
Ensure credentials are set via environment variable or `google.auth.default()` is configured.
affects: all
gotchaModel 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.
fix
Refer to Vertex AI documentation for exact model names. Use `Vertex.available_models()` to list supported models.
affects: all
Errors
Common errors & fixes
google.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials.
Missing or misconfigured Google Cloud credentials (service account file or ADC).
fix
Set GOOGLE_APPLICATION_CREDENTIALS environment variable to the path of your service account JSON, or run `gcloud auth application-default login`.
google.api_core.exceptions.InvalidArgument: 400 Request contains an invalid argument.
Invalid model name or region. For example, using 'gemini-pro' instead of 'gemini-2.0-flash-001'.
fix
Double-check model name and location. Use `Vertex.available_models()` to see supported models for your project.
ModuleNotFoundError: No module named 'llama_index.llms.vertex'
Wrong import path. Users often try `from llama_index.llms import Vertex` but that doesn't work.
fix
Use correct import: `from llama_index.llms.vertex import Vertex`.
TypeError: __init__() got an unexpected keyword argument 'temperature'
Constructor parameters like temperature, max_tokens are deprecated/removed in recent versions.
fix
Pass temperature and other generation config as keyword arguments to `llm.complete()` or `llm.chat()` instead of constructor.
Upgrade
Version history
0.7.0latest on PyPI · released Mar 12, 2026
Audit
Dependencies
google-cloud-aiplatformrequiredRequired for Vertex AI API calls
Agent activity
18 hits · last 30 days
node
16
OpenAI (training)
1
Resources
llama-index-llms-vertex — pip install llama-index-llms-vertex · libregistry