UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

340 lines • 12.8 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.AiEndpointWithModelGardenDeployment = void 0; const pulumi = __importStar(require("@pulumi/pulumi")); const utilities = __importStar(require("../utilities")); /** * Create an Endpoint and deploy a Model Garden model to it. * * To get more information about EndpointWithModelGardenDeployment, see: * * * [API documentation](https://cloud.google.com/vertex-ai/docs/reference/rest/v1/projects.locations/deploy) * * How-to Guides * * [Overview of Model Garden](https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/explore-models) * * [Overview of self-deployed models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/self-deployed-models) * * [Use models in Model Garden](https://cloud.google.com/vertex-ai/generative-ai/docs/model-garden/use-models) * * ## Example Usage * * ### Vertex Ai Deploy Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy", { * publisherModelName: "publishers/google/models/paligemma@paligemma-224-float32", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * }); * ``` * ### Vertex Ai Deploy Huggingface Model * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy", { * huggingFaceModelId: "Qwen/Qwen3-0.6B", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * }); * ``` * ### Vertex Ai Deploy With Configs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy", { * publisherModelName: "publishers/google/models/paligemma@paligemma-224-float32", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-16", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }); * ``` * ### Vertex Ai Deploy Multiple Models In Parallel * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy_gemma_11_2b_it = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-gemma-1_1-2b-it", { * publisherModelName: "publishers/google/models/gemma@gemma-1.1-2b-it", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "us-central1", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }); * const deploy_qwen3_06b = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-qwen3-0_6b", { * huggingFaceModelId: "Qwen/Qwen3-0.6B", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }); * const deploy_llama_32_1b = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-llama-3_2-1b", { * publisherModelName: "publishers/meta/models/llama3-2@llama-3.2-1b", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }); * ``` * ### Vertex Ai Deploy Multiple Models In Sequence * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy_gemma_11_2b_it = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-gemma-1_1-2b-it", { * publisherModelName: "publishers/google/models/gemma@gemma-1.1-2b-it", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }); * const deploy_qwen3_06b = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-qwen3-0_6b", { * huggingFaceModelId: "Qwen/Qwen3-0.6B", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }, { * dependsOn: [deploy_gemma_11_2b_it], * }); * const deploy_llama_32_1b = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy-llama-3_2-1b", { * publisherModelName: "publishers/meta/models/llama3-2@llama-3.2-1b", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * deployConfig: { * dedicatedResources: { * machineSpec: { * machineType: "g2-standard-12", * acceleratorType: "NVIDIA_L4", * acceleratorCount: 1, * }, * minReplicaCount: 1, * }, * }, * }, { * dependsOn: [deploy_qwen3_06b], * }); * ``` * ### Vertex Ai Deploy Psc Endpoint * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const deploy = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy", { * publisherModelName: "publishers/google/models/paligemma@paligemma-224-float32", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * endpointConfig: { * privateServiceConnectConfig: { * enablePrivateServiceConnect: true, * projectAllowlists: ["my-project-id"], * }, * }, * }); * ``` * ### Vertex Ai Deploy Psc Endpoint Automated * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const network = new gcp.compute.Network("network", { * name: "network", * autoCreateSubnetworks: false, * }); * const project = gcp.organizations.getProject({}); * const deploy = new gcp.vertex.AiEndpointWithModelGardenDeployment("deploy", { * publisherModelName: "publishers/google/models/paligemma@paligemma-224-float32", * location: "us-central1", * modelConfig: { * acceptEula: true, * }, * endpointConfig: { * privateServiceConnectConfig: { * enablePrivateServiceConnect: true, * projectAllowlists: [project.then(project => project.id)], * pscAutomationConfigs: { * projectId: project.then(project => project.id), * network: network.id, * }, * }, * }, * }); * const subnetwork = new gcp.compute.Subnetwork("subnetwork", { * name: "subnetwork", * ipCidrRange: "192.168.0.0/24", * region: "us-central1", * network: network.id, * }); * ``` * * ## Import * * This resource does not support import. */ class AiEndpointWithModelGardenDeployment extends pulumi.CustomResource { /** * Get an existing AiEndpointWithModelGardenDeployment resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new AiEndpointWithModelGardenDeployment(name, state, { ...opts, id: id }); } /** @internal */ static __pulumiType = 'gcp:vertex/aiEndpointWithModelGardenDeployment:AiEndpointWithModelGardenDeployment'; /** * Returns true if the given object is an instance of AiEndpointWithModelGardenDeployment. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === AiEndpointWithModelGardenDeployment.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["deletionPolicy"] = state?.deletionPolicy; resourceInputs["deployConfig"] = state?.deployConfig; resourceInputs["deployedModelDisplayName"] = state?.deployedModelDisplayName; resourceInputs["deployedModelId"] = state?.deployedModelId; resourceInputs["endpoint"] = state?.endpoint; resourceInputs["endpointConfig"] = state?.endpointConfig; resourceInputs["huggingFaceModelId"] = state?.huggingFaceModelId; resourceInputs["location"] = state?.location; resourceInputs["modelConfig"] = state?.modelConfig; resourceInputs["project"] = state?.project; resourceInputs["publisherModelName"] = state?.publisherModelName; } else { const args = argsOrState; if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["deletionPolicy"] = args?.deletionPolicy; resourceInputs["deployConfig"] = args?.deployConfig; resourceInputs["endpointConfig"] = args?.endpointConfig; resourceInputs["huggingFaceModelId"] = args?.huggingFaceModelId; resourceInputs["location"] = args?.location; resourceInputs["modelConfig"] = args?.modelConfig; resourceInputs["project"] = args?.project; resourceInputs["publisherModelName"] = args?.publisherModelName; resourceInputs["deployedModelDisplayName"] = undefined /*out*/; resourceInputs["deployedModelId"] = undefined /*out*/; resourceInputs["endpoint"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(AiEndpointWithModelGardenDeployment.__pulumiType, name, resourceInputs, opts); } } exports.AiEndpointWithModelGardenDeployment = AiEndpointWithModelGardenDeployment; //# sourceMappingURL=aiEndpointWithModelGardenDeployment.js.map