Superb AI On-premise Python SDK is a comprehensive Python library that provides a simple and intuitive interface to interact with your on-premise Superb AI installation. Build powerful data management, annotation, and machine learning workflows with ease.
- ποΈ Dataset Management: Create, organize, and manage your datasets
- π Data Operations: Upload, annotate, and manipulate your data with powerful filtering
- π Advanced Filtering: Sophisticated filtering system for precise data queries
- π·οΈ Annotation Management: Handle annotations and versions seamlessly
- π Content Management: Upload and manage file content
- β‘ Activity Tracking: Monitor and manage long-running tasks
- π§ Slice Management: Organize data into logical groups
- π€ Model Tracking: Register and monitor ML model performance
- π Analytics Reports: Generate and visualize dataset analytics
Install the SDK using pip:
pip install superb-ai-onpremRequirements:
- Python 3.7 or higher
- Active Superb AI On-premise installation
β οΈ Important: The SDK will not work without this configuration file. Make sure to replace the values with your actual credentials from your Superb AI administrator.
Get up and running with Superb AI SDK in minutes:
First, set up your authentication credentials:
Option A: Config file (Recommended for local development)
# Create config directory
mkdir -p ~/.spb
# Create config file
cat > ~/.spb/onprem-config << EOF
[default]
host=https://your-superb-ai-host.com
access_key=your-access-key
access_key_secret=your-access-key-secret
EOFfrom spb_onprem import DatasetService, DataService, ModelService, ReportService
# Initialize services
dataset_service = DatasetService()
data_service = DataService()
model_service = ModelService()
report_service = ReportService()
# 1. Find existing datasets
datasets, cursor, total = dataset_service.get_datasets(length=10)
print(f"π Found {total} datasets")
if datasets:
# Use the first available dataset
dataset = datasets[0]
print(f"β
Using dataset: {dataset.name} (ID: {dataset.id})")
# 2. Get data list from the dataset
data_list, cursor, total = data_service.get_data_list(
dataset_id=dataset.id,
length=10
)
print(f"π Dataset contains {total} data items")
# 3. Display data information
for i, data in enumerate(data_list, 1):
print(f" {i}. Key: {data.key}, Type: {data.type}, ID: {data.id}")
if total > len(data_list):
print(f" ... and {total - len(data_list)} more items")
# 4. Check models in the dataset
models, _, model_count = model_service.get_models(
dataset_id=dataset.id,
length=5
)
if model_count > 0:
print(f"\nπ€ Found {model_count} models")
for model in models:
print(f" - {model.name} ({model.baseline_model})")
# 5. Check analytics reports
reports, _, report_count = report_service.get_analytics_reports(
dataset_id=dataset.id,
length=5
)
if report_count > 0:
print(f"\nπ Found {report_count} analytics reports")
for report in reports:
print(f" - {report.title}")
else:
print("β No datasets found. Please create a dataset first.")π Congratulations! You've successfully:
- β Connected to your Superb AI instance
- β Found existing datasets
- β Retrieved and displayed data information
- β Explored models and reports
Ready for more? Check out our comprehensive documentation below!
Comprehensive guides for each SDK module with detailed examples and best practices:
| Module | Purpose | Key Features | Documentation |
|---|---|---|---|
| π Datasets | Dataset lifecycle management | Create, organize, manage data collections | π Dataset Guide |
| π Data | Individual data management | CRUD operations, advanced filtering, annotations | π Data Guide |
| πͺ Slices | Data organization & filtering | Create filtered views, team collaboration | πͺ Slice Guide |
| β‘ Activities | Workflow & task management | Process automation, progress tracking | β‘ Activity Guide |
| π€ Models | ML model management | Track models, training configs, performance metrics | π€ Model Guide |
| π Reports | Analytics & visualization | Create reports, charts, dashboards | π Report Guide |
Choose your learning path based on your use case:
- Start with π Datasets - Create and organize your data collections
- Then explore π Data - Manage individual items and annotations
- Use πͺ Slices - Organize data into logical groups
- Begin with π Data - Understand data structure and filtering
- Configure β‘ Activities - Automate labeling and review workflows
- Track with π€ Models - Register and monitor model performance
- Visualize with π Reports - Generate analytics dashboards
- Setup π Datasets - Organize team projects
- Create πͺ Slices - Assign work to team members
- Implement β‘ Activities - Track progress and quality
Each module includes:
- π― Quick Start Examples - Get running immediately
- π Detailed Entity Documentation - Pydantic models with comprehensive field descriptions
- π Advanced Usage Patterns - Best practices and complex workflows
- π Cross-Module Integration - How modules work together
- β‘ Performance Tips - Optimization recommendations
π Datasets (containers)
βββ π Data (individual items)
β βββ πͺ Slices (filtered views)
β β βββ π€ Models (training configs)
β βββ β‘ Activities (processing workflows)
βββ π Reports (analytics & visualizations)
| Module | Added | Status | Description |
|---|---|---|---|
| π€ Models | v2.0 | β Stable | ML model lifecycle management and performance tracking |
| π Reports | v2.0 | β Stable | Analytics reports and visualization dashboards |
| Module | Status | Migration Path |
|---|---|---|
| InferService | π« Deprecated | Use π€ Models for model management and β‘ Activities for inference workflows |
The SDK provides specific error types for different scenarios:
from spb_onprem.exceptions import (
BadParameterError,
NotFoundError,
UnknownError
)
try:
dataset = dataset_service.get_dataset(dataset_id="non-existent-id")
except NotFoundError:
print("Dataset not found")
except BadParameterError as e:
print(f"Invalid parameter: {e}")
except UnknownError as e:
print(f"An unexpected error occurred: {e}")- Python >= 3.7
- requests >= 2.22.0
- urllib3 >= 1.21.1
- pydantic >= 1.8.0
We welcome contributions to the Superb AI On-premise SDK! Here's how you can help:
- Clone the repository:
git clone https://github.com/Superb-AI-Suite/superb-ai-onprem-python.git
cd superb-ai-onprem-python- Install development dependencies:
pip install -e ".[dev]"- Code Style: Follow PEP 8 guidelines
- Testing: Add tests for new features
- Documentation: Update docstrings and README
- Pull Requests: Use descriptive titles and include test results
When reporting issues, please include:
- SDK version (
spb_onprem.__version__) - Python version
- Error messages and stack traces
- Minimal reproduction example
- Expected vs actual behavior
- GitHub Issues: Report bugs and request features
- Documentation: Official API documentation
- Technical Support: Contact your Superb AI representative
- Custom Integration: Professional services available
- Training: SDK workshops and onboarding sessions
Common Issues:
- Authentication errors: Check config file format and credentials
- Connection issues: Verify host URL and network connectivity
- Import errors: Ensure SDK is properly installed (
pip install superb-ai-onprem) - Performance issues: Use appropriate pagination and filtering
Need immediate help? Check our FAQ section or contact support.
This project is licensed under the MIT License - see the LICENSE file for details.
π Ready to build something amazing? Start with our Quick Start Guide and explore the powerful features of Superb AI On-premise SDK!