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
phienv
virtual environment in the current directory. - Install the required packages.
- Install the
phidata
package 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.bat
These 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/vectordb
for the new vector database. - Create a Class for your VectorDb that implements the
VectorDb
interface- Your Class will be in the
phi/vectordb/<your_db>/<your_db>.py
file. - The
VectorDb
interface is defined in `phi/vectordb/base - Import your
VectorDb
Class inphi/vectordb/<your_db>/__init__.py
. - Checkout the
phi/vectordb/pgvector/pgvector2
file for an example.
- Your Class will be in the
- Add a recipe for using your
VectorDb
undercookbook/<your_db>
.- Checkout
phidata/cookbook/pgvector
for an example (you do not need to add theresources.py
file).
- 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/llm
for the new LLM provider. - If the LLM provider supports the OpenAI API spec:
- Create a Class for your LLM provider that inherits the
OpenAILike
Class fromphi/llm/openai/like.py
. - Your Class will be in the
phi/llm/<your_llm>/<your_llm>.py
file. - Import your Class in the
phi/llm/<your_llm>/__init__.py
file. - Checkout the
phi/llm/together/together.py
file 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/together
for 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