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
- π€ Export & Import: Flexible data export and content management
- β‘ Activity Tracking: Monitor and manage long-running tasks
- π§ Slice Management: Organize data into logical groups
Install the SDK using pip:
pip install superb-ai-onprem
Requirements:
- 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
EOF
from spb_onprem import DatasetService, DataService
# Initialize services
dataset_service = DatasetService()
data_service = DataService()
# 1. Find existing datasets
datasets, cursor, total = dataset_service.get_dataset_list(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")
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
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 |
π€ Exports | Data & annotation export | Multi-format export (COCO, YOLO, Custom) | π€ Export 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
- Setup οΏ½ Exports - Export to ML training formats
- 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)
β βββ β‘ Activities (processing workflows)
βββ π€ Exports (output formats)
Module | Status | Migration Path |
---|---|---|
ModelService | π« Deprecated | Use external ML frameworks |
PredictionService | π« Deprecated | Use π Data prediction entities |
InferService | π« Deprecated | Use β‘ 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!