📝 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:
Fuegovic 2024-02-12 15:03:56 -05:00 committed by GitHub
parent d8d79aba16
commit 7ff2418d87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 63 additions and 8 deletions

View file

@ -1,12 +1,27 @@
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:
# 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
# api:
@ -16,7 +31,7 @@ version: '3.4'
# # BUILD FROM LATEST IMAGE
# api:
# image: ghcr.io/danny-avila/librechat-dev:latest
T
# # BUILD FROM LATEST IMAGE (NUMBERED RELEASE)
# api:
# image: ghcr.io/danny-avila/librechat:latest

View file

@ -17,7 +17,7 @@ services:
restart: always
user: "${UID}:${GID}"
extra_hosts:
- "host.docker.internal:host-gateway"
- "host.docker.internal:host-gateway"
environment:
- HOST=0.0.0.0
- MONGO_URI=mongodb://mongodb:27017/LibreChat

View file

@ -48,6 +48,42 @@ npm run list-balances
![image](https://github.com/danny-avila/LibreChat/assets/110412045/78175053-9c38-44c8-9b56-4b81df61049e)
## 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
![image](https://github.com/danny-avila/LibreChat/assets/32828263/c71139f2-da3f-4550-bbd1-aa51ad52dfaa)
And to get the real amount of USD spend based on **Token Value**:
![image](https://github.com/danny-avila/LibreChat/assets/32828263/757e1b65-acb1-40d8-986e-8d595cf45e08)
The relevant file for editing rates is found in `api/models/tx.js`
## Preview
![image](https://github.com/danny-avila/LibreChat/assets/110412045/39a1aa5d-f8fc-43bf-81f2-299e57d944bb)

View file

@ -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.
> 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:
```yaml
@ -45,14 +47,16 @@ services:
- ./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
version: '3.4'
services:
api:
image: ghcr.io/danny-avila/librechat:latest
volumes:
- ./librechat.yaml:/app/librechat.yaml
image: ghcr.io/danny-avila/librechat-dev:latest
mongodb:
ports: