mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
📝 docs: clarifications - override file & balance/token count (#1783)
* 📝 docs: override file clarification * 📝 docs: override file clarification * 📝 docs: balance & token count clarification
This commit is contained in:
parent
d8d79aba16
commit
7ff2418d87
4 changed files with 63 additions and 8 deletions
|
|
@ -1,12 +1,27 @@
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
# # TO USE THIS FILE, FIRST UNCOMMENT THE FOLLOWING LINE ('services:')
|
# Please consult our docs for more info: https://docs.librechat.ai/install/configuration/docker_override.html
|
||||||
|
|
||||||
|
# TO USE THIS FILE, FIRST UNCOMMENT THE LINE ('services:')
|
||||||
|
|
||||||
|
# THEN UNCOMMENT ONLY THE SECTION OR SECTIONS CONTAINING THE CHANGES YOU WANT TO APPLY
|
||||||
|
# SAVE THIS FILE AS 'docker-compose.override.yaml'
|
||||||
|
# AND USE THE 'docker compose build' & 'docker compose up -d' COMMANDS AS YOU WOULD NORMALLY DO
|
||||||
|
|
||||||
|
# WARNING: YOU CAN ONLY SPECIFY EVERY SERVICE NAME ONCE (api, mongodb, meilisearch, ...)
|
||||||
|
# IF YOU WANT TO OVERRIDE MULTIPLE SETTINGS IN ONE SERVICE YOU WILL HAVE TO EDIT ACCORDINGLY
|
||||||
|
|
||||||
|
# EXAMPLE: if you want to use the config file and the latest docker image the result will be:
|
||||||
|
|
||||||
# services:
|
# services:
|
||||||
|
# api:
|
||||||
|
# volumes:
|
||||||
|
# - ./librechat.yaml:/app/librechat.yaml
|
||||||
|
# image: ghcr.io/danny-avila/librechat-dev:latest
|
||||||
|
|
||||||
# # THEN UNCOMMENT ONLY THE SECTION OR SECTIONS CONTAINING THE CHANGES YOU WANT TO APPLY
|
# ---------------------------------------------------
|
||||||
# # SAVE THIS FILE AS 'docker-compose.override.yaml'
|
|
||||||
# # AND USE THE 'docker compose build' & 'docker compose up -d' COMMANDS AS YOU WOULD NORMALLY DO
|
# services:
|
||||||
|
|
||||||
# # USE LIBRECHAT CONFIG FILE
|
# # USE LIBRECHAT CONFIG FILE
|
||||||
# api:
|
# api:
|
||||||
|
|
@ -16,7 +31,7 @@ version: '3.4'
|
||||||
# # BUILD FROM LATEST IMAGE
|
# # BUILD FROM LATEST IMAGE
|
||||||
# api:
|
# api:
|
||||||
# image: ghcr.io/danny-avila/librechat-dev:latest
|
# image: ghcr.io/danny-avila/librechat-dev:latest
|
||||||
|
T
|
||||||
# # BUILD FROM LATEST IMAGE (NUMBERED RELEASE)
|
# # BUILD FROM LATEST IMAGE (NUMBERED RELEASE)
|
||||||
# api:
|
# api:
|
||||||
# image: ghcr.io/danny-avila/librechat:latest
|
# image: ghcr.io/danny-avila/librechat:latest
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ services:
|
||||||
restart: always
|
restart: always
|
||||||
user: "${UID}:${GID}"
|
user: "${UID}:${GID}"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
environment:
|
environment:
|
||||||
- HOST=0.0.0.0
|
- HOST=0.0.0.0
|
||||||
- MONGO_URI=mongodb://mongodb:27017/LibreChat
|
- MONGO_URI=mongodb://mongodb:27017/LibreChat
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,42 @@ npm run list-balances
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## More details
|
||||||
|
source: [LibreChat/discussions/1640](https://github.com/danny-avila/LibreChat/discussions/1640#discussioncomment-8251970)
|
||||||
|
|
||||||
|
> "rawAmount": -000, // what's this?
|
||||||
|
|
||||||
|
Raw amount of tokens as counted per the tokenizer algorithm.
|
||||||
|
|
||||||
|
> "tokenValue": -00000, // what's this?
|
||||||
|
|
||||||
|
Token credits value. 1000 credits = $0.001 (1 mill USD)
|
||||||
|
|
||||||
|
> "rate": 00, // what's this?
|
||||||
|
|
||||||
|
The rate at which tokens are charged as credits.
|
||||||
|
|
||||||
|
For example, gpt-3.5-turbo-1106 has a rate of 1 for user prompt (input) and 2 for completion (output)
|
||||||
|
|
||||||
|
| Model | Input | Output |
|
||||||
|
|-----------------------|----------------------|----------------------|
|
||||||
|
| gpt-3.5-turbo-1106 | $0.0010 / 1K tokens | $0.0020 / 1K tokens |
|
||||||
|
|
||||||
|
|
||||||
|
Given the provided example:
|
||||||
|
|
||||||
|
"rawAmount": -137
|
||||||
|
"tokenValue": -205.5
|
||||||
|
"rate": 1.5
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
And to get the real amount of USD spend based on **Token Value**:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
The relevant file for editing rates is found in `api/models/tx.js`
|
||||||
|
|
||||||
## Preview
|
## Preview
|
||||||
|
|
||||||

|

|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ Open your `docker-compose.override.yml` file with vscode or any text editor.
|
||||||
|
|
||||||
Make your desired changes by uncommenting the relevant sections and customizing them as needed.
|
Make your desired changes by uncommenting the relevant sections and customizing them as needed.
|
||||||
|
|
||||||
|
> Warning: You can only specify every service name once (api, mongodb, meilisearch, ...) If you want to override multiple settings in one service you will have to edit accordingly.
|
||||||
|
|
||||||
For example, if you want to make sure Docker can use your `librechat.yaml` file for [custom configuration](./custom_config.md), it would look like this:
|
For example, if you want to make sure Docker can use your `librechat.yaml` file for [custom configuration](./custom_config.md), it would look like this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
|
@ -45,14 +47,16 @@ services:
|
||||||
- ./librechat.yaml:/app/librechat.yaml
|
- ./librechat.yaml:/app/librechat.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
Or, if you want to use a prebuilt image for the `api` service and expose MongoDB's port, your `docker-compose.override.yml` might look like this:
|
Or, if you want to use a prebuilt image for the `api` service, use the LibreChat config file, and expose MongoDB's port, your `docker-compose.override.yml` might look like this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: '3.4'
|
version: '3.4'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
api:
|
api:
|
||||||
image: ghcr.io/danny-avila/librechat:latest
|
volumes:
|
||||||
|
- ./librechat.yaml:/app/librechat.yaml
|
||||||
|
image: ghcr.io/danny-avila/librechat-dev:latest
|
||||||
|
|
||||||
mongodb:
|
mongodb:
|
||||||
ports:
|
ports:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue