Skip to content

Commit bcaad96

Browse files
author
Nicholas Cecere
committed
add google auth, cost per pixel, cost per sec
1 parent 1f90e97 commit bcaad96

File tree

2 files changed

+38
-24
lines changed

2 files changed

+38
-24
lines changed

litellm/resource_model_crud.go

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,25 @@ func createOrUpdateModel(d *schema.ResourceData, m interface{}, isUpdate bool) e
3838
modelReq := ModelRequest{
3939
ModelName: d.Get("model_name").(string),
4040
LiteLLMParams: LiteLLMParams{
41-
CustomLLMProvider: customLLMProvider,
42-
TPM: d.Get("tpm").(int),
43-
RPM: d.Get("rpm").(int),
44-
APIKey: d.Get("model_api_key").(string),
45-
APIBase: d.Get("model_api_base").(string),
46-
APIVersion: d.Get("api_version").(string),
47-
Model: modelName,
48-
InputCostPerToken: inputCostPerToken,
49-
OutputCostPerToken: outputCostPerToken,
50-
AWSAccessKeyID: d.Get("aws_access_key_id").(string),
51-
AWSSecretAccessKey: d.Get("aws_secret_access_key").(string),
52-
AWSRegionName: d.Get("aws_region_name").(string),
41+
CustomLLMProvider: customLLMProvider,
42+
TPM: d.Get("tpm").(int),
43+
RPM: d.Get("rpm").(int),
44+
APIKey: d.Get("model_api_key").(string),
45+
APIBase: d.Get("model_api_base").(string),
46+
APIVersion: d.Get("api_version").(string),
47+
Model: modelName,
48+
InputCostPerToken: inputCostPerToken,
49+
OutputCostPerToken: outputCostPerToken,
50+
InputCostPerPixel: d.Get("input_cost_per_pixel").(float64),
51+
OutputCostPerPixel: d.Get("output_cost_per_pixel").(float64),
52+
InputCostPerSecond: d.Get("input_cost_per_second").(float64),
53+
OutputCostPerSecond: d.Get("output_cost_per_second").(float64),
54+
AWSAccessKeyID: d.Get("aws_access_key_id").(string),
55+
AWSSecretAccessKey: d.Get("aws_secret_access_key").(string),
56+
AWSRegionName: d.Get("aws_region_name").(string),
57+
VertexProject: d.Get("vertex_project").(string),
58+
VertexLocation: d.Get("vertex_location").(string),
59+
VertexCredentials: d.Get("vertex_credentials").(string),
5360
},
5461
ModelInfo: ModelInfo{
5562
ID: modelID,

litellm/types.go

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,25 @@ type TeamResponse struct {
4545

4646
// LiteLLMParams represents the parameters for LiteLLM.
4747
type LiteLLMParams struct {
48-
CustomLLMProvider string `json:"custom_llm_provider"`
49-
TPM int `json:"tpm,omitempty"`
50-
RPM int `json:"rpm,omitempty"`
51-
APIKey string `json:"api_key,omitempty"`
52-
APIBase string `json:"api_base,omitempty"`
53-
APIVersion string `json:"api_version,omitempty"`
54-
Model string `json:"model"`
55-
InputCostPerToken float64 `json:"input_cost_per_token"`
56-
OutputCostPerToken float64 `json:"output_cost_per_token"`
57-
AWSAccessKeyID string `json:"aws_access_key_id,omitempty"`
58-
AWSSecretAccessKey string `json:"aws_secret_access_key,omitempty"`
59-
AWSRegionName string `json:"aws_region_name,omitempty"`
48+
CustomLLMProvider string `json:"custom_llm_provider"`
49+
TPM int `json:"tpm,omitempty"`
50+
RPM int `json:"rpm,omitempty"`
51+
APIKey string `json:"api_key,omitempty"`
52+
APIBase string `json:"api_base,omitempty"`
53+
APIVersion string `json:"api_version,omitempty"`
54+
Model string `json:"model"`
55+
InputCostPerToken float64 `json:"input_cost_per_token,omitempty"`
56+
OutputCostPerToken float64 `json:"output_cost_per_token,omitempty"`
57+
InputCostPerPixel float64 `json:"input_cost_per_pixel,omitempty"`
58+
OutputCostPerPixel float64 `json:"output_cost_per_pixel,omitempty"`
59+
InputCostPerSecond float64 `json:"input_cost_per_second,omitempty"`
60+
OutputCostPerSecond float64 `json:"output_cost_per_second,omitempty"`
61+
AWSAccessKeyID string `json:"aws_access_key_id,omitempty"`
62+
AWSSecretAccessKey string `json:"aws_secret_access_key,omitempty"`
63+
AWSRegionName string `json:"aws_region_name,omitempty"`
64+
VertexProject string `json:"vertex_project,omitempty"`
65+
VertexLocation string `json:"vertex_location,omitempty"`
66+
VertexCredentials string `json:"vertex_credentials,omitempty"`
6067
}
6168

6269
// ModelInfo represents information about a model.

0 commit comments

Comments
 (0)