Documentation Index
Fetch the complete documentation index at: https://mintlify.com/danny-avila/librechat/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The Presets API allows you to save and manage conversation configurations for quick reuse. Presets store model settings, parameters, and endpoint configurations.
All preset endpoints are prefixed with /api/presets.
List Presets
Retrieve all presets for the authenticated user:
GET /api/presets
Authorization: Bearer <token>
Response
Returns an array of preset objects:
[
{
"presetId": "preset_abc123",
"title": "GPT-4 Creative Mode",
"endpoint": "openAI",
"model": "gpt-4",
"modelLabel": "GPT-4",
"temperature": 0.9,
"top_p": 1,
"presence_penalty": 0.6,
"frequency_penalty": 0.5,
"max_tokens": 2000,
"instructions": "You are a creative writing assistant...",
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
},
{
"presetId": "preset_xyz789",
"title": "Claude Code Helper",
"endpoint": "anthropic",
"model": "claude-3-opus",
"temperature": 0.3,
"max_tokens": 4096,
"instructions": "You are an expert programmer...",
"createdAt": "2024-01-14T09:00:00Z"
}
]
Create or Update Preset
Create a new preset or update an existing one:
POST /api/presets
Authorization: Bearer <token>
Content-Type: application/json
{
"title": "My Custom Preset",
"endpoint": "openAI",
"model": "gpt-4",
"temperature": 0.7,
"top_p": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"max_tokens": 1500,
"instructions": "You are a helpful assistant."
}
Request Body
Preset ID (auto-generated if not provided). Include to update existing preset.
AI endpoint (e.g., openAI, anthropic, google, azureOpenAI)
Model identifier (e.g., gpt-4, claude-3-opus, gemini-pro)
Display label for the model
Sampling temperature (0-2). Higher values make output more random.
Nucleus sampling parameter (0-1)
Presence penalty (-2 to 2). Positive values penalize new tokens based on whether they appear in the text so far.
Frequency penalty (-2 to 2). Positive values penalize new tokens based on their frequency in the text so far.
Maximum number of tokens to generate
System instructions/prompt
OpenAI-specific Parameters
Whether to resend files with each message (OpenAI)
Image detail level: auto, low, or high (OpenAI Vision)
Anthropic-specific Parameters
Top-k sampling parameter (Anthropic)
Google-specific Parameters
Safety settings configuration (Google)
Response
Returns the created/updated preset object with HTTP status 201.
{
"presetId": "preset_abc123",
"title": "My Custom Preset",
"endpoint": "openAI",
"model": "gpt-4",
"temperature": 0.7,
"top_p": 1,
"presence_penalty": 0,
"frequency_penalty": 0,
"max_tokens": 1500,
"instructions": "You are a helpful assistant.",
"createdAt": "2024-01-15T10:00:00Z",
"updatedAt": "2024-01-15T10:00:00Z"
}
Delete Preset
Delete one or more presets:
POST /api/presets/delete
Authorization: Bearer <token>
Content-Type: application/json
{
"presetId": "preset_abc123"
}
Request Body
ID of preset to delete. If not provided, all user presets are deleted.
Response
Number of presets deleted
Preset Configuration Examples
Creative Writing
{
"title": "Creative Writer",
"endpoint": "openAI",
"model": "gpt-4",
"temperature": 0.9,
"top_p": 1,
"presence_penalty": 0.6,
"frequency_penalty": 0.5,
"instructions": "You are a creative writing assistant who helps with storytelling, character development, and narrative structure."
}
Code Assistant
{
"title": "Code Helper",
"endpoint": "anthropic",
"model": "claude-3-opus",
"temperature": 0.2,
"top_p": 0.9,
"max_tokens": 4096,
"instructions": "You are an expert programmer. Provide clear, well-documented code with explanations.",
"tools": ["code_interpreter"]
}
Research Assistant
{
"title": "Research Helper",
"endpoint": "google",
"model": "gemini-pro",
"temperature": 0.4,
"topK": 40,
"max_tokens": 2048,
"instructions": "You are a thorough research assistant. Provide accurate, well-cited information.",
"tools": ["web_search"]
}
Concise Responses
{
"title": "Concise Mode",
"endpoint": "openAI",
"model": "gpt-4",
"temperature": 0.5,
"max_tokens": 500,
"instructions": "Provide brief, direct answers. Be concise and to the point."
}
Preset Parameters by Endpoint
OpenAI
Supported parameters:
temperature (0-2)
top_p (0-1)
presence_penalty (-2 to 2)
frequency_penalty (-2 to 2)
max_tokens
stop
resendFiles
imageDetail
Anthropic (Claude)
Supported parameters:
temperature (0-1)
top_p (0-1)
top_k (1-500)
max_tokens
stop_sequences
Google (Gemini)
Supported parameters:
temperature (0-2)
topP (0-1)
topK (1-40)
maxOutputTokens
safetySettings
Azure OpenAI
Same as OpenAI parameters.
Error Responses
Invalid Preset Data
{
"error": "There was an error when saving the preset",
"message": "Invalid model specified"
}
HTTP Status: 500
Preset Not Found
{
"error": "Preset not found"
}
HTTP Status: 404
Delete Error
{
"error": "There was an error deleting the presets"
}
HTTP Status: 500
Use Cases
Quick Model Switching
Save presets for different models to quickly switch between GPT-4, Claude, and Gemini without reconfiguring.
Task-Specific Configurations
Create presets optimized for specific tasks:
- Code review (low temperature, code tools)
- Creative writing (high temperature, presence penalty)
- Data analysis (code interpreter enabled)
- Research (web search enabled)
Team Collaboration
Share preset configurations with team members by exporting/importing preset JSON.
A/B Testing
Compare different parameter configurations by creating multiple presets and testing which works best for your use case.
TypeScript Types
import type { TPreset } from 'librechat-data-provider';
interface TPreset {
presetId?: string;
title: string;
endpoint: EModelEndpoint;
model: string;
modelLabel?: string;
temperature?: number;
top_p?: number;
presence_penalty?: number;
frequency_penalty?: number;
max_tokens?: number;
instructions?: string;
stop?: string[];
tools?: string[];
agent_id?: string;
// Endpoint-specific parameters
resendFiles?: boolean; // OpenAI
imageDetail?: string; // OpenAI Vision
top_k?: number; // Anthropic
topK?: number; // Google
safetySettings?: object[]; // Google
}