Skip to content

Commit 415382c

Browse files
author
awstools
committed
feat(client-bedrock): Adding support in Amazon Bedrock to customize models with reinforcement fine-tuning (RFT) and support for updating the existing Custom Model Deployments.
1 parent 6900953 commit 415382c

19 files changed

+1011
-200
lines changed

clients/client-bedrock/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -954,6 +954,14 @@ UpdateAutomatedReasoningPolicyTestCase
954954

955955
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/UpdateAutomatedReasoningPolicyTestCaseCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/UpdateAutomatedReasoningPolicyTestCaseCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/UpdateAutomatedReasoningPolicyTestCaseCommandOutput/)
956956

957+
</details>
958+
<details>
959+
<summary>
960+
UpdateCustomModelDeployment
961+
</summary>
962+
963+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/bedrock/command/UpdateCustomModelDeploymentCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/UpdateCustomModelDeploymentCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-bedrock/Interface/UpdateCustomModelDeploymentCommandOutput/)
964+
957965
</details>
958966
<details>
959967
<summary>

clients/client-bedrock/src/Bedrock.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,11 @@ import {
469469
UpdateAutomatedReasoningPolicyTestCaseCommandInput,
470470
UpdateAutomatedReasoningPolicyTestCaseCommandOutput,
471471
} from "./commands/UpdateAutomatedReasoningPolicyTestCaseCommand";
472+
import {
473+
UpdateCustomModelDeploymentCommand,
474+
UpdateCustomModelDeploymentCommandInput,
475+
UpdateCustomModelDeploymentCommandOutput,
476+
} from "./commands/UpdateCustomModelDeploymentCommand";
472477
import {
473478
UpdateGuardrailCommand,
474479
UpdateGuardrailCommandInput,
@@ -580,6 +585,7 @@ const commands = {
580585
UpdateAutomatedReasoningPolicyCommand,
581586
UpdateAutomatedReasoningPolicyAnnotationsCommand,
582587
UpdateAutomatedReasoningPolicyTestCaseCommand,
588+
UpdateCustomModelDeploymentCommand,
583589
UpdateGuardrailCommand,
584590
UpdateMarketplaceModelEndpointCommand,
585591
UpdateProvisionedModelThroughputCommand,
@@ -2167,6 +2173,23 @@ export interface Bedrock {
21672173
cb: (err: any, data?: UpdateAutomatedReasoningPolicyTestCaseCommandOutput) => void
21682174
): void;
21692175

2176+
/**
2177+
* @see {@link UpdateCustomModelDeploymentCommand}
2178+
*/
2179+
updateCustomModelDeployment(
2180+
args: UpdateCustomModelDeploymentCommandInput,
2181+
options?: __HttpHandlerOptions
2182+
): Promise<UpdateCustomModelDeploymentCommandOutput>;
2183+
updateCustomModelDeployment(
2184+
args: UpdateCustomModelDeploymentCommandInput,
2185+
cb: (err: any, data?: UpdateCustomModelDeploymentCommandOutput) => void
2186+
): void;
2187+
updateCustomModelDeployment(
2188+
args: UpdateCustomModelDeploymentCommandInput,
2189+
options: __HttpHandlerOptions,
2190+
cb: (err: any, data?: UpdateCustomModelDeploymentCommandOutput) => void
2191+
): void;
2192+
21702193
/**
21712194
* @see {@link UpdateGuardrailCommand}
21722195
*/

clients/client-bedrock/src/BedrockClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ import {
361361
UpdateAutomatedReasoningPolicyTestCaseCommandInput,
362362
UpdateAutomatedReasoningPolicyTestCaseCommandOutput,
363363
} from "./commands/UpdateAutomatedReasoningPolicyTestCaseCommand";
364+
import {
365+
UpdateCustomModelDeploymentCommandInput,
366+
UpdateCustomModelDeploymentCommandOutput,
367+
} from "./commands/UpdateCustomModelDeploymentCommand";
364368
import { UpdateGuardrailCommandInput, UpdateGuardrailCommandOutput } from "./commands/UpdateGuardrailCommand";
365369
import {
366370
UpdateMarketplaceModelEndpointCommandInput,
@@ -479,6 +483,7 @@ export type ServiceInputTypes =
479483
| UpdateAutomatedReasoningPolicyAnnotationsCommandInput
480484
| UpdateAutomatedReasoningPolicyCommandInput
481485
| UpdateAutomatedReasoningPolicyTestCaseCommandInput
486+
| UpdateCustomModelDeploymentCommandInput
482487
| UpdateGuardrailCommandInput
483488
| UpdateMarketplaceModelEndpointCommandInput
484489
| UpdateProvisionedModelThroughputCommandInput;
@@ -581,6 +586,7 @@ export type ServiceOutputTypes =
581586
| UpdateAutomatedReasoningPolicyAnnotationsCommandOutput
582587
| UpdateAutomatedReasoningPolicyCommandOutput
583588
| UpdateAutomatedReasoningPolicyTestCaseCommandOutput
589+
| UpdateCustomModelDeploymentCommandOutput
584590
| UpdateGuardrailCommandOutput
585591
| UpdateMarketplaceModelEndpointCommandOutput
586592
| UpdateProvisionedModelThroughputCommandOutput;

clients/client-bedrock/src/commands/CreateModelCustomizationJobCommand.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export interface CreateModelCustomizationJobCommandOutput
4444
* roleArn: "STRING_VALUE", // required
4545
* clientRequestToken: "STRING_VALUE",
4646
* baseModelIdentifier: "STRING_VALUE", // required
47-
* customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "IMPORTED",
47+
* customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "REINFORCEMENT_FINE_TUNING" || "IMPORTED",
4848
* customModelKmsKeyId: "STRING_VALUE",
4949
* jobTags: [ // TagList
5050
* { // Tag
@@ -121,6 +121,23 @@ export interface CreateModelCustomizationJobCommandOutput
121121
* maxResponseLengthForInference: Number("int"),
122122
* },
123123
* },
124+
* rftConfig: { // RFTConfig
125+
* graderConfig: { // GraderConfig Union: only one key present
126+
* lambdaGrader: { // LambdaGraderConfig
127+
* lambdaArn: "STRING_VALUE", // required
128+
* },
129+
* },
130+
* hyperParameters: { // RFTHyperParameters
131+
* epochCount: Number("int"),
132+
* batchSize: Number("int"),
133+
* learningRate: Number("float"),
134+
* maxPromptLength: Number("int"),
135+
* trainingSamplePerPrompt: Number("int"),
136+
* inferenceMaxTokens: Number("int"),
137+
* reasoningEffort: "low" || "medium" || "high",
138+
* evalInterval: Number("int"),
139+
* },
140+
* },
124141
* },
125142
* };
126143
* const command = new CreateModelCustomizationJobCommand(input);

clients/client-bedrock/src/commands/DeleteInferenceProfileCommand.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
55

66
import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
77
import { commonParams } from "../endpoint/EndpointParameters";
8-
import { DeleteInferenceProfileRequest, DeleteInferenceProfileResponse } from "../models/models_0";
8+
import { DeleteInferenceProfileRequest } from "../models/models_0";
9+
import { DeleteInferenceProfileResponse } from "../models/models_1";
910
import { DeleteInferenceProfile } from "../schemas/schemas_0";
1011

1112
/**

clients/client-bedrock/src/commands/GetCustomModelCommand.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface GetCustomModelCommandOutput extends GetCustomModelResponse, __M
4747
* // jobName: "STRING_VALUE",
4848
* // jobArn: "STRING_VALUE",
4949
* // baseModelArn: "STRING_VALUE",
50-
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "IMPORTED",
50+
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "REINFORCEMENT_FINE_TUNING" || "IMPORTED",
5151
* // modelKmsKeyArn: "STRING_VALUE",
5252
* // hyperParameters: { // ModelCustomizationHyperParameters
5353
* // "<keys>": "STRING_VALUE",
@@ -113,6 +113,23 @@ export interface GetCustomModelCommandOutput extends GetCustomModelResponse, __M
113113
* // maxResponseLengthForInference: Number("int"),
114114
* // },
115115
* // },
116+
* // rftConfig: { // RFTConfig
117+
* // graderConfig: { // GraderConfig Union: only one key present
118+
* // lambdaGrader: { // LambdaGraderConfig
119+
* // lambdaArn: "STRING_VALUE", // required
120+
* // },
121+
* // },
122+
* // hyperParameters: { // RFTHyperParameters
123+
* // epochCount: Number("int"),
124+
* // batchSize: Number("int"),
125+
* // learningRate: Number("float"),
126+
* // maxPromptLength: Number("int"),
127+
* // trainingSamplePerPrompt: Number("int"),
128+
* // inferenceMaxTokens: Number("int"),
129+
* // reasoningEffort: "low" || "medium" || "high",
130+
* // evalInterval: Number("int"),
131+
* // },
132+
* // },
116133
* // },
117134
* // modelStatus: "Active" || "Creating" || "Failed",
118135
* // failureMessage: "STRING_VALUE",

clients/client-bedrock/src/commands/GetCustomModelDeploymentCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ export interface GetCustomModelDeploymentCommandOutput extends GetCustomModelDep
4848
* // createdAt: new Date("TIMESTAMP"), // required
4949
* // status: "Creating" || "Active" || "Failed", // required
5050
* // description: "STRING_VALUE",
51+
* // updateDetails: { // CustomModelDeploymentUpdateDetails
52+
* // modelArn: "STRING_VALUE", // required
53+
* // updateStatus: "Updating" || "UpdateCompleted" || "UpdateFailed", // required
54+
* // },
5155
* // failureMessage: "STRING_VALUE",
5256
* // lastUpdatedAt: new Date("TIMESTAMP"),
5357
* // };

clients/client-bedrock/src/commands/GetInferenceProfileCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MetadataBearer as __MetadataBearer } from "@smithy/types";
55

66
import { BedrockClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BedrockClient";
77
import { commonParams } from "../endpoint/EndpointParameters";
8-
import { GetInferenceProfileRequest, GetInferenceProfileResponse } from "../models/models_0";
8+
import { GetInferenceProfileRequest, GetInferenceProfileResponse } from "../models/models_1";
99
import { GetInferenceProfile } from "../schemas/schemas_0";
1010

1111
/**

clients/client-bedrock/src/commands/GetModelCustomizationJobCommand.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ export interface GetModelCustomizationJobCommandOutput extends GetModelCustomiza
119119
* // outputDataConfig: { // OutputDataConfig
120120
* // s3Uri: "STRING_VALUE", // required
121121
* // },
122-
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "IMPORTED",
122+
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "REINFORCEMENT_FINE_TUNING" || "IMPORTED",
123123
* // outputModelKmsKeyArn: "STRING_VALUE",
124124
* // trainingMetrics: { // TrainingMetrics
125125
* // trainingLoss: Number("float"),
@@ -144,6 +144,23 @@ export interface GetModelCustomizationJobCommandOutput extends GetModelCustomiza
144144
* // maxResponseLengthForInference: Number("int"),
145145
* // },
146146
* // },
147+
* // rftConfig: { // RFTConfig
148+
* // graderConfig: { // GraderConfig Union: only one key present
149+
* // lambdaGrader: { // LambdaGraderConfig
150+
* // lambdaArn: "STRING_VALUE", // required
151+
* // },
152+
* // },
153+
* // hyperParameters: { // RFTHyperParameters
154+
* // epochCount: Number("int"),
155+
* // batchSize: Number("int"),
156+
* // learningRate: Number("float"),
157+
* // maxPromptLength: Number("int"),
158+
* // trainingSamplePerPrompt: Number("int"),
159+
* // inferenceMaxTokens: Number("int"),
160+
* // reasoningEffort: "low" || "medium" || "high",
161+
* // evalInterval: Number("int"),
162+
* // },
163+
* // },
147164
* // },
148165
* // };
149166
*

clients/client-bedrock/src/commands/ListCustomModelsCommand.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export interface ListCustomModelsCommandOutput extends ListCustomModelsResponse,
6060
* // creationTime: new Date("TIMESTAMP"), // required
6161
* // baseModelArn: "STRING_VALUE", // required
6262
* // baseModelName: "STRING_VALUE", // required
63-
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "IMPORTED",
63+
* // customizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION" || "REINFORCEMENT_FINE_TUNING" || "IMPORTED",
6464
* // ownerAccountId: "STRING_VALUE",
6565
* // modelStatus: "Active" || "Creating" || "Failed",
6666
* // },

0 commit comments

Comments
 (0)