Google Cloud Vertex AI provider for lmux
Project description
lmux-gcp-vertex
Google Cloud Vertex AI provider for lmux. Wraps the google-genai SDK.
Supports chat completions, streaming, and embeddings.
Part of the lmux ecosystem: standardized interface, cost tracking on every response, and registry-based routing across providers.
Auth
Three authentication methods:
Application Default Credentials (default)
Uses google.auth.default(), which works with GOOGLE_APPLICATION_CREDENTIALS, gcloud CLI, or instance metadata.
from lmux_gcp_vertex import GCPVertexProvider
provider = GCPVertexProvider(project="my-project", location="us-central1")
Service Account
from lmux_gcp_vertex import GCPVertexServiceAccountAuthProvider
provider = GCPVertexProvider(
project="my-project",
location="us-central1",
auth=GCPVertexServiceAccountAuthProvider(service_account_file="/path/to/key.json"),
)
API Key
Set GOOGLE_API_KEY in your environment:
from lmux_gcp_vertex import GCPVertexAPIKeyAuthProvider
provider = GCPVertexProvider(auth=GCPVertexAPIKeyAuthProvider(), vertexai=False)
Usage
Chat
from lmux import UserMessage
response = provider.chat("gemini-2.5-pro", [UserMessage(content="Hello")])
print(response.content)
print(response.cost)
Streaming
for chunk in provider.chat_stream("gemini-2.5-pro", [UserMessage(content="Hello")]):
if chunk.delta:
print(chunk.delta, end="")
Embeddings
response = provider.embed("text-embedding-005", "Hello")
print(response.embeddings)
Async
All methods have async variants: achat, achat_stream, aembed.
Registry
Use with the lmux registry to route across multiple providers:
from lmux import Registry
registry = Registry()
registry.register("gcp", provider)
response = registry.chat("gcp/gemini-2.5-pro", messages)
Provider Params
from lmux_gcp_vertex import GCPVertexParams
response = provider.chat(
"gemini-2.5-pro",
messages,
provider_params=GCPVertexParams(thinking_config={"thinking_budget": 1024}),
)
| Parameter | Type | Description |
|---|---|---|
safety_settings |
list[SafetySetting] |
Content safety thresholds |
presence_penalty |
float |
Presence penalty |
frequency_penalty |
float |
Frequency penalty |
seed |
int |
Deterministic sampling seed |
labels |
dict[str, str] |
Request labels |
thinking_config |
dict |
Thinking/reasoning configuration |
Constructor Options
GCPVertexProvider(
auth=..., # AuthProvider, default: GCPVertexADCAuthProvider()
project=..., # GCP project ID
location=..., # GCP region
vertexai=..., # Use Vertex AI (default: True) vs. AI Studio
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lmux_gcp_vertex-0.5.0.tar.gz.
File metadata
- Download URL: lmux_gcp_vertex-0.5.0.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f245959f13ae2c02d2a2bf4f2df03a13a30c8561023d248dc2daa77f8fe7731e
|
|
| MD5 |
0ab7e9df35f1bb1d5ebbb09dbd7933e7
|
|
| BLAKE2b-256 |
67b7fdd3afb40ab0b1538a366a9d63ab5bf688006ef7bc32154245a41d15cedd
|
Provenance
The following attestation bundles were made for lmux_gcp_vertex-0.5.0.tar.gz:
Publisher:
publish.yml on cluebbehusen/lmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmux_gcp_vertex-0.5.0.tar.gz -
Subject digest:
f245959f13ae2c02d2a2bf4f2df03a13a30c8561023d248dc2daa77f8fe7731e - Sigstore transparency entry: 1233467100
- Sigstore integration time:
-
Permalink:
cluebbehusen/lmux@3fd90bd1eb8ab2e74c8b2b2a1d29ffbddbbea9de -
Branch / Tag:
refs/tags/lmux-gcp-vertex-v0.5.0 - Owner: https://github.com/cluebbehusen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fd90bd1eb8ab2e74c8b2b2a1d29ffbddbbea9de -
Trigger Event:
push
-
Statement type:
File details
Details for the file lmux_gcp_vertex-0.5.0-py3-none-any.whl.
File metadata
- Download URL: lmux_gcp_vertex-0.5.0-py3-none-any.whl
- Upload date:
- Size: 15.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2e7a7109dfd0e5c82e1d4454b50dd76f6041d8a11cd0564cca6353845debbef
|
|
| MD5 |
16498256b67bd06a4fd17e5916165d6a
|
|
| BLAKE2b-256 |
7867cb34c8e85c8b0aacc1dd323d3cfa333600f0af0ae7d44adabdd833ce483c
|
Provenance
The following attestation bundles were made for lmux_gcp_vertex-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on cluebbehusen/lmux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lmux_gcp_vertex-0.5.0-py3-none-any.whl -
Subject digest:
b2e7a7109dfd0e5c82e1d4454b50dd76f6041d8a11cd0564cca6353845debbef - Sigstore transparency entry: 1233467110
- Sigstore integration time:
-
Permalink:
cluebbehusen/lmux@3fd90bd1eb8ab2e74c8b2b2a1d29ffbddbbea9de -
Branch / Tag:
refs/tags/lmux-gcp-vertex-v0.5.0 - Owner: https://github.com/cluebbehusen
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3fd90bd1eb8ab2e74c8b2b2a1d29ffbddbbea9de -
Trigger Event:
push
-
Statement type: