Model Capability Profiles
Capability profile abstraction that keeps workflows model-agnostic while optimizing behavior for gpt-5.2, gpt-5.3, claude-opus, and claude-sonnet.
Context
Lex targets multiple model families with different context windows, output behavior, and reasoning controls. Without an explicit profile layer, model-specific behavior leaked into prompts and workflow logic, causing prompt shape divergence, inconsistent long workflow behavior, and hard-to-test capability assumptions.
Core Decisions
1. Fixed Profile Set with Deterministic Mapping
Five profiles with deterministic identity matching:
2. Capability Matrix Governs Prompt Strategy
Each profile defines support and limits for:
- Effort hints
- Compaction strategy
- Large context handling
- Large output handling
Workflows remain neutral; profile logic injects model-specific guidance at runtime.
3. Fallback Behavior Prioritizes Safety
Unknown models map to baseline, which uses conservative defaults: no advanced effort assumptions, explicit manual compaction guidance, and tighter context/output expectations.
4. Profile Logic Is Centralized
Model behavior tuning lives in instructions and tests, not scattered in workflow YAML. This prevents per-workflow drift.
5. Capability Coverage Is Test-Gated
Regression tests verify that targeted model identifiers resolve to expected profiles and behavior flags.
Profile Resolution Flow
Runtime Model Identity
The current model identifier is detected at execution time.
Profile Mapper
Deterministic mapping resolves the model to one of five profiles.
Prompt Builder
Profile-specific behavior controls are injected into the prompt strategy.
Workflow Step Execution
The step executes with model-appropriate effort, context, and compaction settings.