Skip to content

Commit 7432e42

Browse files
committed
LLMs: OpenAI: adopt uncurated marker for native unknowns
1 parent 06b856c commit 7432e42

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

src/modules/llms/server/models.mappings.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ import type { ModelDescriptionSchema } from './llm.server.types';
2020
* Readers: llm-registry-sync (marked + null contextWindow = held off the publication push),
2121
* listModels.test, the website (strips brackets, sinks pubDate; own regex, keep in sync).
2222
*
23-
* Legacy, not unified: bedrock ' [?]' suffix, openai bare '?'.
23+
* Legacy, not unified: bedrock ' [?]' suffix; openai-compat hosts keep a lenient bare '?'
24+
* (unknown is the norm there, marking would blank whole services from publication).
2425
*/
2526
const LLM_LABEL_UNCURATED = '[?]';
2627

src/modules/llms/server/openai/models/openai.models.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1200,26 +1200,38 @@ export const _knownOpenAIChatModels = llmsDefineModels<_OpenAIModelDef>()([
12001200
// -- 0-day or unknown models --
12011201

12021202
export function llmsFallbackForOpenAIModel(modelId: string, isLikelyOpenAI: boolean): KnownModel {
1203-
return isLikelyOpenAI && _isLikelyResponsesAPIModel(modelId) ? _llmsOpenAIModelResponsesFallback : _llmsOpenAIModelFallback;
1203+
if (!isLikelyOpenAI)
1204+
return _llmsOpenAICompatModelFallback;
1205+
return _isLikelyResponsesAPIModel(modelId) ? _llmsOpenAIModelResponsesFallback : _llmsOpenAIModelFallback;
12041206
}
12051207

1208+
// native OpenAI (and Azure deployments): the ids-only list discloses no type or context, so
1209+
// unknowns carry the uncurated marker (see llmsLabelUncurated) and a null (never guessed) context
12061210
const _llmsOpenAIModelFallback: KnownModel = {
12071211
idPrefix: '',
1208-
label: '?',
1209-
description: 'Unknown, please let us know the ID. Assuming a context window of 128k tokens, and a maximum output of 4k tokens.',
1210-
contextWindow: 128000,
1211-
maxCompletionTokens: 4096,
1212+
label: '[?]', // + ' [<id>]' via the variant append below
1213+
description: 'Unknown OpenAI model, not yet curated - please let us know the ID.',
1214+
contextWindow: null,
12121215
interfaces: IFS_CHAT_MIN,
12131216
// hidden: true,
12141217
};
12151218

12161219
const _llmsOpenAIModelResponsesFallback: KnownModel = {
12171220
..._llmsOpenAIModelFallback,
1218-
description: 'Unknown OpenAI model. Assuming Responses API support, 128k context, 16k output.',
1219-
maxCompletionTokens: 16384,
1221+
description: 'Unknown OpenAI model, not yet curated - assuming Responses API support.',
12201222
interfaces: [LLM_IF_OAI_Responses, ...IFS_CHAT_MIN],
12211223
};
12221224

1225+
// OpenAI-compatible hosts: unknown is the norm there, so stay lenient and unmarked
1226+
// ('[?]' would mark every model and hold whole services off the registry-sync push)
1227+
const _llmsOpenAICompatModelFallback: KnownModel = {
1228+
..._llmsOpenAIModelFallback,
1229+
label: '?', // + ' [<id>]'
1230+
description: 'Unknown, please let us know the ID. Assuming a context window of 128k tokens, and a maximum output of 8k tokens.',
1231+
contextWindow: 128000,
1232+
maxCompletionTokens: 8192,
1233+
};
1234+
12231235
function _isLikelyResponsesAPIModel(modelId: string): boolean {
12241236
// GPT-5+ family (gpt-5, gpt-5.1, gpt-5.2, gpt-6, etc.)
12251237
if (/^gpt-[5-9]/.test(modelId)) return true;

0 commit comments

Comments
 (0)