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.
Workspace Profile Structure
Section titled “Workspace Profile Structure”| Field | Description | Key File |
|---|---|---|
slug | Unique workspace identifier | workspace/profiles.ts |
name | Human-readable workspace name | workspace/profiles.ts |
strategyId | Default orchestration strategy | strategy/registry-db.ts |
providers | Configured provider connections | providers/registry-db.ts |
budget | Monthly/weekly budget cap and alert threshold | src/features/workspaces/limits/limitsModel.ts |
runtimeProfile | Timeout, retry, and fallback preferences | src/features/workspaces/runtime/workspaceRuntimeModel.ts |
restrictions | Provider/domain/country restrictions | src/features/governance/providers/restrictionsModel.ts |
capabilities | Enabled features (replay, learning, benchmarks) | workspace/domainTopology.ts |
health | Workspace health score and diagnostics | src/features/workspaces/health/healthModel.ts |
Profile Lifecycle
Section titled “Profile Lifecycle”[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.tsDomain Topology
Section titled “Domain Topology”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
Budget and Limits
Section titled “Budget and Limits”Every workspace has configurable limits tracked in src/features/workspaces/limits/limitsModel.ts:
| Limit | Description |
|---|---|
| Monthly Budget | Hard ceiling on spend per calendar month |
| Weekly Alert | Soft threshold that triggers notifications |
| Daily Quota | Maximum number of requests per day |
| Trace Retention | How long execution traces are kept (7-365 days) |
| Model Tier | Which model tiers are allowed (free, cheap, premium, all) |
Runtime Profiles
Section titled “Runtime Profiles”Runtime profiles (src/features/workspaces/runtime/workspaceRuntimeModel.ts) define execution parameters:
| Parameter | Options |
|---|---|
| Timeout Profile | Fast (5s), Standard (30s), Deep (120s), Custom |
| Retry Policy | None, 1 retry, 3 retries, exponential backoff |
| Fallback Mode | Strict (same-tier), Relaxed (any available), None |
| Streaming | Always, Never, Auto-detect |
| Batch Size | 1, 5, 10, 50 (for batch API operations) |
Health Monitoring
Section titled “Health Monitoring”Workspace health is continuously monitored (src/features/workspaces/health/healthModel.ts):
| Dimension | Metric |
|---|---|
| Provider Health | Average uptime of configured providers |
| Cost Health | Budget consumed vs. budget remaining |
| Quality Health | Average execution quality score |
| Replay Health | Trace completeness and comparison coverage |
| Overall Score | Composite 0-100 health index |
File Reference
Section titled “File Reference”| File | What It Does |
|---|---|
workspace/profiles.ts | Core profile CRUD and validation |
workspace/domainTopology.ts | Domain classification, regulatory flags, capability mapping |
onboarding/workspaceProfileCatalog.ts | Pre-built workspace templates (startup, enterprise, solo dev) |
strategy/registry-db.ts | Database layer for workspace-strategy associations |
src/features/workspaces/health/healthModel.ts | Health computation and diagnostics |
src/features/workspaces/limits/limitsModel.ts | Budget, quota, and retention management |
src/features/workspaces/runtime/workspaceRuntimeModel.ts | Runtime parameter profiles |
src/features/workspaces/overview/workspaceOverviewModel.ts | Aggregated workspace dashboard data |
Integration
Section titled “Integration”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