> **Experimental**
>
> `@aws-cdk/aws-sagemaker-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ServerlessProductionVariantProps

Construction properties for a serverless production variant.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/endpoint-config.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/@aws-cdk/aws-sagemaker-alpha/lib/endpoint-config.ts#L89)

## Example

TypeScript:

```ts
import * as sagemaker from '@aws-cdk/aws-sagemaker-alpha';

declare const model: sagemaker.Model;

const endpointConfig = new sagemaker.EndpointConfig(this, 'ServerlessEndpointConfig', {
  serverlessProductionVariant: {
    model: model,
    variantName: 'serverlessVariant',
    maxConcurrency: 10,
    memorySizeInMB: 2048,
    provisionedConcurrency: 5, // optional
  },
});
```

Python:

```python
import aws_cdk.aws_sagemaker_alpha as sagemaker

# model: sagemaker.Model

endpoint_config = sagemaker.EndpointConfig(self, "ServerlessEndpointConfig",
    serverless_production_variant=sagemaker.ServerlessProductionVariantProps(
        model=model,
        variant_name="serverlessVariant",
        max_concurrency=10,
        memory_size_in_mb=2048,
        provisioned_concurrency=5
    )
)
```

Java:

```java
import software.amazon.awscdk.services.sagemaker.alpha.*;

Model model;

EndpointConfig endpointConfig = EndpointConfig.Builder.create(this, "ServerlessEndpointConfig")
        .serverlessProductionVariant(ServerlessProductionVariantProps.builder()
                .model(model)
                .variantName("serverlessVariant")
                .maxConcurrency(10)
                .memorySizeInMB(2048)
                .provisionedConcurrency(5)
                .build())
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.Sagemaker.Alpha
using Amazon.CDK.AWS.Sagemaker.Alpha;

Model model;

var endpointConfig = new EndpointConfig(this, "ServerlessEndpointConfig", new EndpointConfigProps {
    ServerlessProductionVariant = new ServerlessProductionVariantProps {
        Model = model,
        VariantName = "serverlessVariant",
        MaxConcurrency = 10,
        MemorySizeInMB = 2048,
        ProvisionedConcurrency = 5
    }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdksagemakeralpha/v2
import sagemaker "github.com/aws/aws-cdk-go/awscdksagemakeralpha"

var model Model

endpointConfig := sagemaker.NewEndpointConfig(this, jsii.String("ServerlessEndpointConfig"), &EndpointConfigProps{
	ServerlessProductionVariant: &ServerlessProductionVariantProps{
		Model: model,
		VariantName: jsii.String("serverlessVariant"),
		MaxConcurrency: jsii.Number(10),
		MemorySizeInMB: jsii.Number(2048),
		ProvisionedConcurrency: jsii.Number(5),
	},
})
```

## Properties

- `initialVariantWeight`: number = 1.0 — Determines initial traffic distribution among all of the models that you specify in the endpoint configuration.

  The traffic to a production variant is determined by the ratio of the
  variant weight to the sum of all variant weight values across all production variants.

- `maxConcurrency`: number (required) — The maximum number of concurrent invocations your serverless endpoint can process.

  Valid range: 1-200

- `memorySizeInMB`: number (required) — The memory size of your serverless endpoint.

  Valid values are in 1 GB increments:
  1024 MB, 2048 MB, 3072 MB, 4096 MB, 5120 MB, or 6144 MB.

- `model`: [IModel](/cdk/api/v2/docs/@aws-cdk_aws-sagemaker-alpha.IModel.html) (required) — The model to host.

- `provisionedConcurrency`: number = none — The number of concurrent invocations that are provisioned and ready to respond to your endpoint.

  Valid range: 1-200, must be less than or equal to maxConcurrency.

- `variantName`: string (required) — Name of the production variant.
