Google Cloud Gke Recommender V1 Client - Class Cost (0.1.0)

Reference documentation and code samples for the Google Cloud Gke Recommender V1 Client class Cost.

Cost for running a model deployment on a given instance type. Currently, only USD currency code is supported.

Generated from protobuf message google.cloud.gkerecommender.v1.Cost

Namespace

Google \ Cloud \ GkeRecommender \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ cost_per_million_output_tokens Amount

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

↳ cost_per_million_input_tokens Amount

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

↳ pricing_model string

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

↳ output_input_cost_ratio float

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

getCostPerMillionOutputTokens

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

Returns
Type Description
Amount|null

hasCostPerMillionOutputTokens

clearCostPerMillionOutputTokens

setCostPerMillionOutputTokens

Optional. The cost per million output tokens, calculated as: $/output token = GPU $/s / (1/output-to-input-cost-ratio * input tokens/s + output tokens/s)

Parameter
Name Description
var Amount
Returns
Type Description
$this

getCostPerMillionInputTokens

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

Returns
Type Description
Amount|null

hasCostPerMillionInputTokens

clearCostPerMillionInputTokens

setCostPerMillionInputTokens

Optional. The cost per million input tokens. $/input token = ($/output token) / output-to-input-cost-ratio.

Parameter
Name Description
var Amount
Returns
Type Description
$this

getPricingModel

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

Returns
Type Description
string

setPricingModel

Optional. The pricing model used to calculate the cost. Can be one of: 3-years-cud, 1-year-cud, on-demand, spot. If not provided, spot will be used.

Parameter
Name Description
var string
Returns
Type Description
$this

getOutputInputCostRatio

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

Returns
Type Description
float

hasOutputInputCostRatio

clearOutputInputCostRatio

setOutputInputCostRatio

Optional. The output-to-input cost ratio. This determines how the total GPU cost is split between input and output tokens. If not provided, 4.0 is used, assuming a 4:1 output:input cost ratio.

Parameter
Name Description
var float
Returns
Type Description
$this