LibreChat/packages/api/src/utils
Danny Avila 36f0365fd4
Some checks failed
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Has been cancelled
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Has been cancelled
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Has been cancelled
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Has been cancelled
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Has been cancelled
🧮 feat: Enhance Model Pricing Coverage and Pattern Matching (#10173)
* updated gpt5-pro

it is here and on openrouter
https://platform.openai.com/docs/models/gpt-5-pro

* feat: Add gpt-5-pro pricing
- Implemented handling for the new gpt-5-pro model in the getValueKey function.
- Updated tests to ensure correct behavior for gpt-5-pro across various scenarios.
- Adjusted token limits and multipliers for gpt-5-pro in the tokens utility files.
- Enhanced model matching functionality to include gpt-5-pro variations.

* refactor: optimize model pricing and validation logic

- Added new model pricing entries for llama2, llama3, and qwen variants in tx.js.
- Updated tokenValues to include additional models and their pricing structures.
- Implemented validation tests in tx.spec.js to ensure all models resolve correctly to pricing.
- Refactored getValueKey function to improve model matching and resolution efficiency.
- Removed outdated model entries from tokens.ts to streamline pricing management.

* fix: add missing pricing

* chore: update model pricing for qwen and gemma variants

* chore: update model pricing and add validation for context windows

- Removed outdated model entries from tx.js and updated tokenValues with new models.
- Added a test in tx.spec.js to ensure all models with pricing have corresponding context windows defined in tokens.ts.
- Introduced 'command-text' model pricing in tokens.ts to maintain consistency across model definitions.

* chore: update model names and pricing for AI21 and Amazon models

- Refactored model names in tx.js for AI21 and Amazon models to remove versioning and improve consistency.
- Updated pricing values in tokens.ts to reflect the new model names.
- Added comprehensive tests in tx.spec.js to validate pricing for both short and full model names across AI21 and Amazon models.

* feat: add pricing and validation for Claude Haiku 4.5 model

* chore: increase default max context tokens to 18000 for agents

* feat: add Qwen3 model pricing and validation tests

* chore: reorganize and update Qwen model pricing in tx.js and tokens.ts

---------

Co-authored-by: khfung <68192841+khfung@users.noreply.github.com>
2025-10-19 15:23:27 +02:00
..
__tests__ 📂 refactor: File Read Operations (#9747) 2025-09-20 10:17:24 -04:00
axios.spec.ts 👁️ feat: Azure Mistral OCR Strategy (#7888) 2025-06-13 15:14:57 -04:00
axios.ts 📂 refactor: File Read Operations (#9747) 2025-09-20 10:17:24 -04:00
azure.spec.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
azure.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
common.spec.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
common.ts 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
email.ts 🛜 refactor: Streamline App Config Usage (#9234) 2025-08-26 12:10:18 -04:00
env.spec.ts 🔐 ci: Add MCP Environment Processing tests 2025-09-08 15:38:44 -04:00
env.ts 👤 fix: Missing User Placeholder Fields for MCP Services (#9824) 2025-09-24 22:48:38 -04:00
events.ts 🕐 feat: Configurable Retention Period for Temporary Chats (#8056) 2025-06-25 17:16:26 -04:00
files.spec.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
files.ts 📂 refactor: File Read Operations (#9747) 2025-09-20 10:17:24 -04:00
generators.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
http.ts 🔧 refactor: customUserVar Error Normalization (#8950) 2025-08-08 15:53:04 -04:00
index.ts 🎚️ feat: Anthropic Parameter Set Support via Custom Endpoints (#9415) 2025-09-08 14:35:29 -04:00
key.test.ts 📂 refactor: File Read Operations (#9747) 2025-09-20 10:17:24 -04:00
key.ts 📂 refactor: File Read Operations (#9747) 2025-09-20 10:17:24 -04:00
llm.test.ts 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
llm.ts 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
math.ts 🔄 refactor: Migrate Cache Logic to TypeScript (#9771) 2025-10-02 09:33:58 -04:00
openid.ts 🔍 refactor: OpenID Fetch Handling and Logging (#7790) 2025-06-09 11:27:23 -04:00
tempChatRetention.spec.ts 🔃 refactor: Decouple Effects from AppService, move to data-schemas (#9974) 2025-10-05 06:37:57 -04:00
tempChatRetention.ts 🔃 refactor: Decouple Effects from AppService, move to data-schemas (#9974) 2025-10-05 06:37:57 -04:00
text.ts 📎 feat: Upload as Text Support for Plaintext, STT, RAG, and Token Limits (#8868) 2025-08-27 03:44:39 -04:00
tokenizer.spec.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
tokenizer.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
tokens.ts 🧮 feat: Enhance Model Pricing Coverage and Pattern Matching (#10173) 2025-10-19 15:23:27 +02:00
yaml.ts 🕐 feat: Configurable Retention Period for Temporary Chats (#8056) 2025-06-25 17:16:26 -04:00