Skip to content

Commit

Permalink
Added new seedfarmer module for Question and Answering Gen AI constru…
Browse files Browse the repository at this point in the history
…ct (#81)

* seedformer module for qaRagUsingAppSync

* Added deployspec and integrated llm-rag modules in deployment yaml

* Added IAC for Question and Answering module

* removed unwanted comments from the code

* added READ ME and other minor corrections to paths

* Added change description to CHANGELOG.md

* Updated repository README.md with qna-rag module details

* Corrected type in repository readme

* updated urlib version

* Added tests and upgdated read me

* removed print statement and added open search security group as input parameter

* updated example to include open search security group id

* Fixed unit test failure

* Moved qna-rag manifest to examples

* Updated Q&A Rag ingestion module to include ingestion modules as well

* deleted storage yaml from examples

* updated readme and added mypy validation fixes

* Updated read me to include ingestion construct and add existing S3 bucket as optional input to RAG module

* Added Optional type for input asset bucket

* removed the unnecessary comment

* Addressed review comments - Updated IDF open search module version, Added Port as configurable parameter

---------

Co-authored-by: kukushking <[email protected]>
  • Loading branch information
saikatak and kukushking authored May 23, 2024
1 parent 565b6a4 commit cb9844f
Show file tree
Hide file tree
Showing 21 changed files with 791 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- added `sagemaker-model-package-promote-pipeline` module.
- added `sagemaker-hugging-face-endpoint` module
- added `hf_import_models` template to import hugging face models
- added `qna-rag` module

### **Changed**

Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ See deployment steps in the [Deployment Guide](DEPLOYMENT.md).

### FMOps Modules

| Type | Description |
|-----------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------|
| [SageMaker JumpStart Foundation Model Endpoint Module](modules/fmops/sagemaker-jumpstart-fm-endpoint/README.md) | Creates an endpoint for a SageMaker JumpStart Foundation Model. |
| [SageMaker Hugging Face Foundation Model Endpoint Module](modules/fmops/sagemaker-hugging-face-endpoint/README.md) | Creates an endpoint for a SageMaker Hugging Face Foundation Model. |
| Type | Description |
|--------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| [SageMaker JumpStart Foundation Model Endpoint Module](modules/fmops/sagemaker-jumpstart-fm-endpoint/README.md) | Creates an endpoint for a SageMaker JumpStart Foundation Model. |
| [SageMaker Hugging Face Foundation Model Endpoint Module](modules/fmops/sagemaker-hugging-face-endpoint/README.md) | Creates an endpoint for a SageMaker Hugging Face Foundation Model. |
| [AppSync Knowledge Base Ingestion and Question and Answering RAG Module](modules/fmops/qna-rag/README.md) | Creates an Graphql endpoint for ingestion of data and and use ingested as knowledge base for a Question and Answering model using RAG. |


### MWAA Modules
Expand Down
1 change: 1 addition & 0 deletions examples/manifests/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ groups:
path: manifests/sagemaker-model-package-group-modules.yaml
- name: promote-models
path: manifests/sagemaker-model-package-promote-pipeline-modules.yaml

targetAccountMappings:
- alias: primary
accountId:
Expand Down
20 changes: 20 additions & 0 deletions manifests/fmops-qna-rag/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: mlops-qna-rag
toolchainRegion: us-east-1
forceDependencyRedeploy: true
groups:
- name: networking
path: manifests/fmops-qna-rag/networking-modules.yaml
- name: storage
path: manifests/fmops-qna-rag/storage-modules.yaml
- name: qna-rag
path: manifests/fmops-qna-rag/qna-rag-modules.yaml

targetAccountMappings:
- alias: primary
accountId:
valueFrom:
envVariable: PRIMARY_ACCOUNT
default: true
regionMappings:
- region: us-east-1
default: true
6 changes: 6 additions & 0 deletions manifests/fmops-qna-rag/networking-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: networking
path: git::https://github.com/awslabs/idf-modules.git//modules/network/basic-cdk?ref=release/1.3.0&depth=1
targetAccount: primary
parameters:
- name: internet-accessible
value: True
24 changes: 24 additions & 0 deletions manifests/fmops-qna-rag/qna-rag-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: qna-rag
path: modules/fmops/qna-rag
parameters:
- name: cognito-pool-id
#Replace below value with valid congnito pool id
value: us-east-1_XXXXX
- name: os-domain-endpoint
valueFrom:
moduleMetadata:
group: storage
name: opensearch
key: OpenSearchDomainEndpoint
- name: os-security-group-id
valueFrom:
moduleMetadata:
group: storage
name: opensearch
key: OpenSearchSecurityGroupId
- name: vpc-id
valueFrom:
moduleMetadata:
group: networking
name: networking
key: VpcId
22 changes: 22 additions & 0 deletions manifests/fmops-qna-rag/storage-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: opensearch
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch?ref=release/1.7.0&depth=1
targetAccount: primary
targetRegion: us-east-1
parameters:
- name: encryption-type
value: SSE
- name: retention-type
value: RETAIN
- name: vpc-id
valueFrom:
moduleMetadata:
group: networking
name: networking
key: VpcId
- name: private-subnet-ids
valueFrom:
moduleMetadata:
group: networking
name: networking
key: PrivateSubnetIds
24 changes: 24 additions & 0 deletions manifests/qna-rag-modules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: qna-rag
path: modules/fmops/qna-rag
parameters:
- name: cognito-pool-id
#Replace below value with valid congnito pool id
value: us-east-1_XXXXX
- name: os-domain-endpoint
valueFrom:
moduleMetadata:
group: storage
name: opensearch
key: OpenSearchDomainEndpoint
- name: os-security-group-id
valueFrom:
moduleMetadata:
group: storage
name: opensearch
key: OpenSearchSecurityGroupId
- name: vpc-id
valueFrom:
moduleMetadata:
group: networking
name: networking
key: VpcId
22 changes: 22 additions & 0 deletions manifests/storage-modules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,25 @@ parameters:
value: 30
- name: removal-policy
value: DESTROY
---
name: opensearch
path: git::https://github.com/awslabs/idf-modules.git//modules/storage/opensearch?ref=release/1.7.0&depth=1
targetAccount: primary
targetRegion: us-east-1
parameters:
- name: encryption-type
value: SSE
- name: retention-type
value: RETAIN
- name: vpc-id
valueFrom:
moduleMetadata:
group: networking
name: networking
key: VpcId
- name: private-subnet-ids
valueFrom:
moduleMetadata:
group: networking
name: networking
key: PrivateSubnetIds
2 changes: 2 additions & 0 deletions manifests/uber-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ groups:
path: manifests/mwaa-modules.yaml
- name: mwaa-dags
path: manifests/mwaa-dag-modules.yaml
- name: qna-rag
path: manifests/qna-rag-modules.yaml
targetAccountMappings:
- alias: primary
accountId:
Expand Down
Loading

0 comments on commit cb9844f

Please sign in to comment.