Developing a Plugin
Prerequisites
Before developing a plugin, ensure you understand:
- What is a Plugin? — High-level overview of plugin concepts and capabilities
- Plugin Structure — How plugins are organized and what DashAI requires
Setup Your Development Environment
To create a plugin, you need access to DashAI's Python classes. There are two approaches:
Option 1: DashAI as an Installed Library
Install DashAI as a package in your Python virtual environment:
pip install dashai
Note: This approach is simpler but limits your ability to test the plugin interactively within DashAI.
Option 2: Clone the Repository (Recommended)
Clone the DashAI repository for full development and testing capabilities:
git clone https://github.com/DashAISoftware/DashAI.git
cd DashAI
Create a plugins folder in the repository root for your plugin development:
DashAI/
├── DashAI/
├── plugins/ ← Create this folder
├── tests/
├── ...
This approach lets you test your plugin in real-time as you develop.
Step 1: Identify What You Want to Build
Plugins can extend DashAI with:
- Machine Learning Models (
TabularClassificationModel,RegressionModel,TextGenerationModel, etc.) - Data Loaders (support for additional dataset formats)
- Data Converters (preprocessing, feature engineering, transformations)
- Explorers (data visualization and analysis tools)
- Explainers (model interpretability tools)
- Custom Tasks (entirely new ML problem types)
- Custom Metrics (evaluation metrics)
To ensure compatibility, your plugin classes must extend the appropriate DashAI base class:
# Example: Creating a tabular classification model
from DashAI.back.models.tabular_classification_model import TabularClassificationModel
class MyCustomModel(TabularClassificationModel):
def train(self, X, y):
# Your training logic
pass
Step 2: Implement Your Plugin
- Create the plugin folder inside the
pluginsdirectory (if using Option 2 above) - Write your Python classes extending appropriate DashAI base classes
- Create any required JSON configuration files
- Add the
pyproject.tomlwith proper entry points (see Plugin Structure) - Write a README describing your plugin
Recommendations
Review Existing Plugins
Study working examples to understand best practices:
- Real-world example:
dashai-phi-model-packageadds Microsoft Phi models - Community plugins: pypi.org/search/?q=dashai
Test Your Plugin During Development
- Create the Python and JSON files locally (Option 2: clone repository)
- Place them in the
/pluginsfolder - Start DashAI and verify your components appear and work correctly
- Iterate until you're confident in the implementation
Check for Library Conflicts
After installing new dependencies, verify no package conflicts exist:
pip check
No conflicts:
No broken requirements found.
With conflicts:
fastapi 0.106.0 has requirement starlette<0.28.0,>=0.27.0, but you have starlette 0.20.0.
Resolve any conflicts before publishing your plugin.
It is important that when installing a new library for a plugin or package, it must be included among the dependencies of the plugin or package.
-
Use prints in the flow of the added components
Including prints in the flow of the component you created can be very useful to verify the proper functioning of the component you have created in the software.