Skip to content

Workspace Profiles

The Workspace Profile Layer maintains the identity and preferences of every workspace using Layerr. A workspace profile holds provider configs, budget constraints, strategy preferences, and runtime policies, everything that makes Layerr behave differently for your React project versus your Python backend.

FieldDescriptionKey File
slugUnique workspace identifierworkspace/profiles.ts
nameHuman-readable workspace nameworkspace/profiles.ts
strategyIdDefault orchestration strategystrategy/registry-db.ts
providersConfigured provider connectionsproviders/registry-db.ts
budgetMonthly/weekly budget cap and alert thresholdsrc/features/workspaces/limits/limitsModel.ts
runtimeProfileTimeout, retry, and fallback preferencessrc/features/workspaces/runtime/workspaceRuntimeModel.ts
restrictionsProvider/domain/country restrictionssrc/features/governance/providers/restrictionsModel.ts
capabilitiesEnabled features (replay, learning, benchmarks)workspace/domainTopology.ts
healthWorkspace health score and diagnosticssrc/features/workspaces/health/healthModel.ts
[1] Create Profile --> Onboarding or API call
|
v
[2] Select Strategy --> User picks (cost/speed/quality/balanced)
|
v
[3] Add Providers --> Connect OpenAI, Anthropic, Ollama, etc.
|
v
[4] Configure Budget --> Set monthly cap, alert threshold
|
v
[5] Set Restrictions --> Block countries, limit providers
|
v
[6] Runtime Health --> Continuously monitored via healthModel.ts

Workspaces have a Domain Topology, a map of what the workspace does and who it serves. This is used for:

  • Regulatory compliance: EU workspaces get GDPR-flagged providers
  • Cost optimization: Startup workspaces get aggressive fallback routing
  • Capability routing: Enterprise workspaces get benchmarked strategies

Key file: workspace/domainTopology.ts

Every workspace has configurable limits tracked in src/features/workspaces/limits/limitsModel.ts:

LimitDescription
Monthly BudgetHard ceiling on spend per calendar month
Weekly AlertSoft threshold that triggers notifications
Daily QuotaMaximum number of requests per day
Trace RetentionHow long execution traces are kept (7-365 days)
Model TierWhich model tiers are allowed (free, cheap, premium, all)

Runtime profiles (src/features/workspaces/runtime/workspaceRuntimeModel.ts) define execution parameters:

ParameterOptions
Timeout ProfileFast (5s), Standard (30s), Deep (120s), Custom
Retry PolicyNone, 1 retry, 3 retries, exponential backoff
Fallback ModeStrict (same-tier), Relaxed (any available), None
StreamingAlways, Never, Auto-detect
Batch Size1, 5, 10, 50 (for batch API operations)

Workspace health is continuously monitored (src/features/workspaces/health/healthModel.ts):

DimensionMetric
Provider HealthAverage uptime of configured providers
Cost HealthBudget consumed vs. budget remaining
Quality HealthAverage execution quality score
Replay HealthTrace completeness and comparison coverage
Overall ScoreComposite 0-100 health index
FileWhat It Does
workspace/profiles.tsCore profile CRUD and validation
workspace/domainTopology.tsDomain classification, regulatory flags, capability mapping
onboarding/workspaceProfileCatalog.tsPre-built workspace templates (startup, enterprise, solo dev)
strategy/registry-db.tsDatabase layer for workspace-strategy associations
src/features/workspaces/health/healthModel.tsHealth computation and diagnostics
src/features/workspaces/limits/limitsModel.tsBudget, quota, and retention management
src/features/workspaces/runtime/workspaceRuntimeModel.tsRuntime parameter profiles
src/features/workspaces/overview/workspaceOverviewModel.tsAggregated workspace dashboard data

Workspace profiles are read by nearly every layer:

  • Strategy Engine: reads preferred strategy and capability flags
  • Economics: reads budget constraints for cost-aware routing
  • Security: reads allowed providers and geographic restrictions
  • Execution: reads timeout and retry profiles