forked from aws-samples/aws-genai-llm-chatbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
33 lines (27 loc) · 1.13 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
export * from './container-images';
export * from './types';
import * as sagemaker from 'aws-cdk-lib/aws-sagemaker';
import { Construct } from 'constructs';
import { deployContainerModel } from './deploy-container-model';
import { deployCustomScriptModel } from './deploy-custom-script-model';
import { deployPackageModel } from './deploy-package-model';
import { LargeLanguageModelProps } from './types';
export class LargeLanguageModel extends Construct {
public readonly endpoint: sagemaker.CfnEndpoint;
public readonly modelId: string;
constructor(scope: Construct, id: string, props: LargeLanguageModelProps) {
super(scope, id);
const { model } = props;
this.modelId = model.modelId;
if (model.kind == 'container') {
const { endpoint } = deployContainerModel(this, props, model);
this.endpoint = endpoint;
} else if (model.kind == 'custom-script') {
const { endpoint } = deployCustomScriptModel(this, props, model);
this.endpoint = endpoint;
} else if (model.kind == 'package') {
const { endpoint } = deployPackageModel(this, props, model);
this.endpoint = endpoint;
}
}
}