Python SDK for Superb AI On-premise
Project description
๐ Superb AI On-premise Python SDK
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.
๐ Key Features
- ๐๏ธ 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
๐ง Installation
Step 1: Install the SDK
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.
๐ Quick Start
Get up and running with Superb AI SDK in minutes:
Step 1: Authentication Setup
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
Step 2: Your First Workflow
from 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!
๐ Module Documentation
๐๏ธ Core Modules
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 |
๐ฏ Getting Started Paths
Choose your learning path based on your use case:
๐ Data Management Workflow
- Start with ๐ Datasets - Create and organize your data collections
- Then explore ๐ Data - Manage individual items and annotations
- Use ๐ช Slices - Organize data into logical groups
๐ ML Pipeline Integration
- 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
๐ฅ Team Collaboration
- Setup ๐ Datasets - Organize team projects
- Create ๐ช Slices - Assign work to team members
- Implement โก Activities - Track progress and quality
๐ง Advanced Features
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
๐ Module Relationships
๐ Datasets (containers)
โโโ ๐ Data (individual items)
โ โโโ ๐ช Slices (filtered views)
โ โ โโโ ๐ค Models (training configs)
โ โโโ โก Activities (processing workflows)
โโโ ๐ Reports (analytics & visualizations)
๐ New Modules (v2.0+)
| Module | Added | Status | Description |
|---|---|---|---|
| ๐ค Models | v2.0 | โ Stable | ML model lifecycle management and performance tracking |
| ๐ Reports | v2.0 | โ Stable | Analytics reports and visualization dashboards |
โ ๏ธ Deprecated Modules
| Module | Status | Migration Path |
|---|---|---|
| InferService | ๐ซ Deprecated | Use ๐ค Models for model management and โก Activities for inference workflows |
โ ๏ธ Error Handling
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}")
๐งช Requirements
- Python >= 3.7
- requests >= 2.22.0
- urllib3 >= 1.21.1
- pydantic >= 1.8.0
๐ค Contributing
We welcome contributions to the Superb AI On-premise SDK! Here's how you can help:
Development Setup
- 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]"
Contribution Guidelines
- 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
Reporting Issues
When reporting issues, please include:
- SDK version (
spb_onprem.__version__) - Python version
- Error messages and stack traces
- Minimal reproduction example
- Expected vs actual behavior
๐ Support
Community Support
- GitHub Issues: Report bugs and request features
- Documentation: Official API documentation
Enterprise Support
- Technical Support: Contact your Superb AI representative
- Custom Integration: Professional services available
- Training: SDK workshops and onboarding sessions
Quick Help
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.
๐ License
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!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file superb_ai_onprem-1.1.0.tar.gz.
File metadata
- Download URL: superb_ai_onprem-1.1.0.tar.gz
- Upload date:
- Size: 99.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
91140c6ea30ea2092ab29dff039804167d04ebd86cb429e37d1ad1f2e8fc1251
|
|
| MD5 |
b3dd19d45482413b0eccea52c524ac1d
|
|
| BLAKE2b-256 |
21b298016d8c92e8710d00125d55726e8115c87303a8385cfa7b24aa3af34ee7
|
File details
Details for the file superb_ai_onprem-1.1.0-py3-none-any.whl.
File metadata
- Download URL: superb_ai_onprem-1.1.0-py3-none-any.whl
- Upload date:
- Size: 109.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7c73c7980542dc1b418a60463bcb3768e8715619a730ec7be7241c54a6ed50b6
|
|
| MD5 |
705edcd36d66f322b3a16a69dde287d8
|
|
| BLAKE2b-256 |
c5246cc021d35fe743755ba35de37ea9b9246739698a854886094efebfe6107b
|