Phidata is an open-source project and we welcome contributions.
Please follow the fork and pull request workflow:
- Fork the repository.
- Create a new branch for your feature.
- Add your feature or improvement.
- Send a pull request.
- We appreciate your support & input!
- Clone the repository.
- Create a virtual environment:
- For Unix, use
./scripts/create_venv.sh. - For Windows, use
.\scripts\create_venv_win.bat. - This setup will:
- Create a
phienvvirtual environment in the current directory. - Install the required packages.
- Install the
phidatapackage in editable mode.
- Create a
- For Unix, use
- Activate the virtual environment:
- On Unix:
source phienv/bin/activate - On Windows:
phienv\Scripts\activate
- On Unix:
Ensure your code meets our quality standards by running the appropriate formatting and validation script before submitting a pull request:
- For Unix:
./scripts/format.sh - For Windows:
.\scripts\format.batThese scripts will perform code formatting withruff, static type checks withmypy, and run unit tests withpytest.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/vectordbfor the new vector database. - Create a Class for your VectorDb that implements the
VectorDbinterface- Your Class will be in the
phi/vectordb/<your_db>/<your_db>.pyfile. - The
VectorDbinterface is defined in `phi/vectordb/base - Import your
VectorDbClass inphi/vectordb/<your_db>/__init__.py. - Checkout the
phi/vectordb/pgvector/pgvector2file for an example.
- Your Class will be in the
- Add a recipe for using your
VectorDbundercookbook/<your_db>.- Checkout
phidata/cookbook/pgvectorfor an example (you do not need to add theresources.pyfile).
- Checkout
- Important: Format and validate your code by running
./scripts/format.sh. - Submit a pull request.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/llmfor the new LLM provider. - If the LLM provider supports the OpenAI API spec:
- Create a Class for your LLM provider that inherits the
OpenAILikeClass fromphi/llm/openai/like.py. - Your Class will be in the
phi/llm/<your_llm>/<your_llm>.pyfile. - Import your Class in the
phi/llm/<your_llm>/__init__.pyfile. - Checkout the
phi/llm/together/together.pyfile for an example.
- Create a Class for your LLM provider that inherits the
- If the LLM provider does not support the OpenAI API spec:
- Reach out to us on Discord or open an issue to discuss the best way to integrate your LLM provider.
- Add a recipe for using your LLM provider under
cookbook/<your_llm>.- Checkout
phidata/cookbook/togetherfor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.sh. - Submit a pull request.
Message us on Discord if you have any questions or need help with credits.
This project is licensed under the terms of the MIT license