Skip to content

Commit a5e583b

Browse files
committed
Add readme
1 parent 2b65bb5 commit a5e583b

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Chat Assistant with Streamlit and FastAPI
22

3-
This project is a chat application with a web interface developed with Streamlit and a backend developed with FastAPI. The chat queries a TinyLlama model hosted on Hugging Face to respond to users' questions. The entire solution is containerized and can be deployed with both Docker Compose and Kubernetes.
3+
This project is a chat application with a web interface developed using Streamlit and a backend developed with FastAPI. The backend integrates and loads the TinyLlama model directly to handle chat queries and generate responses to users' questions. The entire solution is containerized, allowing for deployment with both Docker Compose and Kubernetes.
44

55
## Features
66

7-
- Chat interface with a TinyLlama model hosted on Hugging Face to respond to user queries in natural language format with a conversational tone and context. View the [TinyLlama model](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0).
7+
- Chat Interface with TinyLlama Model: The chat interface uses a TinyLlama model integrated within the backend to respond to user queries in natural language format with a conversational tone and context. The model is not hosted on Hugging Face but is instead downloaded and loaded directly in the backend for real-time response generation. View the [TinyLlama model](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v1.0).
88
- Web interface developed with Streamlit. The user can interact with the chatbot and view the responses in real-time. View the [Streamlit documentation](https://docs.streamlit.io/).
99
- Backend API developed with FastAPI. The API handles the chatbot logic and interacts with the TinyLlama model to generate responses. View the [FastAPI documentation](https://fastapi.tiangolo.com/).
1010
- Containerized images with Docker
@@ -36,6 +36,42 @@ In this project, you can find the following workflows (only available with each
3636
```bash
3737
docker pull ghcr.io/adribaeza/llm-tinyllama-frontend:latest
3838
```
39+
# Architecture solution
40+
41+
The architecture of the chat assistant application is designed to be modular and scalable. The application is divided into two main components: the frontend and the backend.
42+
43+
Frontend (Streamlit):
44+
45+
Developed with Streamlit, it provides the user interface for interacting with the chatbot.
46+
Users can send chat messages and receive responses through the frontend interface.
47+
Backend (FastAPI):
48+
49+
Developed with FastAPI, it handles the chatbot logic and interactions with the TinyLlama model.
50+
The TinyLlama model, a conversational language model, is downloaded and loaded within the backend to generate real-time responses.
51+
The backend exposes an API that the frontend uses to send chat messages and receive responses from the chatbot.
52+
Both components, frontend and backend, are containerized with Docker and can be deployed using Docker Compose or Kubernetes. This separation allows for independent scaling and deployment of each part of the application.
53+
54+
The frontend communicates with the backend via HTTP POST requests, sending chat messages to the backend and receiving responses generated by the TinyLlama model. The TinyLlama model is not hosted externally but is directly integrated and loaded within the backend to provide real-time responses.
55+
56+
The application is designed to be user-friendly and interactive, allowing users to chat with the chatbot and view responses immediately. It can be deployed on local machines or in the cloud using Docker Compose or Kubernetes.
57+
58+
```
59+
+--------------------------------------+
60+
| Docker |
61+
| |
62+
| +-------------+ +-------------+ |
63+
| | Frontend | | Backend | |
64+
| | (Streamlit) | <--->| (FastAPI) | |
65+
| +-------------+ HTTP| +---------+ | |
66+
| | | TinyLlama | |
67+
| | | (Modelo) | |
68+
| | +---------+ | |
69+
| +----------------------------------+ |
70+
| Docker Compose / Kubernetes |
71+
+--------------------------------------+
72+
```
73+
74+
![Architecture Diagram](images/architecture-diagram.png)
3975
4076
# Project Structure
4177
@@ -124,6 +160,7 @@ The root directory contains configuration files and documentation for the overal
124160
- **pytest.ini**: Configuration file for pytest. Example: exclude directories from testing, set verbosity, etc.
125161
- **README.md**: Main documentation file for the project.
126162
163+
127164
## Getting Started
128165
129166
### Prerequisites

0 commit comments

Comments
 (0)