Skip to content

Latest commit

 

History

History
91 lines (50 loc) · 2.67 KB

CONTRIBUTING.md

File metadata and controls

91 lines (50 loc) · 2.67 KB

💡 Contributing to LlamaIndex

⚠️ NOTE: We are rebranding GPT Index as LlamaIndex! 2/19/2023: We are still in the middle of the transition. If you are interested in contributing to LlamaIndex, make sure to follow the below steps. For testing, please do import gpt_index instead of import llama_index.

Interested in contributing to LlamaIndex? Here's how to get started!

Contributions that we're looking for:

  • Bug fixes
  • New features

All future tasks are tracked in Github Issues Page. Please feel free to open an issue and/or assign an issue to yourself.

Also, join our Discord for discussions: https://discord.gg/dGcwcsnxhU.

Environment Setup

LlamaIndex is a Python package. We've tested primarily with Python versions >= 3.8. Here's a quick and dirty guide to getting your environment setup.

First, create a fork of LlamaIndex, by clicking the "Fork" button on the LlamaIndex Github page. Following these steps for more details on how to fork the repo and clone the forked repo.

Then, create a new Python virtual environment. The command below creates an environment in .venv, and activates it:

python -m venv .venv
source .venv/bin/activate

Install the required dependencies (this will also install gpt-index through pip install -e . so that you can start developing on it):

pip install -r requirements.txt

Now you should be set!

Validating your Change

Let's make sure to format/lint our change. For bigger changes, let's also make sure to test it and perhaps create an example notebook.

Formatting/Linting

You can format and lint your changes with the following commands in the root directory:

make format; make lint

We run an assortment of linters: black, isort, mypy, flake8.

Testing

For bigger changes, you'll want to create a unit test. Our tests are in the tests folder. We use pytest for unit testing. To run all unit tests, run the following in the root dir:

pytest tests

Creating an Example Notebook

For changes that involve entirely new features, it may be worth adding an example Jupyter notebook to showcase this feature.

Example notebooks can be found in this folder: https://github.com/jerryjliu/gpt_index/tree/main/examples.

Creating a pull request

See these instructions to open a pull request against the main LlamaIndex repo.