A backend service for generating HTML components with AI
Clone this repo, then install using pip
. You'll probably want to create a virtual env.
git clone https://github.com/wandb/openui
cd openui/backend
pip install .
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.
OPENAI_API_KEY=xxx python -m openui
You can build and run the docker file from the /backend
directory:
docker build . -t wandb/openui --load
docker run -p 7878:7878 -e OPENAI_API_KEY wandb/openui
First be sure to install the package as editable, then passing --dev
as an argument will live reload any local changes.
pip install -e .
python -m openui --dev
Now install the dependencies and test dependencies:
pip install -e '.[test]'
To run the tests:
pytest
The eval folder contains scripts for evaluating the performance of a model. It automates generating UI, taking screenshots of the UI, then asking gpt-4-vision-preview
to rate the elements. More details about the eval pipeline coming soon...
Create a service account with the appropriate permissions and authenticate with:
gcloud auth application-default login --impersonate-service-account ${GCLOUD_SERVICE_ACCOUNT}@${GCLOUD_PROJECT}.iam.gserviceaccount.com