mirror of
https://github.com/LibreChat-AI/librechat.ai.git
synced 2026-03-27 02:38:32 +07:00
✨ feat: Config v1.2.4 Changelog (#280)
* feat: Add allowedProviders and addedEndpoints features for enhanced agent configuration * wip: changelog 1.2.4 * feat: Enhance token balance management with auto-refill settings and detailed configuration options * feat: Enhance balance management with new configuration options for auto-refill and user balances * docs: Mark endpointsMenu setting as deprecated and provide migration guidance
This commit is contained in:
@@ -1,9 +1,35 @@
|
||||
- Added `allowedProviders` to [Agents](/docs/configuration/librechat_yaml/object_structure/agents)
|
||||
- Allows administrators to specify a list of endpoint providers (e.g., `openAI`, `anthropic`, `google`) that are permitted for use with the Agents feature.
|
||||
- If defined, only agents configured with these providers can be initialized.
|
||||
- This provides better control over which providers can be used with the Agents feature, enhancing security and compliance.
|
||||
---
|
||||
- Implemented `addedEndpoints` in [Model Specs](/docs/configuration/librechat_yaml/object_structure/model_specs)
|
||||
- **`modelSpecs.addedEndpoints`**: Enables specific endpoints (e.g., `openAI`, `google`) to be selectable in the UI even when `modelSpecs` are defined and prioritized. This allows users to choose standard models alongside specialized specs. Requires `interface.modelSelect` to be `true`. See [Model Specs Docs](/docs/configuration/librechat_yaml/object_structure/model_specs#addedendpoints) for more details.
|
||||
- If `modelSpecs.addedEndpoints` is provided, `interface.modelSelect` will default to `true` if not explicitly set, ensuring the model selection dropdown is visible.
|
||||
---
|
||||
- Added `timeout` to [MCP Servers](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
|
||||
- Controls how long to wait for a response from MCP server tool requests (in milliseconds)
|
||||
- Provides better control over MCP server request behavior
|
||||
- Allows adjusting timeouts based on expected response times for different MCP servers
|
||||
|
||||
---
|
||||
- Added `initTimeout` to [MCP Servers](/docs/configuration/librechat_yaml/object_structure/mcp_servers)
|
||||
- Controls how long to wait for MCP server initialization (in milliseconds)
|
||||
- Allows configuration of initialization timeouts for servers that may take longer to start up
|
||||
- Helps fine-tune performance for specific environments and use cases
|
||||
---
|
||||
- Implemented [Balance Configuration](/docs/configuration/librechat_yaml/object_structure/balance)
|
||||
- Set `enabled` to `true` to check user balances; replaces `CHECK_BALANCE` environment variable
|
||||
- Set `startBalance` to desired starting balance; replaces `START_BALANCE` environment variable
|
||||
- Added `autoRefillEnabled` to enable automatic token credit refills for users
|
||||
- Added `refillIntervalValue` to specify the numerical value for refill intervals
|
||||
- Added `refillIntervalUnit` to specify the time unit for refill intervals (seconds, minutes, hours, days, weeks, months)
|
||||
- Added `refillAmount` to specify the number of tokens added during each refill
|
||||
- Improved balance synchronization to ensure user settings match global configuration
|
||||
- Provides administrators with more control over token usage and user balance management
|
||||
- For more details, see the [Token Usage Guide](/docs/configuration/token_usage)
|
||||
---
|
||||
- Deprecated `interface.endpointsMenu` in [Interface](/docs/configuration/librechat_yaml/object_structure/interface#endpointsmenu)
|
||||
- This setting will be removed in a future version
|
||||
- Use `interface.modelSelect` instead for controlling endpoint/model selection visibility
|
||||
- If you would like to limit the available endpoints while using model specs, configure the [`modelSpecs.addedEndpoints`](/docs/configuration/librechat_yaml/object_structure/model_specs#addedendpoints) setting.
|
||||
|
||||
|
||||
13
pages/changelog/config_v1.2.4.mdx
Normal file
13
pages/changelog/config_v1.2.4.mdx
Normal file
@@ -0,0 +1,13 @@
|
||||
---
|
||||
date: 2025/4/1
|
||||
title: ⚙️ Config v1.2.4
|
||||
---
|
||||
|
||||
import { ChangelogHeader } from '@/components/changelog/ChangelogHeader'
|
||||
import Content from '@/components/changelog/content/config_v1.2.4.mdx'
|
||||
|
||||
<ChangelogHeader />
|
||||
|
||||
---
|
||||
|
||||
<Content />
|
||||
@@ -64,6 +64,26 @@ For more information about agent steps, see [Max Agent Steps](/docs/features/age
|
||||
disableBuilder: false
|
||||
```
|
||||
|
||||
## allowedProviders
|
||||
|
||||
<OptionTable
|
||||
options={[
|
||||
['allowedProviders', 'Array/List of Strings', 'Specifies a list of endpoint providers (e.g., "openAI", "anthropic", "google") that are permitted for use with the Agents feature.', 'If defined, only agents configured with these providers can be initialized. If omitted or empty, all configured providers are allowed.'],
|
||||
]}
|
||||
/>
|
||||
|
||||
**Default:** `[]` (empty list, all providers allowed)
|
||||
|
||||
**Note:** Must be one of the following:
|
||||
- `openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock`
|
||||
|
||||
**Example:**
|
||||
```yaml filename="endpoints / agents / allowedProviders"
|
||||
allowedProviders:
|
||||
- openAI
|
||||
- google
|
||||
```
|
||||
|
||||
## capabilities
|
||||
|
||||
<OptionTable
|
||||
|
||||
@@ -94,6 +94,8 @@ interface:
|
||||
|
||||
## endpointsMenu
|
||||
|
||||
- ⚠️ **Deprecated:** This setting is deprecated and no longer has any effect on v0.7.8 and later. Use `modelSelect` to enable configured endpoint options. If you would like to limit the available endpoints while using model specs, configure the [`modelSpecs.addedEndpoints`](/docs/configuration/librechat_yaml/object_structure/model_specs#addedendpoints) setting.
|
||||
|
||||
**Key:**
|
||||
<OptionTable
|
||||
options={[
|
||||
@@ -120,6 +122,10 @@ interface:
|
||||
|
||||
**Default:** `true`
|
||||
|
||||
**Notes:**
|
||||
- This is required to be `true` if using [`modelSpecs.addedEndpoints`](/docs/configuration/librechat_yaml/object_structure/model_specs#addedendpoints).
|
||||
- If `modelSpecs.addedEndpoints` is used and `interface.modelSelect` is not explicitly set, it defaults to `true`.
|
||||
|
||||
**Example:**
|
||||
```yaml filename="interface / modelSelect"
|
||||
interface:
|
||||
@@ -283,4 +289,4 @@ Enables/disables the "Run Code" button for Markdown Code Blocks. More info on th
|
||||
```yaml filename="interface / runCode"
|
||||
interface:
|
||||
runCode: true
|
||||
```
|
||||
```
|
||||
|
||||
@@ -9,6 +9,7 @@ There are 3 main fields under `modelSpecs`:
|
||||
- `enforce` (optional; default: false)
|
||||
- `prioritize` (optional; default: true)
|
||||
- `list` (required)
|
||||
- `addedEndpoints` (optional)
|
||||
|
||||
**Notes:**
|
||||
|
||||
@@ -99,6 +100,30 @@ modelSpecs:
|
||||
|
||||
---
|
||||
|
||||
### addedEndpoints
|
||||
|
||||
<OptionTable
|
||||
options={[
|
||||
['addedEndpoints', 'Array of Strings', 'Allows specific endpoints (e.g., "openAI", "google") to be selectable in the UI alongside the defined model specs.', 'Requires `interface.modelSelect` to be `true`. If this field is used and `interface.modelSelect` is not explicitly set, `modelSelect` will default to `true`.'],
|
||||
]}
|
||||
/>
|
||||
|
||||
**Default:** `[]` (empty list)
|
||||
|
||||
**Note:** Must be one of the following:
|
||||
- `openAI, azureOpenAI, google, anthropic, assistants, azureAssistants, bedrock`
|
||||
|
||||
**Example:**
|
||||
```yaml filename="modelSpecs / addedEndpoints"
|
||||
modelSpecs:
|
||||
# ... other modelSpecs fields
|
||||
addedEndpoints:
|
||||
- openAI
|
||||
- google
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### list
|
||||
|
||||
**Required**
|
||||
@@ -728,4 +753,4 @@ preset:
|
||||
```yaml
|
||||
preset:
|
||||
maxTokens: 1024
|
||||
```
|
||||
```
|
||||
|
||||
@@ -6,28 +6,83 @@ description: This covers how to track and control your token usage for the OpenA
|
||||
|
||||
## Intro
|
||||
|
||||
As of `v0.6.0`, LibreChat accurately tracks token usage for the OpenAI/Plugins endpoints. All token transactions are stored in the "Transactions" collection in your database. In future releases, you’ll be able to toggle viewing how much a conversation costs.
|
||||
As of `v0.6.0`, LibreChat accurately tracks token usage for the OpenAI/Plugins endpoints. All token transactions are stored in the "Transactions" collection in your database. In future releases, you'll be able to toggle viewing how much a conversation costs.
|
||||
|
||||
Currently, you can limit user token usage by enabling user balances. Instead of configuring token credit limits via environment variables, you now set these options in your `librechat.yaml` file under the **balance** section.
|
||||
|
||||
### New Balance Settings
|
||||
## Balance Configuration
|
||||
|
||||
The following settings are now managed in your YAML configuration:
|
||||
The balance system in LibreChat allows administrators to configure how token credit balances are managed for users. All balance settings are now managed in your YAML configuration under the `balance` object.
|
||||
|
||||
- **enabled**: Enable token credit balances for the OpenAI/Plugins endpoints.
|
||||
- **startBalance**: The number of tokens credited to a user upon registration.
|
||||
**Note:** This replaces the previous environment variables (`CHECK_BALANCE` and `START_BALANCE`) and provides a more structured way to manage user balances.
|
||||
|
||||
This replaces the old environment variables (`CHECK_BALANCE` and `START_BALANCE`), so you no longer need to manage these settings in your environment.
|
||||
### Complete Balance Settings
|
||||
|
||||
```yaml filename="librechat.yaml"
|
||||
version: 1.2.1
|
||||
|
||||
# Balance settings
|
||||
balance:
|
||||
enabled: true # Enable token credit balances for users.
|
||||
startBalance: 20000 # Number of tokens to credit upon registration.
|
||||
enabled: true # Enable token credit balances for users
|
||||
startBalance: 20000 # Initial tokens credited upon registration
|
||||
autoRefillEnabled: false # Enable automatic token refills
|
||||
refillIntervalValue: 30 # Numerical value for refill interval
|
||||
refillIntervalUnit: "days" # Time unit for refill interval (days, hours, etc.)
|
||||
refillAmount: 10000 # Tokens added during each refill
|
||||
```
|
||||
|
||||
### Balance Settings Explained
|
||||
|
||||
- **enabled**: Activates token credit tracking and balance management for users. When set to `true`, the system will track token usage and enforce balance limits.
|
||||
|
||||
- **startBalance**: Specifies the initial number of tokens credited to a user upon registration. This is the starting balance for all new users.
|
||||
|
||||
- **autoRefillEnabled**: Determines whether automatic refilling of token credits is enabled. When set to `true`, the system will automatically add credits to user balances based on the refill interval.
|
||||
|
||||
- **refillIntervalValue**: Specifies the numerical value for the interval at which token credits are automatically refilled. Works in conjunction with `refillIntervalUnit`.
|
||||
|
||||
- **refillIntervalUnit**: Specifies the time unit for the refill interval. Supported values include "seconds", "minutes", "hours", "days", "weeks", and "months".
|
||||
|
||||
- **refillAmount**: Specifies the number of tokens to be added to the user's balance during each automatic refill.
|
||||
|
||||
Check out the [Balance Configuration](/docs/configuration/librechat_yaml/object_structure/balance) page for more details.
|
||||
|
||||
## How Auto-Refill Works
|
||||
|
||||
When a user's balance is tracked and **autoRefill** is enabled, the system will automatically add credits to the balance only when the specified time interval has passed since the last refill. This is achieved by comparing the current date with the `lastRefill` date plus the specified interval.
|
||||
|
||||
### Auto-Refill Process
|
||||
|
||||
1. When a user attempts to spend tokens, the system checks if the current balance is sufficient
|
||||
2. If the balance would drop to zero or below after the transaction, the system checks if auto-refill is enabled
|
||||
3. If auto-refill is enabled, the system checks if the time interval since the last refill has passed:
|
||||
- The system compares the current date with `lastRefill + refillInterval`
|
||||
- If the interval has passed, tokens are added to the user's balance
|
||||
- The `lastRefill` date is updated to the current date
|
||||
4. The transaction proceeds if the balance is sufficient (either originally or after refill)
|
||||
|
||||
### Supported Time Units
|
||||
|
||||
The `refillIntervalUnit` can be set to any of the following values:
|
||||
- "seconds"
|
||||
- "minutes"
|
||||
- "hours"
|
||||
- "days"
|
||||
- "weeks"
|
||||
- "months"
|
||||
|
||||
For example, if `refillIntervalValue` is set to 30 and `refillIntervalUnit` is `days`, the system will add `refillAmount` tokens to the user's balance only if 30 days have passed since the last refill.
|
||||
|
||||
### Balance Synchronization
|
||||
|
||||
When a user logs in, the system automatically synchronizes their balance settings with the current global balance configuration. This ensures that any changes to the balance configuration are applied to all users.
|
||||
|
||||
The synchronization process:
|
||||
1. Checks if the user has a balance record
|
||||
2. If no record exists, creates one with the current `startBalance`
|
||||
3. Updates the user's auto-refill settings to match the global configuration
|
||||
4. Ensures the user's refill interval and amount match the global settings
|
||||
|
||||
## Managing Token Balances
|
||||
|
||||
You can manually add or set user balances. This is especially useful during development or if you plan to build out a full balance-accruing system in the future (for example, via an admin dashboard).
|
||||
@@ -97,7 +152,7 @@ docker exec -it LibreChat-API /bin/sh -c "cd .. && npm run list-balances"
|
||||
|
||||
This works well to track your own usage for personal use; 1000 credits = $0.001 (1 mill USD)
|
||||
|
||||
## Notes
|
||||
## Notes on Token Usage and Balance
|
||||
|
||||
- With summarization enabled, you will be blocked from making an API request if the cost of the content that you need to summarize + your messages payload exceeds the current balance
|
||||
- Counting Prompt tokens is really accurate for OpenAI calls, but not 100% for plugins (due to function calling). It is really close and conservative, meaning its count may be higher by 2-5 tokens.
|
||||
@@ -164,12 +219,6 @@ There will be more customization for this soon from the `librechat.yaml` file.
|
||||
|
||||

|
||||
|
||||
## How Auto-Refill Works
|
||||
|
||||
When a user’s balance is tracked and **autoRefill** is enabled, the system will automatically add credits to the balance only when the specified time interval has passed since the last refill. This is achieved by comparing the current date with the `lastRefill` date plus the specified interval. For example, if `refillIntervalValue` is set to 30 and `refillIntervalUnit` is `days`, the system will add `refillAmount` tokens to the user’s balance only if 30 days have passed since the last refill.
|
||||
|
||||
---
|
||||
|
||||
## Additional Notes
|
||||
|
||||
- With summarization enabled, API requests are blocked if the cost of the content plus the messages payload exceeds the current balance.
|
||||
|
||||
Reference in New Issue
Block a user