Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/miolab/py_llm
Sample Dockerized Python application that uses LangChain.
https://github.com/miolab/py_llm
docker langchain openai-api python
Last synced: 8 days ago
JSON representation
Sample Dockerized Python application that uses LangChain.
- Host: GitHub
- URL: https://github.com/miolab/py_llm
- Owner: miolab
- Created: 2023-07-15T12:16:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-08-08T20:57:34.000Z (over 1 year ago)
- Last Synced: 2024-10-30T11:08:58.231Z (about 2 months ago)
- Topics: docker, langchain, openai-api, python
- Language: Python
- Homepage:
- Size: 283 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Py LLM
This repository contains a sample Dockerized Python application that uses LangChain and Streamlit together. The application encodes a given text into GPTed and displays it using Streamlit.
__Note:__ This repository is intended for personal verification purposes and is not primarily intended for production development use. Preparation is required to use OpenAI's LangChain.
## Sample Usage
### Building and Running Locally
You can build the Docker image and launch the application using the following commands:
- Prepare `.env` file
```sh
cp .env.sample .env
```- Set `OPENAI_API_KEY` (required)
- docker build and docker run
```sh
docker build -t py_llm .
``````sh
docker run --rm -p 8501:8501 -e OPENAI_API_KEY=$(cat .env | grep OPENAI_API_KEY | cut -d '=' -f2) py_llm
```- After launch, access http://localhost:8501 in your browser to display the application's UI.
## Application Features
Interactively talk with OpenAI sample bot, GPT Assistant, in UI.
- Example usage image
- User input
- Result
## Ref
- LangChain https://www.langchain.com/
- Streamlit https://streamlit.io/