mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-21 09:32:24 +00:00
🛰️ feat: Add GPT-5.5 + Frontier OpenAI Models, Drop Deprecated Defaults (#13636)
* 🛰️ feat: Add GPT-5.5 + Frontier OpenAI Models, Drop Deprecated Defaults * 🛰️ fix: Address Codex Review on OpenAI Model Refresh - Replace nonexistent gpt-5.5-chat-latest with the actual chat-latest alias; register its context window, output cap, pricing, and cache rates, and pin explicit rates for legacy gpt-5.x-chat-latest aliases so the new chat-latest key cannot out-match their cheaper pricing - Add long-context premium tiers (>272K input) for gpt-5.5 and gpt-5.4 - Disable streaming for pro reasoning models (o1-pro, gpt-5.x-pro), which OpenAI does not support, with spec coverage * 🛰️ fix: Address Codex Round-2 Review and CI Spec Failure - Allow chat-latest through the official OpenAI fetched-model filter - Export isProReasoningModel and drop unsupported sampling parameters for versioned pro models (gpt-5.4-pro, gpt-5.5-pro), which the versioned-model exemption previously let through - Honor the pro-model streaming disable in both agent chat-completions routes, which decide SSE from model_parameters before llmConfig exists - Update models.spec default-list assertions for the refreshed defaults and cover chat-latest filter retention * 🛰️ fix: Address Codex Round-3 Review - Convert max_tokens for chat-latest, which the gpt-[5-9] guard missed - Drop snake_case sampling params (top_p, logit_bias, penalties) in the reasoning-model exclusion list so addParams-sourced values are removed - Add createOpenAIAggregatorHandlers and wire them into the agent chat-completions service's non-streaming branch, which previously ran with no handlers and always returned an empty aggregated response * 🛰️ ci: Fix Import Order Drift and Controller Spec Mock - Sort type import first in service.spec.ts per import-order convention - Register isProReasoningModel in the openai controller spec's @librechat/api mock factory, whose enumerated exports left the new helper undefined and broke the non-streaming flow under test * 🛰️ chore: Trim Scope to Model Catalog Changes Revert the OpenAI endpoint and agent handler changes (pro-model streaming, sampling exclusions, non-streaming aggregation) — that surface is moving out of LibreChat into the agents SDK and belongs in its own change. Keep the model list, token windows, pricing, and the fetched-model filter for chat-latest. * 🛰️ fix: Correct GPT-5.4 Context Windows and Pro Long-Context Pricing - Set gpt-5.4 and gpt-5.4-pro context to the documented 1,050,000 window — 272K is the long-context pricing breakpoint, not the cap, and using it truncated prompts before they could reach that tier - Add gpt-5.4-pro long-context premium rates ($60/$270 above 272K) per its model page; gpt-5.5-pro documents no long-context tier * 🛰️ fix: Add gpt-5.4-nano and gpt-5.5-pro Long-Context Pricing - Register gpt-5.4-nano ($0.20/$1.25, cached $0.02, 400K context) in the model list, pricing, cache, and token maps — the longest-match fallback billed it at gpt-5.4's $2.50/$15 - Add gpt-5.5-pro long-context premium rates ($60/$270 above 272K); the pricing table lists the tier even though the model page omits it
This commit is contained in:
parent
ba5778d0df
commit
ca26a2dc9c
6 changed files with 71 additions and 30 deletions
|
|
@ -209,7 +209,7 @@ describe('getOpenAIModels', () => {
|
|||
|
||||
it('returns default models when no environment configurations are provided (and fetch fails)', async () => {
|
||||
const models = await getOpenAIModels({ user: 'user456' });
|
||||
expect(models).toContain('gpt-4');
|
||||
expect(models).toContain('gpt-5.5');
|
||||
});
|
||||
|
||||
it('returns default models when OpenAI API key is user provided', async () => {
|
||||
|
|
@ -220,7 +220,7 @@ describe('getOpenAIModels', () => {
|
|||
|
||||
expect(mockedAxios.get).not.toHaveBeenCalled();
|
||||
expect(models).not.toContain('should-not-appear');
|
||||
expect(models).toContain('gpt-4');
|
||||
expect(models).toContain('gpt-5.5');
|
||||
});
|
||||
|
||||
it('fetches models when OpenAI API key is provided through options', async () => {
|
||||
|
|
@ -335,6 +335,26 @@ describe('getOpenAIModels sorting behavior', () => {
|
|||
];
|
||||
expect(models).toEqual(expectedOrder);
|
||||
});
|
||||
|
||||
it('keeps chat-latest when filtering official OpenAI results', async () => {
|
||||
mockedAxios.get.mockResolvedValue({
|
||||
data: {
|
||||
data: [
|
||||
{ id: 'chat-latest' },
|
||||
{ id: 'gpt-5.5' },
|
||||
{ id: 'dall-e-3' },
|
||||
{ id: 'gpt-realtime-2' },
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
const models = await getOpenAIModels({ user: 'user456' });
|
||||
|
||||
expect(models).toContain('chat-latest');
|
||||
expect(models).toContain('gpt-5.5');
|
||||
expect(models).not.toContain('dall-e-3');
|
||||
expect(models).not.toContain('gpt-realtime-2');
|
||||
});
|
||||
});
|
||||
|
||||
describe('fetchModels with Ollama specific logic', () => {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import crypto from 'crypto';
|
||||
import axios from 'axios';
|
||||
import crypto from 'crypto';
|
||||
import { logger } from '@librechat/data-schemas';
|
||||
import { HttpsProxyAgent } from 'https-proxy-agent';
|
||||
import {
|
||||
|
|
@ -274,7 +274,7 @@ export async function fetchOpenAIModels(
|
|||
}
|
||||
|
||||
if (baseURL === openaiBaseURL) {
|
||||
const regex = /(text-davinci-003|gpt-|o\d+)/;
|
||||
const regex = /(text-davinci-003|gpt-|o\d+|chat-latest)/;
|
||||
const excludeRegex = /audio|realtime/;
|
||||
models = models.filter((model) => regex.test(model) && !excludeRegex.test(model));
|
||||
const instructModels = models.filter((model) => model.includes('instruct'));
|
||||
|
|
|
|||
|
|
@ -55,10 +55,13 @@ const openAIModels = {
|
|||
'gpt-5.1': 400000,
|
||||
'gpt-5.2': 400000,
|
||||
'gpt-5.3': 400000,
|
||||
'gpt-5.4': 272000, // standard context; 1M experimental available via API opt-in (2x rate)
|
||||
'gpt-5.4-pro': 272000, // same window as gpt-5.4
|
||||
'gpt-5.4': 1050000, // >272K input prices at the long-context tier (2x input, 1.5x output)
|
||||
'gpt-5.4-pro': 1050000,
|
||||
'gpt-5.4-mini': 400000,
|
||||
'gpt-5.4-nano': 400000,
|
||||
'gpt-5.5': 1050000,
|
||||
'gpt-5.5-pro': 1050000,
|
||||
'chat-latest': 400000,
|
||||
'gpt-5-mini': 400000,
|
||||
'gpt-5-nano': 400000,
|
||||
'gpt-5-pro': 400000,
|
||||
|
|
@ -383,8 +386,11 @@ export const modelMaxOutputs = {
|
|||
'gpt-5.3': 128000,
|
||||
'gpt-5.4': 128000,
|
||||
'gpt-5.4-pro': 128000,
|
||||
'gpt-5.4-mini': 128000,
|
||||
'gpt-5.4-nano': 128000,
|
||||
'gpt-5.5': 128000,
|
||||
'gpt-5.5-pro': 128000,
|
||||
'chat-latest': 128000,
|
||||
'gpt-5-mini': 128000,
|
||||
'gpt-5-nano': 128000,
|
||||
'gpt-5-pro': 128000,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue