🛠️ Development
📥 Install for development
Clone the repository and go to the project folder:
For development we use Hatch, it will automatically handle virtual environments, and make sure all dependencies are installed when you run a script in the project. Install it with pipx
or pip
:
Optionally you can enable hatch
terminal completion
See the official documentation for more details. For ZSH you can run these commands:
🧑💻 Development workflow
Start a conversational chat web service, without vectorstore:
Start a documents-based question answering service, using a vectorstore:
Use the CLI to build a vectorstore at a specific path:
✅ Run the tests
Make sure the existing tests still work by running the test suite, mypy, and linting checks. .
Run the tests locally:
Run only a specific test, and display all logs:
Run the tests on the different versions of python available on your machine
Not required as it is done by the GitHub Actions workflow, but can be useful for debugging:
📖 Generate the docs
The documentation (this website) is automatically generated and published by a GitHub Actions workflow from the markdown files in the docs/
folder, and python docstring
comments.
To check the documentation website locally, serve it with:
♻️ Reset the environment
In case you are facing issues with dependencies not updating properly you can easily reset the virtual environment with:
Manually trigger the installation of dependencies in a local virtual environment (done automatically when you run any script):
Enter a new shell with the environment activated:
🏷️ Publish a new release
The deployment of new releases is done automatically by a GitHub Actions workflow when a new release is created on GitHub. To release a new version:
-
Make sure the
PYPI_TOKEN
secret has been defined in the GitHub repository (in Settings > Secrets > Actions). You can get an API token from PyPI at pypi.org/manage/account. -
Increment the
version
number in thesrc/libre_chat/__init__.py
file: -
Commit, push, and create a new release on GitHub, which will automatically trigger a workflow to publish the new release to PyPI.