https://github.com/asimihsan/openai-web
https://github.com/asimihsan/openai-web
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/asimihsan/openai-web
- Owner: asimihsan
- Created: 2023-04-08T23:03:22.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-05T17:23:27.000Z (over 1 year ago)
- Last Synced: 2025-01-29T04:38:53.406Z (4 months ago)
- Language: Python
- Size: 703 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# openai-web
## Usage
poetry setup
```shell
cd service
poetry env use $(pyenv which python3) && poetry install --no-root
```Set up Terraform backend in the `global` environment. This is where the state for all environments is stored.
```shell
PROFILE=retail-admin
(cd terraform && aws-vault exec "$PROFILE" --region us-west-2 -- make init-global)
(cd terraform && aws-vault exec "$PROFILE" --region us-west-2 -- make apply-global)
```Push image:
```shell
PROFILE=retail-admin
aws-vault exec "$PROFILE" --region us-west-2 -- ./scripts/push-image.sh --tag 0.2
```Then deploy the `dev` environment.
```shell
PROFILE=retail-admin
(aws-vault exec "$PROFILE" --region us-west-2 -- ./scripts/terraform.sh --env dev --tag 0.2 init)
(aws-vault exec "$PROFILE" --region us-west-2 -- ./scripts/terraform.sh --env dev --tag 0.2 apply)
```## Testing
```shell
➜ wscat -c ws://127.0.0.1:8000/ws/completion
Connected (press CTRL+C to quit)
> {"prompt": "hello world!"}
< Hello
< !
< How
< can
< I
< help
< you
< today
< ?
```## Push
```shell
TAG=openai-prompt-0.2
(cd service && docker buildx build . -t "${TAG}" --platform linux/arm64)
(cd scripts && ./push-image.sh --tag "${TAG}")
```## References
- https://docs.aws.amazon.com/lambda/latest/dg/images-create.html
- https://github.com/openai/openai-cookbook/blob/main/examples/How_to_stream_completions.ipynb