Joshua Sundance Bailey
commited on
Commit
·
7c432a4
1
Parent(s):
b7f0aa3
readme
Browse files
README.md
CHANGED
@@ -22,3 +22,51 @@ tags: [langchain, streamlit, docker]
|
|
22 |
[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?&logo=docker&logoColor=white)](https://hub.docker.com/r/joshuasundance/langchain-streamlit-demo)
|
23 |
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joshuasundance/langchain-streamlit-demo/latest)](https://hub.docker.com/r/joshuasundance/langchain-streamlit-demo)
|
24 |
[![Open HuggingFace Space](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg)](https://huggingface.co/spaces/joshuasundance/langchain-streamlit-demo)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
[![Docker](https://img.shields.io/badge/docker-%230db7ed.svg?&logo=docker&logoColor=white)](https://hub.docker.com/r/joshuasundance/langchain-streamlit-demo)
|
23 |
[![Docker Image Size (tag)](https://img.shields.io/docker/image-size/joshuasundance/langchain-streamlit-demo/latest)](https://hub.docker.com/r/joshuasundance/langchain-streamlit-demo)
|
24 |
[![Open HuggingFace Space](https://huggingface.co/datasets/huggingface/badges/raw/main/open-in-hf-spaces-sm.svg)](https://huggingface.co/spaces/joshuasundance/langchain-streamlit-demo)
|
25 |
+
|
26 |
+
|
27 |
+
This project shows how to build a simple chatbot UI with [Streamlit](https://streamlit.io) and [LangChain](https://langchain.com).
|
28 |
+
|
29 |
+
This `README` was written by [Claude 2](https://www.anthropic.com/index/claude-2), an LLM from [Anthropic](https://www.anthropic.com/).
|
30 |
+
|
31 |
+
# Features
|
32 |
+
- Chat interface for talking to AI assistant
|
33 |
+
- Streaming output of assistant responses
|
34 |
+
- Leverages LangChain for dialogue management
|
35 |
+
- Integrates with [LangSmith](https://smith.langchain.com) for tracing conversations
|
36 |
+
- Allows giving feedback on assistant's responses
|
37 |
+
|
38 |
+
# Usage
|
39 |
+
## With Docker (pull from Docker Hub)
|
40 |
+
1. Run in terminal: `docker run -p 7860:7860 joshuasundance/langchain-streamlit-demo:latest`
|
41 |
+
2. Open http://localhost:7860 in your browser.
|
42 |
+
|
43 |
+
## Docker Compose
|
44 |
+
1. Clone the repo. Navigate to cloned repo directory.
|
45 |
+
2. Run in terminal: `docker-compose up`
|
46 |
+
3. Then open http://localhost:7860 in your browser.
|
47 |
+
|
48 |
+
# Configuration
|
49 |
+
- Enter your OpenAI API key to power the assistant
|
50 |
+
- Optionally enter a LangSmith API key to enable conversation tracing
|
51 |
+
- Customize the assistant prompt and temperature
|
52 |
+
|
53 |
+
# Code Overview
|
54 |
+
- `app.py` - Main Streamlit app definition
|
55 |
+
- `llm_stuff.py` - LangChain helper functions
|
56 |
+
|
57 |
+
# Deployment
|
58 |
+
The app is packaged as a Docker image for easy deployment. It is published to Docker Hub and Hugging Face Spaces:
|
59 |
+
|
60 |
+
- [DockerHub](https://hub.docker.com/r/joshuasundance/langchain-streamlit-demo)
|
61 |
+
- [HuggingFace Spaces](https://huggingface.co/spaces/joshuasundance/langchain-streamlit-demo)
|
62 |
+
|
63 |
+
CI workflows in `.github/workflows` handle building and publishing the image.
|
64 |
+
|
65 |
+
# Links
|
66 |
+
- [Streamlit](https://streamlit.io)
|
67 |
+
- [LangChain](https://langchain.com)
|
68 |
+
- [LangSmith](https://smith.langchain.com)
|
69 |
+
|
70 |
+
# TODO
|
71 |
+
1. Add support for Anthropic and Anyscale chat models
|
72 |
+
2. More customization / parameterization in sidebar
|