You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update Project to Reflect Changes to Required Python Packages, Python Docker Image, Amazon Bedrock, and RDS Engine Version #58 (#59)
* Update Bedrock default model.
* Update default OpenAI model
* Update Image Tag to 2.0.0
* Add RDSEngineVersion Parameter and Update Version to 16.1
* Update README.md to Reflect Code Changes
* New Python Docker Image, Packages, and LLMs
Copy file name to clipboardExpand all lines: README.md
+17-24Lines changed: 17 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,11 @@ performing NLQ. In addition to model choice, NLQ accuracy also relies heavily on
21
21
prompt, prompt template, labeled sample queries used for in-context learning (_aka few-shot prompting_), and the naming
22
22
conventions used for your database schema (tables and columns).
23
23
24
-
The NLQ Application was tested on a variety of open source and commercial FMs. As a baseline both Anthropic Claude v1.3
25
-
and v2, and OpenAI's GPT-3 and GPT-4 series models were capable of accurately answering most or all sample questions
26
-
included in this README file and the NLQ Application's web UI. Anthropic's Claude-series models,
27
-
including `anthropic.claude-v1` and `anthropic.claude-v2`, as well as OpenAI's Generative Pre-trained Transformer GPT-3
28
-
and GPT-4 series models, including `text-davinci-003` (Legacy), `gpt-3.5-turbo`, and `gpt-4`, all provide accurate
29
-
responses to a wide range of complex natural language queries using an average amount of in-context learning and prompt
30
-
engineering.
24
+
The NLQ Application was tested on a variety of open source and commercial FMs. As a baseline OpenAI's Generative
25
+
Pre-trained Transformer GPT-3 and GPT-4 series models, including `gpt-3.5-turbo`, and
26
+
`gpt-4`, all provide accurate responses to a wide range of complex natural language queries using an average amount of
27
+
in-context learning and prompt engineering. In addition, the Amazon Titan Text G1 - Express, `amazon.titan-text-express-v1`,
28
+
was able to answer most of the Simple questions with some model specific prompt optimization.
31
29
32
30
Open source NLQ-capable models, such as `google/flan-t5-xxl` and `google/flan-t5-xxl-fp16` (half-precision
33
31
floating-point format (FP16) version of the full model), are available through Amazon SageMaker JumpStart Foundation
@@ -45,20 +43,20 @@ the `NlqSageMakerEndpointStack.yaml` CloudFormation template file. You will firs
45
43
the `NlqSageMakerEndpointStack.yaml` file and update the deployed CloudFormation stack, `NlqSageMakerEndpointStack`.
46
44
Additionally, you may need to make adjustments to the NLQ Application, the `app_sagemaker.py` file, modifying
47
45
the `ContentHandler` Class to match the response payload of the chosen model. Then, rebuild the Amazon ECR Docker Image,
48
-
incrementing the version, e.g., `nlq-genai-1.0.1-sm`, using the `Dockerfile_SageMaker` Dockerfile and push to the Amazon
46
+
incrementing the version, e.g., `nlq-genai-2.0.1-sm`, using the `Dockerfile_SageMaker` Dockerfile and push to the Amazon
49
47
ECR repository. Lastly, you will need to update the deployed ECS task and service, which are part of
50
48
the `NlqEcsSageMakerStack` CloudFormation stack.
51
49
52
50
### Option 2: Switching to Amazon Bedrock
53
51
54
52
Switching from the solution's default Amazon SageMaker JumpStart Foundation Model to Amazon Bedrock model's, such as
55
-
Anthropic `anthropic.claude-v1` and `anthropic.claude-v2`, will provide superior results. Using Amazon Bedrock
53
+
Amazon Titan Text G1 - Express (`amazon.titan-text-express-v1`), will provide better results than JumpStarts's `google/flan-t5-xxl-fp16`. Using Amazon Bedrock
56
54
eliminates the need for the deployment of the `NlqSageMakerEndpointStack` CloudFormation stack. If the stack has already
57
55
been deployed, it can be deleted. Next, build the Amazon ECR Docker Image using the `Dockerfile_Bedrock` Dockerfile and
58
-
push the resulting image, e.g., `nlq-genai-1.0.0-bedrock`, to the Amazon ECR repository. Finally, deploy
56
+
push the resulting image, e.g., `nlq-genai-2.0.0-bedrock`, to the Amazon ECR repository. Finally, deploy
59
57
the `NlqEcsBedrockStack.yaml` CloudFormation template file. This stack replaces the the `NlqEcsSageMakerStack`
60
-
CloudFormation stack, designed for use JumpStart Foundation Models. The default model used for this option is Anthropic
61
-
Claude Instant v1, `anthropic.claude-instant-v1`.
58
+
CloudFormation stack, designed for use JumpStart Foundation Models. The default Amazon Bedrock model used for this option is
59
+
Amazon Titan Text G1 - Express (`amazon.titan-text-express-v1`).
62
60
63
61
### Option 3: Switching to a Third-party Model Provider's API
64
62
@@ -67,7 +65,7 @@ such as OpenAI, Cohere, and Anthropic is straightforward. To utilize OpenAI's mo
67
65
OpenAI account and obtain your own personal API key. Using a third-party model via an API eliminates the need for the
68
66
deployment of the `NlqSageMakerEndpointStack` CloudFormation stack. If the stack has already been deployed, it can be
69
67
deleted. Next, build the Amazon ECR Docker Image using the `Dockerfile_OpenAI` Dockerfile and push the resulting image,
70
-
e.g., `nlq-genai-1.0.0-oai`, to the Amazon ECR repository. Finally, deploy the `NlqEcsOpenAIStack.yaml` CloudFormation
68
+
e.g., `nlq-genai-2.0.0-oai`, to the Amazon ECR repository. Finally, deploy the `NlqEcsOpenAIStack.yaml` CloudFormation
71
69
template file. This stack replaces the the `NlqEcsSageMakerStack` CloudFormation stack, designed for use JumpStart
72
70
Foundation Models.
73
71
@@ -121,8 +119,8 @@ the choice of model. Not all models are capable of NLQ, while others will not re
121
119
one in your account, or the `AWSServiceRoleForECS` Service-Linked Role will not yet exist and the stack will fail.
122
120
Check the `AWSServiceRoleForECS` Service-Linked Role before deploying the `NlqMainStack` stack. This role is
123
121
auto-created the first time you create an ECS cluster in your account.
124
-
4. If you use Option 1: SageMaker JumpStart FM Endpoint, build and push the `nlq-genai:1.0.0-sm` Docker image to the new
125
-
Amazon ECR repository. Alternately, build and push the `nlq-genai:1.0.0-bedrock` or `nlq-genai:1.0.0-oai` Docker
122
+
4. If you use Option 1: SageMaker JumpStart FM Endpoint, build and push the `nlq-genai:2.0.0-sm` Docker image to the new
123
+
Amazon ECR repository. Alternately, build and push the `nlq-genai:2.0.0-bedrock` or `nlq-genai:2.0.0-oai` Docker
126
124
image for use with Option 2: Bedrock or Option 3: OpenAI API.
127
125
5. Import the included sample data into the Amazon RDS MoMA database.
128
126
6. Add the `nlqapp` user to the MoMA database.
@@ -134,14 +132,9 @@ the choice of model. Not all models are capable of NLQ, while others will not re
134
132
135
133
### Step 2: Create AWS Secret Manager Secrets
136
134
137
-
Make sure you update the secret values before continuing.
135
+
Make sure you update the secret values below before continuing. This step will create secrets for the credentials for the NLQ application. Optionally, this step will create a secret to store your OpenAI API key. Master User credentials for the RDS instance are set automatically and stored in AWS Secret Manager as part of the `NlqMainStack` CloudFormation template.
138
136
139
137
```sh
140
-
aws secretsmanager create-secret \
141
-
--name /nlq/MasterUsername \
142
-
--description "Master username for RDS instance." \
143
-
--secret-string "<your_master_username>"
144
-
145
138
aws secretsmanager create-secret \
146
139
--name /nlq/NLQAppUsername \
147
140
--description "NLQ Application username for MoMA database." \
0 commit comments