Skip to content

Commit 232a877

Browse files
authoredApr 16, 2023
Update the developers guide to the current state of the project (LAION-AI#2623)
1 parent 09957cb commit 232a877

File tree

1 file changed

+36
-29
lines changed

1 file changed

+36
-29
lines changed
 

‎docs/docs/guides/developers.md

+36-29
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,15 @@ can create their own custom assistants.
8989
## The tools
9090

9191
A web application, usually referred to as **"the web frontend"**, has been
92-
created. Initially, it supports the first two steps of the process outlined in
93-
the previous section, which require humans creating conversations (step 1) and
94-
ranking answers (step 2).
92+
created. It supports the first two steps of the process outlined in the previous
93+
section, which require humans creating conversations (step 1) and ranking
94+
answers (step 2). It also supports the inference step, creating a chat
95+
interface.
9596

96-
For this same goal, data gathering, a discord bot is being created. We'll call
97-
it **"the data gathering discord bot"**.
97+
For data gathering, two discord bots were created, one using Python and the
98+
other using Javascript. The latter also supports the inference process.
9899

99-
For doing the inference, once the final model is ready, an **"inference
100-
service"** is being created. Another section will be added to the web frontend,
101-
so that the assistant can be used from the web.
100+
For doing the inference, an **"inference service"** has been created.
102101

103102
In addition, for collecting the instruction dataset, a set of **scripts and
104103
notebooks** is being developed.
@@ -134,10 +133,10 @@ When you run `npm run dev` in the website directory, it starts the Next.js
134133
application in the node server. The Next.js application is available at
135134
`http://localhost:3000`.
136135

137-
In the Dockerfile, there's also a `maildev` container that is used during to be
138-
able to sent emails for registration, although for local development there are
139-
fake users pre-created and this is not required. There is a fake user called
140-
`dev` and it can be assigned a role during log in.
136+
In the Dockerfile, there's also a `maildev` container that is used to be able to
137+
sent emails for registration, although for local development there are fake
138+
users pre-created and this is not required. There is a fake user called `dev`
139+
and it can be assigned a role during log in.
141140

142141
There are other scripts related to the frontend in the directory
143142
[scripts/frontend-development](https://github.com/LAION-AI/Open-Assistant/tree/main/scripts/frontend-development).
@@ -146,16 +145,15 @@ Another included tool that can be interesting during development is
146145
[storybook](https://storybook.js.org/): it allows you to test UI components
147146
without having to run the whole application.
148147

149-
### The data gathering Discord bot
148+
### The Discord bots
150149

151-
This is a Discord bot that is used to gather data for the assistant, as a
152-
complement to the web data gathering application. Its source code is in the
153-
[discord-bot](https://github.com/LAION-AI/Open-Assistant/tree/main/discord-bot)
154-
directory and it's written in Python.
150+
These are the Discord bots mentioned above. Their source code is in the
151+
[discord-bots](https://github.com/LAION-AI/Open-Assistant/tree/main/discord-bots)
152+
directory.
155153

156154
### The FastAPI backend
157155

158-
This provides an API that's used by the web frontend and the Discord bot to
156+
This provides an API that's used by the web frontend and the Discord bots to
159157
store conversation trees and their metadata. It's written in Python using
160158
FastAPI as framework and its source code is in the
161159
[backend directory](https://github.com/LAION-AI/Open-Assistant/tree/main/backend).
@@ -168,7 +166,7 @@ There's also a Redis database, called `redis` in the Dockerfile, for caching API
168166
requets.
169167

170168
In the Dockerfile, there are also two containers with development support tools
171-
for the databases: `adminer`, that can be used to inspect the Postgres
169+
for the databases: `adminer`, which can be used to inspect the Postgres
172170
databases, and `redis-insights` to inspect the Redis database.
173171

174172
Although there's some data already in the Postgres backend database, more can be
@@ -182,12 +180,13 @@ conversation tree and the work package.
182180

183181
### The inference service
184182

185-
The inference service will be the component that answers prompts when the model
186-
is ready, i.e., the assistant. It's written in Python and its source code is in
187-
the [inference](https://github.com/LAION-AI/Open-Assistant/tree/main/inference)
183+
The inference service is the component that answers prompts using a model, i.e.,
184+
it is the assistant itself. It's written in Python and its source code is in the
185+
[inference](https://github.com/LAION-AI/Open-Assistant/tree/main/inference)
188186
directory. It has a server and several workers. It also has its own Postgres
189187
database in a container called `inference-db` in the Dockerfile, and a Redis
190-
database in the `redis-inference` container.
188+
database in the `redis-inference` container. There's another container for
189+
safety called `inference-safety`.
191190

192191
The server is a FastAPI application that communicates via websockets with the
193192
workers, which are the ones that use the model to carry out the inference.
@@ -208,7 +207,9 @@ explains how to contribute a new dataset.
208207

209208
There's also a
210209
[notebooks](https://github.com/LAION-AI/Open-Assistant/tree/main/notebooks)
211-
directory with different notebooks to process the data.
210+
directory with different notebooks for data scraping and augmentation, but it's
211+
being deprecated in favor of the directory
212+
[data/datasets](https://github.com/LAION-AI/Open-Assistant/blob/main/data/datasets).
212213

213214
### The docs
214215

@@ -242,10 +243,16 @@ website directory.
242243

243244
- `inference`. It includes these containers:
244245

245-
- `inference-db`, `inference-server`, `inference-worker`, `inference-redis`
246+
- `inference-db`, `inference-server`, `inference-worker`, `inference-redis`,
247+
`inference-safety`
248+
249+
- `inference-dev`. It includes these containers:
250+
251+
- `db`, `web-db`, `backend`
246252

247253
- `observability`. It includes tools to monitor the application. It includes
248254
these containers:
255+
249256
- `prometheus`, `grafana`, `netdata`
250257

251258
Notice that you can combine profiles, for example, `ci` and `observability`.
@@ -277,12 +284,12 @@ flowchart TD
277284
infworker1((inference-worker <br> 1))
278285
infworker2((inference-worker <br> ...))
279286
infworkerN((inference-worker <br> n))
280-
infserv(("inference-server <br> (FastAPI)"))
281-
infserv --> infdb(("inference-db <br> (Postgres)"))
282-
infserv --> infredis(("inference-redis"))
287+
infserv(("inference-server <br> (FastAPI)")) --> infdb(("inference-db <br> (Postgres)"))
288+
infsafety((inference-safety))
283289
infserv --> infworker1
284290
infserv --> infworker2
285291
infserv --> infworkerN
292+
infserv --> infsafety
286293
end
287294
subgraph support[Dev support tools]
288295
adminer((adminer))
@@ -312,7 +319,7 @@ Lead, [Christoph Schumann](https://github.com/christophschuhmann), who is the
312319
Organizational Lead and a founder of [LAION](https://laion.ai/), and Huu Nguyen,
313320
from [Ontocord](https://github.com/ontocord).
314321

315-
There's a
322+
There's a [Teams page](https://open-assistant.io/team) and a
316323
[CODEOWNERS](https://github.com/LAION-AI/Open-Assistant/blob/main/CODEOWNERS)
317324
file that lists the code owners of different parts of the project. However,
318325
there are many

0 commit comments

Comments
 (0)
Please sign in to comment.