https://github.com/yeukfei02/generative-ai
generative-ai
https://github.com/yeukfei02/generative-ai
aws-apigateway aws-cdk aws-lambda bedrock cdk generative-ai python serverless stable-diffusion streamlit text-to-image text-to-text
Last synced: 1 day ago
JSON representation
generative-ai
- Host: GitHub
- URL: https://github.com/yeukfei02/generative-ai
- Owner: yeukfei02
- License: mit
- Created: 2024-01-28T13:26:57.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-19T09:01:18.000Z (over 1 year ago)
- Last Synced: 2025-01-11T01:26:59.741Z (over 1 year ago)
- Topics: aws-apigateway, aws-cdk, aws-lambda, bedrock, cdk, generative-ai, python, serverless, stable-diffusion, streamlit, text-to-image, text-to-text
- Language: Python
- Homepage:
- Size: 2.69 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# generative-ai
This project intends to use aws cdk with aws bedrock to make API with generative ai, there are two API for `text-to-text` and `text-to-image`
The model uses `amazon titan text express v1`, `meta llama3 8b-instruct v1.0` and `stable diffusion XL v1.0`
Web ui uses streamlit
documentation:
api:
grammarly api url:
best-deal api url:
ideal-girl api url:
get-ideal-girls api url:
web:
grammarly web url:
best-deal web url:
ideal-girl web url:
ideal-girl-listing web url:
## Requirement
- install python (v3.12.1)
- install cdk-cli
The cdk.json file tells the CDK Toolkit how to execute your app.
## Testing and run
```zsh
// create virtualenv
$ python -m venv .venv
// activate virtualenv
$ source .venv/bin/activate
// install dependencies
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
// install lambda layer dependencies
$ cd lambda/layer/python
$ pip install -r requirements.txt
// run test case
$ pytest
```
```zsh
// copy .env file
$ cp .env.sample .env
// list all stacks in the app
$ cdk ls
// deploys the CDK toolkit stack into an AWS environment
$ cdk bootstrap
// compare deployed stack with current state
$ cdk diff
// synthesize the CloudFormation template
$ cdk synth
// deploy specific stack to your default AWS account/region
$ cdk deploy
// deploy all stack
$ cdk deploy --all
// destroy specific stack
$ cdk destroy
// destroy all stack
$ cdk destroy --all
// check more command
$ cdk --help
```
```zsh
// install dependencies
$ cd web
$ pip install -r requirements.txt
// open grammarly web
$ streamlit run grammarly.py
// open best_deal web
$ streamlit run best_deal.py
// open ideal girl web
$ streamlit run ideal_girl.py
// open ideal girl listing web
$ streamlit run ideal_girl_listing.py
```