Templates¶
LWE comes with a full template management system, leveraging the power of the venerable Jinja framework.
Templates allow storing text in template files, and quickly leveraging the contents as your user input.
Features:
Create/edit templates
Per-profile templates
{{ variable }}
syntax substitutionFive different workflows for collecting variable values, editing, and running
See the various /help template
commands for more information.
Builtin variables¶
LWE exposes some builtin variables that can be used in templates:
{{ clipboard }}
- Insert the contents of the clipboard
Front matter¶
Templates may include front matter (see the example templates).
These front matter attributes have special functionality:
description
: Displayed in the output of/templates
request_overrides
: A hash of model customizations to apply when the template is run:system_message
: An existing system message alias, or a custom system message to use when running the templatetitle
: Sets the title of new conversations to this valuepreset
: An existing preset for the provider/model configuration to use when running the template (see Presets)activate_preset
: By default, a preset set in a template is only used during the run of the template. To switch the backend to using the preset for other requests by default, set this totrue
preset_overrides
: A dictionary of metadata and model customization overrides to apply to the preset when running the templatemetadata
: A dictionary of metadata overridesmodel_customizations`
: A dictionary of model customization overrides
This dictionary is recursively merged with the struture of the preset configuration. To see the exact structure of a preset, use the
/preset-edit
command.
All other attributes will be passed to the template as variable substitutions.