-
Install dependencies
pip install . -
Configure and export environment variables
cp .env.example .env # update variables after copy export $(cat .env | grep -v ^# | xargs)
[!NOTE] The database setup by
OPENGATELLM_DATABASE_URLenvironment variable must be the same as the database used by the API specified inOPENGATELLM_URLenvironment variable. -
Lauch database dependencies
docker compose --file compose.example.yml up --wait --detach postgres elasticsearch
-
Instantiate database
alembic -c opengaterag/api/alembic.ini upgrade head
-
Run API locally
uvicorn opengaterag.api.app:app --reload
-
Install dependencies
pip install ".[test]" -
Run tests
pytest opengaterag/api/tests/unit/
-
Run migrations
alembic -c opengaterag/api/alembic.ini upgrade head
-
Create a new migration
alembic -c opengaterag/api/alembic.ini revision --autogenerate -m "Add new column to users table"