CSAle commited on
Commit
4689b8a
1 Parent(s): 6b68216

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +135 -2
README.md CHANGED
@@ -1,2 +1,135 @@
1
- # Beyond-ChatGPT
2
- Please refer to the [LLMOps Dev Environment](https://github.com/AI-Maker-Space/LLMOps-Dev-101/) for instructions.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## 🤖 Your First LLM App
2
+
3
+ In this repository, we'll walk you through the steps to create a Large Language Model (LLM) application using Chainlit, then containerize it using Docker, and finally deploy it on Huggingface Spaces.
4
+
5
+ Are you ready? Let's get started!
6
+
7
+ <details>
8
+ <summary>🏗️ Building Your First LLM App</summary>
9
+
10
+ 1. Clone [this](https://github.com/AI-Maker-Space/Beyond-ChatGPT/tree/main) repo.
11
+
12
+ ``` bash
13
+ git clone https://github.com/AI-Maker-Space/Beyond-ChatGPT.git
14
+ ```
15
+
16
+ 2. Navigate inside this repo
17
+ ``` bash
18
+ cd Beyond-ChatGPT
19
+ ```
20
+
21
+ 3. Install the packages required for this python envirnoment in `requirements.txt`.
22
+ ``` bash
23
+ pip install -r requirements.txt
24
+ ```
25
+
26
+ 4. Open your `.env` file. Replace the `###` in your `.env` file with your OpenAI Key and save the file.
27
+ ``` bash
28
+ OPENAI_API_KEY=sk-###
29
+ ```
30
+
31
+ 5. Let's try deploying it locally. Make sure you're in the python environment where you installed Chainlit and OpenAI. Run the app using Chainlit. This may take a minute to run.
32
+ ``` bash
33
+ chainlit run app.py -w
34
+ ```
35
+
36
+ <p align = "center" draggable=”false”>
37
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/54bcccf9-12e2-4cef-ab53-585c1e2b0fb5">
38
+ </p>
39
+
40
+ Great work! Let's see if we can interact with our chatbot.
41
+
42
+ <p align = "center" draggable=”false”>
43
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/854e4435-1dee-438a-9146-7174b39f7c61">
44
+ </p>
45
+
46
+ Awesome! Time to throw it into a docker container and prepare it for shipping!
47
+ </details>
48
+
49
+
50
+
51
+ <details>
52
+ <summary>🐳 Containerizing our App</summary>
53
+
54
+ 1. Let's build the Docker image. We'll tag our image as `llm-app` using the `-t` parameter. The `.` at the end means we want all of the files in our current directory to be added to our image.
55
+
56
+ ``` bash
57
+ docker build -t llm-app .
58
+ ```
59
+
60
+ 2. Run and test the Docker image locally using the `run` command. The `-p`parameter connects our **host port #** to the left of the `:` to our **container port #** on the right.
61
+
62
+ ``` bash
63
+ docker run -p 7860:7860 llm-app
64
+ ```
65
+
66
+ 3. Visit http://localhost:7860 in your browser to see if the app runs correctly.
67
+
68
+ <p align = "center" draggable=”false”>
69
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/2c764f25-09a0-431b-8d28-32246e0ca1b7">
70
+ </p>
71
+
72
+ Great! Time to ship!
73
+ </details>
74
+
75
+
76
+ <details>
77
+ <summary>🚀 Deploying Your First LLM App</summary>
78
+
79
+ 1. Let's create a new Huggingface Space. Navigate to [Huggingface](https://huggingface.co) and click on your profile picture on the top right. Then click on `New Space`.
80
+
81
+ <p align = "center" draggable=”false”>
82
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/f0656408-28b8-4876-9887-8f0c4b882bae">
83
+ </p>
84
+
85
+ 2. Setup your space as shown below:
86
+
87
+ - Owner: Your username
88
+ - Space Name: `llm-app`
89
+ - License: `Openrail`
90
+ - Select the Space SDK: `Docker`
91
+ - Docker Template: `Blank`
92
+ - Space Hardware: `CPU basic - 2 vCPU - 16 GB - Free`
93
+ - Repo type: `Public`
94
+
95
+ <p align = "center" draggable=”false”>
96
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/8f16afd1-6b46-4d9f-b642-8fefe355c5c9">
97
+ </p>
98
+
99
+ 3. You should see something like this. We're now ready to send our files to our Huggingface Space. After cloning, move your files to this repo and push it along with your docker file. You DO NOT need to create a Dockerfile. Make sure NOT TO push your `.env` file. This should automatically be ignored.
100
+
101
+ <p align = "center" draggable=”false”>
102
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/cbf366e2-7613-4223-932a-72c67a73f9c6">
103
+ </p>
104
+
105
+ 4. After pushing all files, navigate to the settings in the top right to add your OpenAI API key.
106
+
107
+ <p align = "center" draggable=”false”>
108
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/a1123a6f-abdd-4f76-bea4-39acf9928762">
109
+ </p>
110
+
111
+ 5. Scroll down to `Variables and secrets` and click on `New secret` on the top right.
112
+
113
+ <p align = "center" draggable=”false”>
114
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/a8a4a25d-752b-4036-b572-93381370c2db">
115
+ </p>
116
+
117
+ 6. Set the name to `OPENAI_API_KEY` and add your OpenAI key under `Value`. Click save.
118
+
119
+ <p align = "center" draggable=”false”>
120
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/0a897538-1779-48ff-bcb4-486af30f7a14">
121
+ </p>
122
+
123
+ 7. To ensure your key is being used, we recommend you `Restart this Space`.
124
+
125
+ <p align = "center" draggable=”false”>
126
+ <img src="https://github.com/AI-Maker-Space/LLMOps-Dev-101/assets/37101144/fb1d83af-6ebe-4676-8bf5-b6d88f07c583">
127
+ </p>
128
+
129
+ 8. Congratulations! You just deployed your first LLM! 🚀🚀🚀 Get on linkedin and post your results and experience! Make sure to tag us at #AIMakerspace !
130
+
131
+ </details>
132
+
133
+ <p></p>
134
+
135
+ ### That's it for now! And so it begins.... :)