Could we get support for the available MaaS models on Vertex AI (GPT-OSS, etc.)?
At the moment, the only supported models are the ones shown below
For those who wants to use vertexai’ maas models, you can use OpenAI’s integration, here is a quick demo:
from langchain_openai import ChatOpenAI
import google.auth
from google.auth.transport.requests import Request
# 1. Get default credentials and project
SCOPES = ["https://www.googleapis.com/auth/cloud-platform"]
creds, project_id = google.auth.default(scopes=SCOPES)
# 2. Refresh immediately to get the token (it's often blank initially)
creds.refresh(Request())
# 3. Dynamic Configuration
REGION = "us-central1"
# PROJECT_ID is auto-fetched above
# 4. Corrected BASE_URL
BASE_URL = f"https://aiplatform.googleapis.com/v1/projects/{project_id}/locations/{REGION}/endpoints/openapi"
llm = ChatOpenAI(
model="openai/gpt-oss-120b-maas",
base_url=BASE_URL,
api_key=creds.token,
# Optimization: Default max_retries is often too high for interactive apps;
# reducing it can fail faster if the endpoint is down.
max_retries=2
)
