Workspace and Projects

This guide covers how to organize your models using workspaces and projects in the ViewAI platform.

Overview

ViewAI uses a hierarchical organization system:

  • Workspaces: Top-level containers for organizing work by team, environment, or organization

  • Projects: Sub-containers within workspaces for grouping related models

This structure helps you:

  • Separate development, staging, and production environments

  • Organize models by business domain or use case

  • Control access and permissions

  • Track model lineage and relationships

Quick Start

quickstart.py
from viewai_client import ViewAIClient

# Initialize client
client = ViewAIClient(api_key="your-api-key")

# List workspaces
workspaces = client.list_accessible_workspaces()
for ws in workspaces:
    print(f"{ws.workspace_name}: {ws.workspace_id}")

# Get default workspace
workspace = client.retrieve_default_workspace()

# Set current workspace
client.set_current_workspace(workspace)

# List projects in workspace
projects = client.list_accessible_projects(workspace_id=workspace.workspace_id)
for proj in projects:
    print(f"{proj.project_name}: {proj.project_id}")

Understanding Workspaces

What is a Workspace?

A workspace is a top-level container that provides:

  • Isolation: Separate environments for different purposes

  • Access Control: Team-based permissions and sharing

  • Resource Organization: Group related projects and models

  • Billing: Track usage and costs by workspace

Common Workspace Patterns

Workspace Attributes

Understanding Projects

What is a Project?

A project is a sub-container within a workspace that provides:

  • Model Grouping: Organize related models together

  • Use Case Tracking: Group models by business problem

  • Version Management: Track model iterations

  • Collaboration: Share project context across team members

Common Project Patterns

Project Attributes

Managing Workspaces

Listing Workspaces

Getting Default Workspace

Finding Workspaces by Name

Finding Workspaces by ID

Checking Workspace Existence

Counting Workspaces

Workspace Discovery Pattern

Managing Projects

Listing Projects

Finding Projects by Name

Finding Projects by ID

Checking Project Existence

Counting Projects

Searching Projects

Project Discovery Pattern

Context Management

Setting Current Workspace

Set a workspace as the current context for operations:

Setting Current Project

Set a project as the current context:

Context Initialization

Context Switching Pattern

Organizing Models

Training Models in Workspace

Train models within a specific workspace:

Training Models in Project

Train models within a specific project:

Deploying Models in Workspace

Deploy models within a specific workspace:

Deploying Models in Project

Deploy models within a specific project:

Multi-Environment Deployment

Deploy the same model across multiple environments:

Project-Based Model Organization

Organize models by project:

Best Practices

1

Use Consistent Naming Conventions

Use clear, consistent names for workspaces and projects.

2

Set Context Early

Set workspace and project context at the start of your script so subsequent operations use them by default.

3

Validate Workspace/Project Existence

Always validate existence before using to avoid runtime errors.

4

Organize by Environment

Use workspace-based environment separation and environment-specific settings.

5

Use Workspace Health Checks

Implement checks to verify workspace accessibility and basic health before operations.

6

Implement Access Patterns

Create reusable patterns (e.g., caching) for workspace and project retrieval.

7

Document Your Organization Structure

Maintain documentation describing workspace and project roles and scope.

See Also

  • Training Models - Train models in workspaces/projects

  • Model Deployment - Deploy models to workspaces/projects

  • Getting Started - Basic setup and configuration

  • API Reference - Workspace manager API

Was this helpful?