Create a Google Vertex AI inference endpoint
Generally available; Added in 8.15.0
Create an inference endpoint to perform an inference task with the googlevertexai
service.
Required authorization
- Cluster privileges:
manage_inference
Path parameters
-
task_type
string Required The type of the inference task that the model will perform.
Values are
rerank
,text_embedding
,completion
, orchat_completion
. -
googlevertexai_inference_id
string Required The unique identifier of the inference endpoint.
Body
-
chunking_settings
object Chunking configuration object
-
service
string Required Value is
googlevertexai
. -
service_settings
object Required -
task_settings
object
PUT
/_inference/{task_type}/{googlevertexai_inference_id}
Console
PUT _inference/text_embedding/google_vertex_ai_embeddingss
{
"service": "googlevertexai",
"service_settings": {
"service_account_json": "service-account-json",
"model_id": "model-id",
"location": "location",
"project_id": "project-id"
}
}
resp = client.inference.put(
task_type="text_embedding",
inference_id="google_vertex_ai_embeddingss",
inference_config={
"service": "googlevertexai",
"service_settings": {
"service_account_json": "service-account-json",
"model_id": "model-id",
"location": "location",
"project_id": "project-id"
}
},
)
const response = await client.inference.put({
task_type: "text_embedding",
inference_id: "google_vertex_ai_embeddingss",
inference_config: {
service: "googlevertexai",
service_settings: {
service_account_json: "service-account-json",
model_id: "model-id",
location: "location",
project_id: "project-id",
},
},
});
response = client.inference.put(
task_type: "text_embedding",
inference_id: "google_vertex_ai_embeddingss",
body: {
"service": "googlevertexai",
"service_settings": {
"service_account_json": "service-account-json",
"model_id": "model-id",
"location": "location",
"project_id": "project-id"
}
}
)
$resp = $client->inference()->put([
"task_type" => "text_embedding",
"inference_id" => "google_vertex_ai_embeddingss",
"body" => [
"service" => "googlevertexai",
"service_settings" => [
"service_account_json" => "service-account-json",
"model_id" => "model-id",
"location" => "location",
"project_id" => "project-id",
],
],
]);
curl -X PUT -H "Authorization: ApiKey $ELASTIC_API_KEY" -H "Content-Type: application/json" -d '{"service":"googlevertexai","service_settings":{"service_account_json":"service-account-json","model_id":"model-id","location":"location","project_id":"project-id"}}' "$ELASTICSEARCH_URL/_inference/text_embedding/google_vertex_ai_embeddingss"
Request examples
A text embedding task
Run `PUT _inference/text_embedding/google_vertex_ai_embeddings` to create an inference endpoint to perform a `text_embedding` task type.
{
"service": "googlevertexai",
"service_settings": {
"service_account_json": "service-account-json",
"model_id": "model-id",
"location": "location",
"project_id": "project-id"
}
}
Run `PUT _inference/rerank/google_vertex_ai_rerank` to create an inference endpoint to perform a `rerank` task type.
{
"service": "googlevertexai",
"service_settings": {
"service_account_json": "service-account-json",
"project_id": "project-id"
}
}