Adds a candidate and its evaluation metrics to a leaderboard, or adds evaluation metrics to an existing candidate.
The candidate configuration (CandidateConfig ) identifies the candidate. SageMaker derives the CandidateId from the configuration, so the same configuration always produces the same CandidateId on a leaderboard. The display name and labels aren’t part of the identity.
If a candidate with the same configuration already exists on the leaderboard, AddCandidate updates it as follows:
Labels . If you don’t specify Labels , the existing labels are kept.DisplayName takes effect only when the candidate is created.See also: AWS API Documentation
add-candidate
--leaderboard-arn <value>
[--display-name <value>]
[--labels <value>]
--candidate-config <value>
--evaluation-results <value>
[--client-token <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
--leaderboard-arn (string) [required]
The Amazon Resource Name (ARN) of the leaderboard to add the candidate to.
Constraints:
- min:
20- max:
2048- pattern:
arn:(aws|aws-cn|aws-us-gov):sagemaker:[a-z0-9-]+:[0-9]{12}:leaderboard/[a-zA-Z0-9/_-]+
--display-name (string)
A display name for the candidate. SageMaker uses this value only when it creates the candidate. If the candidate already exists, SageMaker keeps its existing display name. The display name can’t contain control characters or format characters.
Constraints:
- min:
0- max:
256- pattern:
[\p{L}\p{M}\p{Z}\p{S}\p{N}\p{P}]*
--labels (map)
Key-value pairs that describe the candidate. Labels aren’t part of the candidate’s identity. If the candidate already exists, these labels replace its existing labels. To remove all labels, specify an empty map. If you don’t specify labels, the existing labels are kept. Label keys and values can contain only Unicode letters, numbers, spaces, and the following characters:
_ . : / = + - @.Constraints:
- min:
0- max:
50key -> (string)
Constraints:
- min:
1- max:
128- pattern:
([\p{L}\p{Z}\p{N}_.:/=+\-@]*)value -> (string)
Constraints:
- min:
0- max:
256- pattern:
([\p{L}\p{Z}\p{N}_.:/=+\-@]*)
Shorthand Syntax:
KeyName1=string,KeyName2=string
JSON Syntax:
{"string": "string"
...}
--candidate-config (structure) [required]
The configuration that identifies the candidate. Candidates with the same configuration have the same
CandidateId.CustomerModelConfig -> (structure)
The configuration of a candidate that is one of your models.
ModelRef -> (string) [required]
A reference to the model that was evaluated, such as the ARN of a SageMaker model package or a model identifier.
Constraints:
- min:
1- max:
2048- pattern:
\S{1,2048}DatasetArn -> (string)
The dataset the candidate was evaluated on: the ARN of a SageMaker hub content DataSet, or the S3 URI of the dataset. Optional.
Constraints:
- min:
8- max:
2048- pattern:
(arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]+:([0-9]{12}|aws):hub-content/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}/DataSet/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}(/[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4})?|s3://[a-z0-9][a-z0-9.\-]{1,61}[a-z0-9](/[^\s\p{Cc}\p{Cf}]*)?)EvalCriteriaArn -> (string) [required]
The ARN of the evaluation criteria that the candidate was evaluated with. Specify the ARN of a SageMaker hub content document of type
JsonDoc, optionally with its version, for examplearn:aws:sagemaker:aa-example-3:111122223333:hub-content/my-hub/JsonDoc/my-criteria/1.0.0. For content in a public hub, the account isaws.Constraints:
- min:
20- max:
2048- pattern:
arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]+:([0-9]{12}|aws):hub-content/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}/JsonDoc/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}(/[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4})?PromptTemplateArn -> (string)
The Amazon Resource Name (ARN) of the prompt template that you use with the model. Optional. Specify the ARN of a SageMaker hub content document or of an Amazon Bedrock prompt, such as a prompt version ARN.
Constraints:
- min:
20- max:
2048- pattern:
(arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]+:([0-9]{12}|aws):hub-content/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,62}/[a-zA-Z]+/[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}(/[0-9]{1,4}\.[0-9]{1,4}\.[0-9]{1,4})?|arn:aws[a-z\-]*:bedrock:[a-z0-9\-]+:[0-9]{12}:prompt/[^\s\p{Cc}\p{Cf}]+)Dimensions -> (list)
Additional key-value pairs that define the candidate, such as the retrieval-augmented generation (RAG) Knowledge Base, RAG prompt template, and RAG number of results. Dimensions are part of the candidate’s identity: two candidates that differ only in their dimensions are distinct candidates. Each key can appear at most once.
Constraints:
- min:
0- max:
50(structure)
A key-value pair that, together with the other fields of the customer model configuration, defines a leaderboard candidate.
Key -> (string) [required]
The dimension key.
Constraints:
- min:
1- max:
64- pattern:
[A-Z][A-Z0-9_]*Value -> (string) [required]
The dimension value. The required format depends on the key.
Constraints:
- min:
1- max:
2048- pattern:
[^|\s]+
JSON Syntax:
{
"CustomerModelConfig": {
"ModelRef": "string",
"DatasetArn": "string",
"EvalCriteriaArn": "string",
"PromptTemplateArn": "string",
"Dimensions": [
{
"Key": "string",
"Value": "string"
}
...
]
}
}
--evaluation-results (list) [required]
The evaluation metrics to add to the candidate, grouped by evaluation criterion.
Constraints:
- min:
1- max:
100(structure)
The result of evaluating a candidate against one evaluation criterion.
CriterionName -> (string) [required]
The name of the evaluation criterion.
Constraints:
- min:
1- max:
64- pattern:
[a-zA-Z0-9][a-zA-Z0-9_\-]{0,63}Metrics -> (map) [required]
The metric values for the criterion, as a map of metric name to value.
Constraints:
- min:
1- max:
100key -> (string)
Constraints:
- min:
1- max:
256- pattern:
[a-zA-Z0-9][a-zA-Z0-9_\-/:.]{0,255}value -> (double)
Producer -> (string)
The source that produced the evaluation result.
Possible values:
MLFLOWEXTERNALSourceId -> (string)
The ID that the producer’s system, such as MLflow, assigns to the evaluation run that produced the result. The ID must begin with a letter or number and can contain only letters, numbers, hyphens (-), and underscores (_).
Constraints:
- min:
1- max:
256- pattern:
[a-zA-Z0-9][a-zA-Z0-9_\-]{0,255}SourceUrl -> (string)
A URL where you can view the evaluation run that produced the result. The URL must begin with
https://.Constraints:
- min:
1- max:
2048- pattern:
https://([^/]+)/?(.*)References -> (map)
Key-value pairs that link the result to related resources. Keys can contain only Unicode letters, numbers, spaces, and the following characters:
_ . : / = + - @. Values can’t contain control characters or format characters.Constraints:
- min:
0- max:
20key -> (string)
Constraints:
- min:
1- max:
128- pattern:
([\p{L}\p{Z}\p{N}_.:/=+\-@]*)value -> (string)
Constraints:
- min:
1- max:
2048- pattern:
[\p{L}\p{M}\p{Z}\p{S}\p{N}\p{P}]*RecordedAt -> (timestamp) [required]
When the evaluation result was produced.ListCandidatesuses this value to find the candidate’s most recent evaluation run.IngestedAt -> (timestamp)
When SageMaker added the result to the leaderboard. SageMaker sets this value. If you specify it inAddCandidate, SageMaker ignores it.
Shorthand Syntax:
CriterionName=string,Metrics={KeyName1=double,KeyName2=double},Producer=string,SourceId=string,SourceUrl=string,References={KeyName1=string,KeyName2=string},RecordedAt=timestamp,IngestedAt=timestamp ...
JSON Syntax:
[
{
"CriterionName": "string",
"Metrics": {"string": double
...},
"Producer": "MLFLOW"|"EXTERNAL",
"SourceId": "string",
"SourceUrl": "string",
"References": {"string": "string"
...},
"RecordedAt": timestamp,
"IngestedAt": timestamp
}
...
]
--client-token (string)
A unique, case-sensitive identifier for the request. If you don’t specify a client token, the Amazon Web Services SDKs and the Amazon Web Services CLI generate one for you.
Constraints:
- min:
1- max:
64- pattern:
[a-zA-Z0-9-]+
--cli-input-json | --cli-input-yaml (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml.
--generate-cli-skeleton (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input, prints a sample input JSON that can be used as an argument for --cli-input-json. Similarly, if provided yaml-input it will print a sample input YAML that can be used with --cli-input-yaml. If provided with the value output, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.
--debug (boolean)
Turn on debug logging.
--endpoint-url (string)
Override command’s default URL with the given URL.
--no-verify-ssl (boolean)
By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.
--no-paginate (boolean)
Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.
--output (string)
The formatting style for command output.
--query (string)
A JMESPath query to use in filtering the response data.
--profile (string)
Use a specific profile from your credential file.
--region (string)
The region to use. Overrides config/env settings.
--version (string)
Display the version of this tool.
--color (string)
Turn on/off color output.
--no-sign-request (boolean)
Do not sign requests. Credentials will not be loaded if this argument is provided.
--ca-bundle (string)
The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.
--cli-read-timeout (int)
The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.
--cli-connect-timeout (int)
The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.
--cli-binary-format (string)
The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob fileb:// will always be treated as binary and use the file contents directly regardless of the cli-binary-format setting. When using file:// the file contents will need to properly formatted for the configured cli-binary-format.
--no-cli-pager (boolean)
Disable cli pager for output.
--cli-auto-prompt (boolean)
Automatically prompt for CLI input parameters.
--no-cli-auto-prompt (boolean)
Disable automatically prompt for CLI input parameters.
--cli-error-format (string)
The formatting style for error output. By default, errors are displayed in enhanced format.
--help (boolean)
Display help for the command/subcommand.
CandidateId -> (string)
The ID of the candidate. If the candidate already existed, this is its existing ID.
Constraints:
- min:
1- max:
64- pattern:
[a-zA-Z0-9][a-zA-Z0-9\-]{0,63}