Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"interface",
"registration",
"turnstile",
"prompts",
"---Models & Specs---",
"model_specs",
"model_config",
Expand Down
113 changes: 113 additions & 0 deletions content/docs/configuration/librechat_yaml/object_structure/prompts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
title: "Prompts Configuration"
icon: SlidersHorizontal
---

## Example

```yaml filename="prompts"
prompts:
categories:
enableDefaultCategories: false
allowCustom: true
list:
- value: "hr"
label: "Human Resources"
icon: "users"
color: "series-7"
- value: "legal"
label: "Legal"
- value: "code"
label: "Engineering"
```

## prompts

**Key:**
<OptionTable
options={[
['prompts', 'Object', 'Settings for the Prompt Library. Currently holds the prompt category list.'],
]}
/>

### Fields

<OptionTable
options={[
['categories', 'Object', 'Which categories the Prompt Library offers when saving, browsing and filtering prompts.'],
]}
/>

## categories

Without a `categories` section, the nine built-in categories are shown, exactly as before: Ideas, Travel, Learning, Writing, Shopping, Code, Misc., Roleplay and Finance.

**Subkeys:**
<OptionTable
options={[
['enableDefaultCategories', 'Boolean', 'Show the nine built-in categories. Set to `false` to show only your `list`.', 'true'],
['allowCustom', 'Boolean', 'Let prompt authors create a new category from the category selector when saving a prompt. Also lists the custom categories already used on prompts each user can view.', 'false'],
['list', 'Array', 'Your own categories, shown after the built-ins in the order written. Up to 50 entries.'],
]}
/>

#### enableDefaultCategories

- **Type:** `Boolean`
- **Default:** `true`
- **Description:** When `false`, the built-in categories are hidden. A list entry that uses a built-in value still shows.
- **Example:**
```yaml
prompts:
categories:
enableDefaultCategories: false
list:
- value: "hr"
label: "Human Resources"
```

#### allowCustom

- **Type:** `Boolean`
- **Default:** `false`
- **Description:** When `true`, a prompt author can type a new category (for example "Onboarding") in the selector and create it. The dropdown and the sidebar filter then also list the custom categories stored on prompts that the user can view, sorted alphabetically (at most 200). When `false`, custom categories are not listed or offered, and existing prompts keep their stored category.
- **Example:**
```yaml
prompts:
categories:
allowCustom: true
```

#### list

- **Type:** `Array` of objects
- **Description:** Categories to add. An entry whose `value` matches a built-in (`idea`, `travel`, `teach_or_explain`, `write`, `shop`, `code`, `misc`, `roleplay`, `finance`) changes that built-in's label, icon and color in place instead of adding a new one.

**Entry fields:**
<OptionTable
options={[
['value', 'String', 'Required. The value stored on the prompt. 1–100 characters, unique in the list (ignoring case and surrounding spaces), and cannot start with `sys__`.'],
['label', 'String', 'Optional. Text shown to users. A label starting with `com_` is treated as a translation key; any other label is shown as written. Defaults to `value`.'],
['icon', 'String', 'Optional. One of `dices`, `box`, `file-text`, `pen-line`, `lightbulb`, `line-chart`, `shopping-bag`, `plane-takeoff`, `graduation-cap`, `terminal-square`, `users`, `beaker`, `settings`.'],
['color', 'String', 'Optional. Icon color from the theme palette: `series-1` through `series-8`.'],
]}
/>

```yaml
prompts:
categories:
list:
- value: "hr"
label: "Human Resources"
icon: "users"
color: "series-7"
- value: "code" # overrides the built-in "Code"
label: "Engineering"
```

### Notes

- **Validation:** Duplicate values, values starting with `sys__`, empty or over-long values, unknown icons or colors, and lists over 50 entries fail config validation at startup.
- **Per role, group or tenant:** The `prompts` section can be overridden through admin config overrides like any other section, so different roles can see different lists.
- **Removing a category** only hides it from the list. Prompts that use it keep their stored value.
- **Saving:** A prompt's category may be free text, but it is rejected with a validation error when it is over 100 characters, starts with `sys__`, or contains control characters.