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.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
./scripts/validate.sh
- For Windows:
.\scripts\format.bat
.\scripts\validate.bat
These scripts will perform code formatting with ruff
, static type checks with mypy
, and run unit tests with pytest
.
- 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/pgvector
file for an example.
- Your Class will be in the
- Add a recipe for using your
VectorDb
undercookbook/vectordb/<your_db>
.- Checkout
phidata/cookbook/vectordb/pgvector
for an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.sh
and./scripts/validate.sh
. - Submit a pull request.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/model
for the new Model provider. - If the Model provider supports the OpenAI API spec:
- Create a Class for your LLM provider that inherits the
OpenAILike
Class fromphi/model/openai/like.py
. - Your Class will be in the
phi/model/<your_model>/<your_model>.py
file. - Import your Class in the
phi/model/<your_model>/__init__.py
file. - Checkout the
phi/model/xai/xai.py
file for an example.
- Create a Class for your LLM provider that inherits the
- If the Model 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.
- Checkout
phi/model/anthropic/claude.py
orphi/model/cohere/chat.py
for inspiration.
- Add a recipe for using your Model provider under
cookbook/providers/<your_model>
.- Checkout
phidata/cookbook/provider/claude
for an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.sh
and./scripts/validate.sh
. - Submit a pull request.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/tools
for the new Tool. - Create a Class for your Tool that inherits the
Toolkit
Class fromphi/tools/toolkit/.py
.- Your Class will be in
phi/tools/<your_tool>.py
. - Make sure to register all functions in your class via a flag.
- Checkout the
phi/tools/youtube_tools.py
file for an example. - If your tool requires an API key, checkout the
phi/tools/serpapi_tools.py
as well.
- Your Class will be in
- Add a recipe for using your Tool under
cookbook/tools/<your_tool>
.- Checkout
phidata/cookbook/tools/youtube_tools
for an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.sh
and./scripts/validate.sh
. - Submit a pull request.
Message us on Discord or post on Discourse if you have any questions or need help with credits.
This project is licensed under the terms of the MPL-2.0 license