Model Profile Base Prompts & Flavors
Status: Intent preserved; separate bundle architecture superseded. The implementation contract now lives in Document Mode Editor — Model-selected base prompts and flavor overlays. This page keeps the product idea and its boundaries discoverable without maintaining a competing schema/runtime plan.
The product problem
Different models often need different prompt engineering, while the creative choices layered over that engineering are reusable:
- Claude, Qwen, DeepSeek, and other families may need different always-on instruction structure.
- A creator may want optional choices such as lyrical prose, concise replies, or dice-facing narration regardless of which supported model wins.
- Copying the complete creative prompt into a separate mode for every model mixes those concerns and makes updates drift.
Model Profiles are already the reusable “model pattern → mode + recommended parameters” layer. They should compose these concerns rather than introduce another Bundle entity.
Canonical terminology
Base prompt
A Base prompt is the ordinary Mode selected by an automatic winning Model Profile Entry or a deliberately selected compatible Entry.
- It is always active when that Entry wins.
- It owns identity, required mechanics, provider placement, roles, Mature/NSFW behavior, merge, enhance, and summarization behavior.
- Model-specific instructions belong here.
- It may use Document or Advanced authoring and legacy or inline-enabled rows.
- The existing DB/API field remains
model_profile_entries.mode_id; Base prompt is the clearer creator-facing label.
This is a relational role, not a new Mode kind.
Flavor overlay
A Flavor is one optional, profile-owned, keyless System prompt fragment.
- It adds style, tone, or genuinely optional rules.
- It must work with every Base prompt in that profile.
- It is user-toggleable in Web Classic and may have a Profile default, order, description, and named exclusivity group; V1 caps a Profile at 12 active Flavors, 4,000 characters each and 20,000 active Flavor characters total.
- It does not own identity, required mechanics, safety/policy, mode-level settings, or generation parameters.
- If the content needs multiple roles/rows or mode-level configuration, it is another Base-prompt variant—not a Flavor.
Flavor meaning is contextual link/group state, not an intrinsic sub_prompt flag. Its V1 content row is exclusive to the Profile aggregate. Importing authorized keyless System v0/v1 text creates a private clone; imported v0 shows a Legacy notice/palette gate and keeps literal text plus final {{char}}/{{user}} substitution until an explicit staged inline-token upgrade. New Flavors use expansion v1, so old text behavior and new inline variables coexist without a cross-parent prompt leak.
Fallback
Fallback is separate from Base. The package layer obeys the package’s explicit resolver policy: policy 0 preserves shipped exact → SQL-pattern substring behavior with no wildcard, while policy 1 uses exact → longest literal substring → *. Initial resolution can then use the read-only legacy package fallback → selected-character default Mode → built-in DefaultSections. On later policy-0 re-resolution, the shipped null behavior retains a prior valid automatic Base as Base-only policy0_retained_base; policy 1’s discriminated valid-null instead clears through the outer fallback chain.
If no Entry from a profile wins, that profile contributes no Flavors. Under policy 1, a creator adds a * Entry when they want catch-all Base + Flavor behavior; policy-0 packages must explicitly opt into that corrected resolver first. There is no profile base_mode_id fallback.
Canonical composition
Only the exact automatic winner or a deliberate compatible manual_profile_entry contributes its Profile Flavors. Two profiles may point to the same Base Mode while producing different effective plans. Policy-0 retained Base, manual Mode, fallback, legacy-unprovenanced, Direct/Discord, and Hybrid plans are Base-only in V1.
The assembly order is fixed:
- Resolve the Base first: a zero-row Base still expands to all existing
DefaultSections. - Base Mature/NSFW prelude and contiguous leading System rows.
- Enabled Flavor rows in effective order (profile order for a new plan, snapshotted order for an existing conversation).
- Remaining Base rows in unchanged local order.
- One journal fallback if neither the resolved Base nor enabled Flavors declares journal.
- Existing name substitution and Base Mode merge behavior.
Flavors are structurally layered rows—not recursively expanded {{flavor}} text. Insertion before the first non-System Base row prevents a late System Flavor in Advanced multi-role plans. Composite ordinals preserve Base/Flavor local order without a second global raw-sort pass. The Document Base remains exactly one mode-linked row because Flavor links live outside prompt_mode_sub_prompt_links.
Existing profiles have zero Flavor links and therefore assemble exactly as before.
Canonical storage direction
The canonical plan extends Model Profiles with contextual relations:
model_profile_flavor_groupsowns stable group identity/label/order;model_profile_flavorsowns display metadata/default/order/classic_primarystage and an exclusive keyless System content row.package_model_profile_flavor_overridescan hide a Flavor or change its initial default for one package; it cannot lock the Flavor on or mutate the shared profile.- On each Profile’s first Web Classic activation, a conversation↔Profile snapshot header is stored even for an empty/all-hidden roster, followed by complete then-available on/off child states plus default/order/stage/group snapshots and the narrow effective-roster fingerprint. Later additions/unhides/default/order/group edits do not change it; current hide/delete suppresses a link, and restore can revive only a previously snapshotted link.
- Closed automatic/policy-0-retained/manual/legacy/fallback/Sandbox provenance, governing-vs-selected Profile, generation status, recommendation-setting provenance, and a selection version are stored. Turn acceptance freezes one prompt + concrete preset/provider/model/Generation execution object with separate composition/execution fingerprints, so the UI/runtime never guesses an Entry from a duplicated Mode id, trusts a stale cached hash, or resolves Base and model at different instants.
Do not add the old proposal’s:
is_bundleflag;- new
mode_bundlesentity family; model_profiles.base_mode_id; orsub_prompts.is_flavor/default_enabledcolumns.
Modes retain N:M sub-prompt reuse. V1 Flavor rows are deliberately exclusive because sub-prompts have no independent entity-permission surface; copying authorized source text is explicit and safe, while defaults and meaning still belong on the Profile link/group.
Creator and user experience
Model Profile editor
- Entries show Base prompt — always-on instructions optimized for this model.
- A profile-level Flavors panel authors/import-clones up to 12 optional one-document System fragments plus named groups, with one Profile Save/Cancel pair.
- Resolution preview chooses an Entry/model and enabled Flavor combination, then displays separately labeled Base and Flavor sections.
- Identity/provider/role/stage/settings violations block structurally. Suspected required/safety prose is warned/reviewed and explained as Base content; the UI does not claim arbitrary prose intent is perfectly machine-provable.
Package Workbench
- Profile cards show Base mappings and available Flavors.
- Package-specific overrides may hide a choice or change its starting default; those dirty fields stage in the Package form’s single Save/Cancel pair.
- A pre-existing
packages.mode_idappears only as a preserved read-only legacy fallback; new packages author catch-all Base behavior with a policy-1*Entry. - Sandbox tests one exact Entry/Base/Flavor composition fingerprint.
Chat
- A Web Classic How drawer shows active Base/provenance and a Style & rules section: independent checkboxes and nullable radio groups with None — Base only.
- An acknowledged toggle is selection-version guarded, spends no Echoes, and applies to the next accepted immutable turn; stale writes refresh without a partial UI flip.
- Same-profile model switches preserve choices by Flavor-link id.
- A different profile gets its own roster/defaults on first activation and remembered state thereafter.
- Direct arbitrary Mode selection detaches the profile composition and clears active Flavors without deleting retained per-profile snapshots.
- New/updated roster choices produce a package-aware Start a new conversation to use them action that keeps the package and re-resolves its current definition; generic standalone New chat is not substituted. Branches keep package context and the exact frozen roster. V1 does not refresh a roster in place. Hybrid says Style & rules require Classic, and Direct/Discord apply no uncontrollable default Flavor.
- Migrated policy-0-retained/ambiguous/manual selections that would otherwise be broken immediately by existing Mandatory/Mode-lock state receive a narrow Base-only grandfather. The retained valid Base may continue, but Flavors/recommendations and deliberate plan/preset changes require current enforcement; fresh conversations never inherit it.
Flavor toggles do not spend Echoes. Generated Test-drive/chat turns still use ordinary eligibility and billing rules.
Safety, rights, and publication
- Identity-family content is structurally forbidden. Platform safety and required package mechanics belong in Base; semantic misuse is author guidance plus content-check/moderator review because prose intent is not perfectly parseable.
- Every user-enableable Flavor is screened before profile/package publication, including default-off choices.
- Flavor source follows the profile’s Mode-style prompt-content visibility, while each Base source keeps its own Mode gate; labels/descriptions may remain visible without leaking either source.
- Package/project context may authorize a safe read of a reused profile’s mappings, Flavor descriptions, and effective overrides without granting profile ownership, edit rights, or prompt-source visibility. Workbench must use that scoped representation rather than the owner edit endpoint.
- Linking a Base requires
can_use. Creating/importing a Flavor happens inside Profile CAS; import requires source view/copy and clones into an exclusive private row. - Base, Flavor, package-override, and profile mutation fingerprints participate in the shared reverse-impact policy.
- Existing publication is not retroactively mass-audited merely because the extractor gains Flavor awareness; new/changed prompt-bearing profiles use the forward checks.
Parameter recommendations are separate
Model Profile Entry parameters remain recommendations. One atomic selection transaction can follow the automatic winner, choose a bound Entry with a concrete matching preset, or detach to an allowed ordinary Mode. For the chosen Entry it offers:
- Just switch Base — when the current preset matches, attach Base/Flavors without changing preset or any Generation rows;
- Use model & Base — select another concrete matching preset, clear only prior recommendation-sourced Generation rows, and preserve user-authored conversation overrides, so preset values apply to the remaining unset keys; or
- Apply Entry recommendations — perform that cleanup, atomically select the plan/preset, and write the explicitly listed canonical
Generation.*rows with Profile-recommendation provenance. Previously recommendation-sourced keys now omitted are removed; unlisted user-authored overrides remain.
Automatic parameter precedence at package/resolver launch is not part of this feature. Package settings use a separate exact non-Generation allowlist and reject every Generation.*/*Llm.* key, so that JSON cannot silently recreate automatic Entry recommendations.
Explicit Entry selection uses the package’s actual policy-specific match predicate. Policy 0 preserves its case-sensitive exact plus case-insensitive PostgreSQL-pattern substring behavior (including %, _, and \; * is not special). Policy 1 uses case-sensitive exact, case-insensitive literal containment, then a whole-identifier *. A matching shadowed Entry may be chosen deliberately even though automatic resolution still chooses its deterministic winner.
The exact winning Profile governs enforcement, or the package’s single normalized default Profile when none wins; no bound Profile means no Profile enforcement. Mandatory requires a matching Entry and blocks no-match generation/arbitrary Mode detachment. Package Mode lock additionally blocks manual Entry/Mode overrides but not creator-defined automatic re-resolution, optional Flavor toggles, or applying settings to the unchanged Entry. The only compatibility carve-out is the narrow migrated-conversation grandfather above; it cannot authorize a new selection.
Hybrid and door boundary
V1 Flavors target classic_primary on Web only. Hybrid, Direct, and Discord remain Base-only, so a prose-style choice is never applied without the promised effect/control surface. Future role-tagged Beat/Prose Model Profile composition and door-specific controls can extend the same link model with explicit stages; Flavor content never silently crosses a stage or door.
Acceptance Criteria
The Base/Flavor feature is not done until every box below is verified against the running product. The detailed canonical gate is maintained in Document Mode Editor.
User use cases:
- A creator can map each model pattern to an always-on Base prompt and author optional profile-wide Flavors without creating a parallel Bundle entity.
- A Web Classic package user can understand and toggle available Style & rules choices—including None — Base only—while Hybrid/Direct/Discord never apply an uncontrollable Flavor.
Behavior:
- Existing zero-Flavor Profiles assemble byte-identically, and a zero-row Base retains all
DefaultSectionswhen a Flavor is enabled. - Only an exact automatic winner or compatible explicit Entry contributes its Profile’s ordered enabled Flavors; disabled/unavailable/unsupported-surface Flavors perform no prompt/dependency/budget work.
- Leading Base System → Flavors → remaining Base → one journal fallback → Base merge ordering is identical in Sample, Test drive, runtime, moderation projection, and telemetry.
- Empty snapshot headers, narrow roster deltas, package-aware restart/branch, model/Profile/manual selection, direct Mode detachment, defaults, package overrides, groups, closed provenance, and old-conversation grandfathering follow the canonical state rules above.
Invariants:
- Base remains an ordinary Mode; Flavor choice/group state remains contextual to Model Profiles and each V1 Flavor content row is exclusive.
- Identity/shape violations block structurally; safety/required-mechanics misuse warns and is reviewed; Mode settings and parameters never become Flavor concerns.
- Hidden Flavor text, import-clone permissions, Profile CAS/create replay, publication impact, and moderation are enforced like other creator prompt IP.
- Package/project reuse exposes only context-authorized profile metadata and independently redacts Base/Flavor source; package edit rights never imply profile edit or prompt-view rights.
Edges:
- No winning Entry yields no Profile Flavors;
*supplies catch-all only under policy 1 after owner opt-in, and a governing Mandatory no-match blocks generation except for the unchanged valid Base of a specifically grandfathered migrated conversation. - Duplicate Base Mode ids across Profiles retain exact automatic/manual Profile/Entry provenance; a migrated ambiguous policy-0 automatic Base remains Base-only but still re-resolves on a later relevant change, while truly manual legacy ambiguity waits for explicit reattachment.
- Invalid/import-inaccessible/deleted Flavor rows, count/size excess, group-default conflicts, stale selection versions, package locks, Entry/model mismatches, and partial Entry-recommendation failures write nothing.