mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 09:32:24 +00:00
🪙 chore: GPT-5.6 Terra and Luna Token Cost Rates (#14964)
* fix: update openai gpt-5.6 family token costs * test: cover GPT-5.6 pricing and float ratios --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
a0fda2cab1
commit
0ab3414c01
2 changed files with 40 additions and 10 deletions
|
|
@ -470,6 +470,36 @@ describe('getMultiplier', () => {
|
|||
}
|
||||
});
|
||||
|
||||
it('should use the documented gpt-5.6 pricing', () => {
|
||||
const expectedPricing = {
|
||||
'gpt-5.6': {
|
||||
standard: { prompt: 5, completion: 30 },
|
||||
cache: { write: 6.25, read: 0.5 },
|
||||
premium: { threshold: 272000, prompt: 10, completion: 45 },
|
||||
premiumCache: { threshold: 272000, write: 12.5, read: 1 },
|
||||
},
|
||||
'gpt-5.6-terra': {
|
||||
standard: { prompt: 2, completion: 12 },
|
||||
cache: { write: 2.5, read: 0.2 },
|
||||
premium: { threshold: 272000, prompt: 4, completion: 18 },
|
||||
premiumCache: { threshold: 272000, write: 5, read: 0.4 },
|
||||
},
|
||||
'gpt-5.6-luna': {
|
||||
standard: { prompt: 0.2, completion: 1.2 },
|
||||
cache: { write: 0.25, read: 0.02 },
|
||||
premium: { threshold: 272000, prompt: 0.4, completion: 1.8 },
|
||||
premiumCache: { threshold: 272000, write: 0.5, read: 0.04 },
|
||||
},
|
||||
};
|
||||
|
||||
for (const [model, pricing] of Object.entries(expectedPricing)) {
|
||||
expect(tokenValues[model]).toEqual(pricing.standard);
|
||||
expect(cacheTokenValues[model]).toEqual(pricing.cache);
|
||||
expect(premiumTokenValues[model]).toEqual(pricing.premium);
|
||||
expect(premiumCacheTokenValues[model]).toEqual(pricing.premiumCache);
|
||||
}
|
||||
});
|
||||
|
||||
it('should return the correct multiplier for gpt-4o', () => {
|
||||
const valueKey = getValueKey('gpt-4o-2024-08-06');
|
||||
expect(getMultiplier({ valueKey, tokenType: 'prompt' })).toBe(tokenValues['gpt-4o'].prompt);
|
||||
|
|
@ -2854,8 +2884,8 @@ describe('GPT-5.6 Long-Context Premium Pricing', () => {
|
|||
const premiumEntry = premiumTokenValues[model];
|
||||
expect(premiumEntry).toBeDefined();
|
||||
expect(premiumEntry.threshold).toBe(272000);
|
||||
expect(premiumEntry.prompt).toBe(tokenValues[model].prompt * 2);
|
||||
expect(premiumEntry.completion).toBe(tokenValues[model].completion * 1.5);
|
||||
expect(premiumEntry.prompt).toBeCloseTo(tokenValues[model].prompt * 2);
|
||||
expect(premiumEntry.completion).toBeCloseTo(tokenValues[model].completion * 1.5);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -148,8 +148,8 @@ export const tokenValues: Record<string, { prompt: number; completion: number }>
|
|||
'gpt-5.5': { prompt: 5, completion: 30 },
|
||||
'gpt-5.5-pro': { prompt: 30, completion: 180 },
|
||||
'gpt-5.6': { prompt: 5, completion: 30 },
|
||||
'gpt-5.6-terra': { prompt: 2.5, completion: 15 },
|
||||
'gpt-5.6-luna': { prompt: 1, completion: 6 },
|
||||
'gpt-5.6-terra': { prompt: 2, completion: 12 },
|
||||
'gpt-5.6-luna': { prompt: 0.2, completion: 1.2 },
|
||||
'chat-latest': { prompt: 5, completion: 30 },
|
||||
'gpt-5-chat-latest': { prompt: 1.25, completion: 10 },
|
||||
'gpt-5.1-chat-latest': { prompt: 1.25, completion: 10 },
|
||||
|
|
@ -381,8 +381,8 @@ export const cacheTokenValues: Record<string, { write: number; read: number }> =
|
|||
'gpt-5.4-nano': { write: 0.2, read: 0.02 },
|
||||
'gpt-5.5': { write: 5, read: 0.5 },
|
||||
'gpt-5.6': { write: 6.25, read: 0.5 },
|
||||
'gpt-5.6-terra': { write: 3.125, read: 0.25 },
|
||||
'gpt-5.6-luna': { write: 1.25, read: 0.1 },
|
||||
'gpt-5.6-terra': { write: 2.5, read: 0.2 },
|
||||
'gpt-5.6-luna': { write: 0.25, read: 0.02 },
|
||||
'chat-latest': { write: 5, read: 0.5 },
|
||||
'gpt-5-chat-latest': { write: 1.25, read: 0.125 },
|
||||
'gpt-5.1-chat-latest': { write: 1.25, read: 0.125 },
|
||||
|
|
@ -436,8 +436,8 @@ export const premiumTokenValues: Record<
|
|||
'gpt-5.5': { threshold: 272000, prompt: 10, completion: 45 },
|
||||
'gpt-5.5-pro': { threshold: 272000, prompt: 60, completion: 270 },
|
||||
'gpt-5.6': { threshold: 272000, prompt: 10, completion: 45 },
|
||||
'gpt-5.6-terra': { threshold: 272000, prompt: 5, completion: 22.5 },
|
||||
'gpt-5.6-luna': { threshold: 272000, prompt: 2, completion: 9 },
|
||||
'gpt-5.6-terra': { threshold: 272000, prompt: 4, completion: 18 },
|
||||
'gpt-5.6-luna': { threshold: 272000, prompt: 0.4, completion: 1.8 },
|
||||
'grok-4.5': { threshold: 200000, prompt: 4, completion: 12 },
|
||||
'grok-4-5': { threshold: 200000, prompt: 4, completion: 12 },
|
||||
'grok-4.6': { threshold: 200000, prompt: 4, completion: 12 },
|
||||
|
|
@ -457,8 +457,8 @@ export const premiumCacheTokenValues: Record<
|
|||
'gpt-5.4': { threshold: 272000, write: 5, read: 0.5 },
|
||||
'gpt-5.5': { threshold: 272000, write: 10, read: 1 },
|
||||
'gpt-5.6': { threshold: 272000, write: 12.5, read: 1 },
|
||||
'gpt-5.6-terra': { threshold: 272000, write: 6.25, read: 0.5 },
|
||||
'gpt-5.6-luna': { threshold: 272000, write: 2.5, read: 0.2 },
|
||||
'gpt-5.6-terra': { threshold: 272000, write: 5, read: 0.4 },
|
||||
'gpt-5.6-luna': { threshold: 272000, write: 0.5, read: 0.04 },
|
||||
};
|
||||
|
||||
export function createTxMethods(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue