Skip to content

Commit

Permalink
AIX: OpenAI: latest models
Browse files Browse the repository at this point in the history
  • Loading branch information
enricoros committed Dec 25, 2024
1 parent 1bd327e commit a2942a3
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/common/stores/llms/llms.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export type DModelInterfaceV1 =
| 'ant-prompt-caching'
| 'oai-prompt-caching'
| 'oai-realtime'
| 'oai-needs-audio'
| 'gem-code-execution'
| 'hotfix-no-stream' // disable streaming for o1-preview (old) and o1 (20241217)
| 'hotfix-strip-images' // strip images from the input
Expand All @@ -82,6 +83,7 @@ export const LLM_IF_OAI_Complete: DModelInterfaceV1 = 'oai-complete';
export const LLM_IF_ANT_PromptCaching: DModelInterfaceV1 = 'ant-prompt-caching';
export const LLM_IF_OAI_PromptCaching: DModelInterfaceV1 = 'oai-prompt-caching';
export const LLM_IF_OAI_Realtime: DModelInterfaceV1 = 'oai-realtime';
export const LLM_IF_OAI_NeedsAudio: DModelInterfaceV1 = 'oai-needs-audio';
export const LLM_IF_GEM_CodeExecution: DModelInterfaceV1 = 'gem-code-execution';
export const LLM_IF_HOTFIX_NoStream: DModelInterfaceV1 = 'hotfix-no-stream';
export const LLM_IF_HOTFIX_StripImages: DModelInterfaceV1 = 'hotfix-strip-images';
Expand All @@ -99,6 +101,7 @@ export const LLMS_ALL_INTERFACES = [
LLM_IF_ANT_PromptCaching,
LLM_IF_OAI_PromptCaching,
LLM_IF_OAI_Realtime,
LLM_IF_OAI_NeedsAudio,
LLM_IF_GEM_CodeExecution,
LLM_IF_HOTFIX_NoStream,
LLM_IF_HOTFIX_StripImages,
Expand Down
96 changes: 87 additions & 9 deletions src/modules/llms/server/openai/models/openai.models.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { OpenAIWire_API_Models_List } from '~/modules/aix/server/dispatch/wiretypes/openai.wiretypes';

import { LLM_IF_HOTFIX_NoStream, LLM_IF_HOTFIX_StripImages, LLM_IF_HOTFIX_Sys0ToUsr0, LLM_IF_OAI_Chat, LLM_IF_OAI_Complete, LLM_IF_OAI_Fn, LLM_IF_OAI_Json, LLM_IF_OAI_PromptCaching, LLM_IF_OAI_Realtime, LLM_IF_OAI_Reasoning, LLM_IF_OAI_Vision } from '~/common/stores/llms/llms.types';
import { LLM_IF_HOTFIX_NoStream, LLM_IF_HOTFIX_StripImages, LLM_IF_HOTFIX_Sys0ToUsr0, LLM_IF_OAI_Chat, LLM_IF_OAI_Complete, LLM_IF_OAI_Fn, LLM_IF_OAI_Json, LLM_IF_OAI_NeedsAudio, LLM_IF_OAI_PromptCaching, LLM_IF_OAI_Realtime, LLM_IF_OAI_Reasoning, LLM_IF_OAI_Vision } from '~/common/stores/llms/llms.types';

import type { ModelDescriptionSchema } from '../../llm.server.types';
import { fromManualMapping, ManualMappings } from './models.data';
Expand Down Expand Up @@ -99,13 +99,39 @@ export const _knownOpenAIChatModels: ManualMappings = [
chatPrice: { input: 0.15, cache: { cType: 'oai-ac', read: 0.075 }, output: 0.6 },
benchmark: { cbaElo: 1272 },
},
{
idPrefix: 'gpt-4o-mini-audio-preview',
label: 'GPT-4o Mini Audio Preview',
description: 'Preview release for audio inputs in chat completions.',
symLink: 'gpt-4o-mini-audio-preview-2024-12-17',
hidden: true,
// copied from symlinked
contextWindow: 128000,
maxCompletionTokens: 16384,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_NeedsAudio],
chatPrice: { input: 0.15, output: 0.6 /* TODO: AUDIO 10/20 */ },
isPreview: true,
},
{
idPrefix: 'gpt-4o-mini-audio-preview-2024-12-17',
label: 'GPT-4o Mini Audio Preview (2024-12-17)',
description: 'Snapshot for the Audio API model.',
contextWindow: 128000,
maxCompletionTokens: 16384,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_NeedsAudio],
chatPrice: { input: 0.15, output: 0.6 /* TODO: AUDIO 10/20 */ },
isPreview: true,
hidden: true,
},

// GPT-4o Realtime Preview
{
idPrefix: 'gpt-4o-realtime-preview',
label: 'GPT-4o Realtime',
label: 'GPT-4o Realtime Preview',
description: 'Preview release for the Realtime API. Points to the latest snapshot of GPT-4o Realtime Preview model: gpt-4o-realtime-preview-2024-10-01.',
symLink: 'gpt-4o-realtime-preview-2024-10-01',
symLink: 'gpt-4o-realtime-preview-2024-10-01', // will point to `gpt-4o-realtime-preview-2024-12-17` on Jan 9, 2025
hidden: true,
// copied from symlinked
contextWindow: 128000,
Expand All @@ -115,9 +141,21 @@ export const _knownOpenAIChatModels: ManualMappings = [
chatPrice: { input: 5, cache: { cType: 'oai-ac', read: 2.5 }, output: 20 /* TODO: AUDIO 100/200 */ },
isPreview: true,
},
{
idPrefix: 'gpt-4o-realtime-preview-2024-12-17',
label: 'GPT-4o Realtime Preview (2024-12-17)',
description: 'Snapshot for the Realtime API model. Supports low-latency, multimodal experiences including speech-to-speech capabilities.',
contextWindow: 128000,
maxCompletionTokens: 4096,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_Realtime],
chatPrice: { input: 5, cache: { cType: 'oai-ac', read: 2.5 }, output: 20 },
isPreview: true,
hidden: true,
},
{
idPrefix: 'gpt-4o-realtime-preview-2024-10-01',
label: 'GPT-4o Realtime (2024-10-01)',
label: 'GPT-4o Realtime Preview (2024-10-01)',
description: 'Current snapshot for the Realtime API model. Supports low-latency, multimodal experiences including speech-to-speech capabilities.',
contextWindow: 128000,
maxCompletionTokens: 4096,
Expand All @@ -127,29 +165,69 @@ export const _knownOpenAIChatModels: ManualMappings = [
isPreview: true,
hidden: true,
},
{
idPrefix: 'gpt-4o-mini-realtime-preview',
label: 'GPT-4o Mini Realtime Preview',
description: 'Preview release for the Realtime API. Points to the latest snapshot of GPT-4o Mini Realtime Preview model: gpt-4o-mini-realtime-preview-2024-12-17.',
symLink: 'gpt-4o-mini-realtime-preview-2024-12-17',
hidden: true,
// copied from symlinked
contextWindow: 128000,
maxCompletionTokens: 4096,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_Realtime],
chatPrice: { input: 0.6, cache: { cType: 'oai-ac', read: 0.3 }, output: 2.4 },
isPreview: true,
},
{
idPrefix: 'gpt-4o-mini-realtime-preview-2024-12-17',
label: 'GPT-4o Mini Realtime Preview (2024-12-17)',
description: 'Snapshot for the Realtime API model. Supports low-latency, multimodal experiences including speech-to-speech capabilities.',
contextWindow: 128000,
maxCompletionTokens: 4096,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_Realtime],
chatPrice: { input: 0.6, cache: { cType: 'oai-ac', read: 0.3 }, output: 2.4 },
isPreview: true,
hidden: true,
},

// GPT-4o Audio Preview
{
idPrefix: 'gpt-4o-audio-preview',
label: 'GPT-4o Audio Preview',
description: 'Preview release for audio inputs in chat completions.',
symLink: 'gpt-4o-audio-preview-2024-10-01',
symLink: 'gpt-4o-audio-preview-2024-10-01', // will point to `gpt-4o-audio-preview-2024-12-17` on Jan 9, 2025
hidden: true,
// copied from symlinked
contextWindow: 128000,
maxCompletionTokens: 16384,
trainingDataCutoff: 'Oct 2023',
interfaces: [ /* Assuming audio interface */],
chatPrice: { input: 2.5, cache: { cType: 'oai-ac', read: 1.25 }, output: 10 /* TODO: AUDIO 100/200 */ },
interfaces: [LLM_IF_OAI_NeedsAudio],
chatPrice: { input: 2.5, output: 10 /* TODO: AUDIO 100/200 */ },
isPreview: true,
},
{
idPrefix: 'gpt-4o-audio-preview-2024-12-17',
label: 'GPT-4o Audio Preview (2024-12-17)',
description: 'Snapshot for the Audio API model.',
contextWindow: 128000,
maxCompletionTokens: 16384,
trainingDataCutoff: 'Oct 2023',
interfaces: [LLM_IF_OAI_NeedsAudio],
chatPrice: { input: 2.5, output: 10 /* TODO: AUDIO 40/80 */ },
isPreview: true,
hidden: true,
},
{
idPrefix: 'gpt-4o-audio-preview-2024-10-01',
label: 'GPT-4o Audio Preview (2024-10-01)',
description: 'Current snapshot for the Audio API model.',
contextWindow: 128000,
maxCompletionTokens: 16384,
trainingDataCutoff: 'Oct 2023',
interfaces: [ /* Assuming audio interface */],
chatPrice: { input: 2.5, cache: { cType: 'oai-ac', read: 1.25 }, output: 10 /* TODO: AUDIO 100/200 */ },
interfaces: [LLM_IF_OAI_NeedsAudio],
chatPrice: { input: 2.5, output: 10 /* TODO: AUDIO 100/200 */ },
isPreview: true,
hidden: true,
},
Expand Down

0 comments on commit a2942a3

Please sign in to comment.