Skip to main content

Presets

Presets can be used to apply multiple setting overrides at once to either a tab or a block. They are currently supported in two scenarios: tab backgrounds and AI models.

You can set presets either by placing them in ~/.config/waveterm/presets.json or by placing them in a JSON file in the ~/.config/waveterm/presets/ directory. All presets will be aggregated regardless of which file they're placed in so you can use the presets directory to organize them as you see fit.

info

You can open up the main presets config file in Wave by running:

wsh editconfig presets.json

File format

Presets follow the following format:

{
...
"<preset-type>@<preset-key>": {
"display:name": "<Preset name>",
"display:order": "<number>", // optional
"<overridden-config-key-1>": "<overridden-config-value-1>"
...
}
}

A complete example of a preset for a tab background is the following:

{
"bg@rainbow": {
"display:name": "Rainbow",
"display:order": 2.1,
"bg:*": true,
"bg": "linear-gradient( 226.4deg, rgba(255,26,1,1) 28.9%, rgba(254,155,1,1) 33%, rgba(255,241,0,1) 48.6%, rgba(34,218,1,1) 65.3%, rgba(0,141,254,1) 80.6%, rgba(113,63,254,1) 100.1% )",
"bg:opacity": 0.3
}
}

A complete example of a preset for an AI model is the following:

{
"ai@wave": {
"display:name": "Ollama - llama3.1",
"display:order": 0,
"ai:baseurl": "http://localhost:11434",
"ai:model": "llama3.1:latest"
}
}

Preset type

The type of the preset determines where it can be discovered in the app. Currently, the two types that will be discovered in the app are bg and ai.

bg will be served in the "Backgrounds" submenu of the Tab context menu (which can be found by right-clicking on a tab).

screenshot showing the default options in the backgrounds submenu of the tab context menu

ai will be served in the models dropdown in the block header of the "Wave AI" widget.

screenshot showing the default options in the models dropdown in the block header of the &quot;Wave AI&quot; widget

Available configuration keys

The following configuration keys are available for use in presets:

Common keys

Key NameTypeFunction
display:namestringthe name to use when displaying the preset in a menu (required)
display:orderfloatthe order in which the preset should be displayed in a menu (optional)

AI configurations

Key NameTypeFunction
ai:presetstringthe default AI preset to use
ai:baseurlstringSet the AI Base Url (must be OpenAI compatible)
ai:apitokenstringyour AI api token
ai:apitypestringdefaults to "open_ai", but can also set to "azure" (for special Azure AI handling), or "anthropic"
ai:namestringstring to display in the Wave AI block header
ai:modelstringmodel name to pass to API
ai:apiversionstringfor Azure AI only (when apitype is "azure", this will default to "2023-05-15")
ai:orgidstring
ai:maxtokensintmax tokens to pass to API
ai:timeoutmsinttimeout (in milliseconds) for AI calls

Background configurations

Key NameTypeFunction
bg:opacityfloatthe opacity of the background
bg:blendmodestringthe blend mode of the background
bg:bordercolorstringthe color of the border
bg:activebordercolorstringthe color of the border when a block is active

Clear key

Configs in a preset are applied in order to override the default config values, which will persist for the remainder of the tab or block's lifetime. Setting bg:* or ai:* to "true" will clear the values of any previously overridden Background or AI configurations, respectively, setting them back to their defaults.

Unset a default value

To unset a default value in a preset, add an override that sets it to an empty string, like "".