Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

generative-ai

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
```