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
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./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/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/pgvectorfile for an example.
- Your Class will be in the
- Add a recipe for using your
VectorDbundercookbook/vectordb/<your_db>.- Checkout
phidata/cookbook/vectordb/pgvectorfor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./scripts/validate.sh. - Submit a pull request.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/modelfor the new Model provider. - If the Model provider supports the OpenAI API spec:
- Create a Class for your LLM provider that inherits the
OpenAILikeClass fromphi/model/openai/like.py. - Your Class will be in the
phi/model/<your_model>/<your_model>.pyfile. - Import your Class in the
phi/model/<your_model>/__init__.pyfile. - Checkout the
phi/model/xai/xai.pyfile 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.pyorphi/model/cohere/chat.pyfor inspiration.
- Add a recipe for using your Model provider under
cookbook/providers/<your_model>.- Checkout
phidata/cookbook/provider/claudefor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./scripts/validate.sh. - Submit a pull request.
- Setup your local environment by following the Development setup.
- Create a new directory under
phi/toolsfor the new Tool. - Create a Class for your Tool that inherits the
ToolkitClass 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.pyfile for an example. - If your tool requires an API key, checkout the
phi/tools/serpapi_tools.pyas well.
- Your Class will be in
- Add a recipe for using your Tool under
cookbook/tools/<your_tool>.- Checkout
phidata/cookbook/tools/youtube_toolsfor an example.
- Checkout
- Important: Format and validate your code by running
./scripts/format.shand./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