Development environment
OpenGateLLM is composed of several services:
- API (FastAPI)
- Playground (Reflex)
- Dependencies (see dependencies)
To simplify development, we have created a make command that allows you to launch the services locally in development mode. Follow the steps below to setup your development environment.
-
Create a Python virtual environment (recommended)
-
Install the dependencies
Terminal window pip install ".[api,playground,dev,test]" -
Install the pre-commit hooks
Terminal window pre-commit install -
Launch services locally
Start services locally with the following command:
Terminal window make devThe API will be available at http://localhost:8000 and the playground at http://localhost:8501.
-
Create the first admin user
Open another terminal and create the first admin user with the following command:
Terminal window make create-adminThe default created user will be
adminas email and its passwordchangeme. The script create a role withadminpermissions that allows to access to all models with no limits. -
Setup your models
To add your models, you can refer to the documentation to setup your models.
Commit
Section titled “Commit”Please respect the following convention for your commits:
[doc|feat|fix](theme) commit object (in english)
# examplefeat(collections): collection name retrieverLinter
Section titled “Linter”The project linter is Ruff. The specific project formatting rules are in the pyproject.toml file.
Please install the pre-commit hooks to run the linter at each commit:
pre-commit installTo run the linter manually:
make lint