Skip to content

Commit 408e907

Browse files
committed
Add Docker and Codespace instructions
1 parent 4f7a481 commit 408e907

File tree

3 files changed

+39
-3
lines changed

3 files changed

+39
-3
lines changed

README.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,40 @@ cd openui/backend
2222
# You probably want to do this from a virtual environment
2323
pip install .
2424
# This must be set to use OpenAI models, find your api key here: https://platform.openai.com/api-keys
25-
export OPENAI_API_KEY=sk_XXX
25+
export OPENAI_API_KEY=xxx
2626
python -m openui
2727
```
2828

29+
### Docker
30+
31+
You can build and run the docker file from the `/backend` directory:
32+
33+
```bash
34+
docker build . -t wandb/openui --load
35+
docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui
36+
```
37+
2938
Now you can goto [http://localhost:7878](http://localhost:7878)
3039

3140
## Development
3241

33-
See the readmes in the [frontend](./frontend/README.md) and [backend](./backend/README.md) directories.
42+
A [https://github.com/wandb/openui/blob/main/.devcontainer/devcontainer.json](dev container) is configured in this repository which is the quickest way to get started.
43+
44+
### Codespace
3445

46+
Choose more options when creating a Codespace, then select **New with options...**. Select the US West region if you want a really fast boot time. You'll also want to configure your OPENAI_API_KEY secret or just set it to `xxx` if you want to try Ollama (you'll want at least 16GB of Ram).
3547

48+
![New with options...](./assets/codespace.gif)
3649

50+
Once inside the code space you can run the server in one terminal: `python -m openui --dev`. Then in a new terminal:
51+
52+
```bash
53+
cd /workspace/openui/frontend
54+
npm run dev
55+
```
56+
57+
This should open another service on port 5173, that's the service you'll want to visit. All changes to both the frontend and backend will automatically be reloaded and reflected in your browser.
58+
59+
### Resources
60+
61+
See the readmes in the [frontend](./frontend/README.md) and [backend](./backend/README.md) directories.

assets/codespace.png

122 KB
Loading

backend/README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,19 @@ pip install .
1818

1919
## Usage
2020

21+
You must set the `OPENAI_API_KEY` even if you just want to try Ollama models. Just set it to `xxx` in that case like below.
22+
23+
```bash
24+
OPENAI_API_KEY=xxx python -m openui
25+
```
26+
27+
### Docker
28+
29+
You can build and run the docker file from the `/backend` directory:
30+
2131
```bash
22-
python -m openui
32+
docker build . -t wandb/openui --load
33+
docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui
2334
```
2435

2536
## Development

0 commit comments

Comments
 (0)