Skip to main content

Module profiles

Module profiles 

Source
Expand description

§Context Profiles

Declarative, version-controlled context strategies (“Context as Code”).

Profiles configure how lean-ctx processes content for different scenarios: exploration, bugfixing, hotfixes, CI debugging, code review, etc.

§Resolution Order

  1. LEAN_CTX_PROFILE env var
  2. .lean-ctx/profiles/<name>.toml (project-local)
  3. ~/.lean-ctx/profiles/<name>.toml (global)
  4. Built-in defaults (compiled into the binary)

§Inheritance

Profiles can inherit from other profiles via inherits = "parent". Child values override parent values; unset fields fall through.

Structs§

BudgetConfig
Token and cost budget limits.
CompressionConfig
Compression strategy configuration.
DegradationConfig
Budget/SLO degradation policy configuration.
LayoutConfig
Layout (attention-aware reorder) configuration.
PipelineConfig
Pipeline layer activation per profile.
Profile
A complete context profile definition.
ProfileAutonomy
Autonomy overrides per profile.
ProfileInfo
Information about an available profile.
ProfileMeta
Profile identity and inheritance.
ReadConfig
Read behavior configuration.
RoutingConfig
Routing policy overrides (intent → model tier → read mode/budgets).
TranslationConfig
Translation (tokenizer-aware) configuration.

Enums§

ProfileSource
Where a profile was loaded from.

Functions§

active_profile
Loads the currently active profile.
active_profile_name
Returns the currently active profile name from env or default.
builtin_profiles
Returns all built-in profile definitions.
format_as_toml
Formats a profile as TOML for display or file creation.
list_profiles
Lists all available profile names (built-in + on-disk).
load_profile
Loads a profile by name with full resolution:
set_active_profile
Sets the active profile for the current process by updating LEAN_CTX_PROFILE.