Deployment
Overview
Quick Start
from viewai_client import ViewAIClient
from sklearn.ensemble import RandomForestClassifier
import pandas as pd
# Train your model
model = RandomForestClassifier()
model.fit(X_train, y_train)
# Initialize ViewAI client
client = ViewAIClient(api_key="your-api-key")
workspace = client.retrieve_default_workspace()
# Create deployable model
deployable = client.create_deployable_model(
model=model,
dataset=train_df,
target_column="target",
model_name="My Classifier",
workspace=workspace
)
# Deploy to ViewAI
dashboard_id = deployable.deploy()
print(f"Model deployed: {dashboard_id}")Deployment Workflow
Complete Deployment Example
Model Serialization
ONNX Format (Recommended)
Pickle Format (Legacy)
Supported Model Types
Deploying Pipelines
Schema Management
Automatic Schema Generation
Using ModelSchemaManager
Customizing Schema Fields
Update Categorical Fields
Update Numerical Ranges
Update Field Types
Schema Validation
Schema Preview and Export
Deploying Models
Basic Deployment
Deployment with Project Context
Deployment Progress
Handling Deployment Failures
Deployment Validation
Testing Deployed Models
Automated Validation Pipeline
Comparing Model Versions
Production Patterns
Versioned Model Deployment
Blue-Green Deployment
Deployment with Rollback
A/B Testing Deployment
Troubleshooting
ONNX Conversion Errors
Schema Errors
Upload Failures
See Also
Was this helpful?