-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmodel.utils.ts
More file actions
74 lines (65 loc) · 2.08 KB
/
Copy pathmodel.utils.ts
File metadata and controls
74 lines (65 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
export type ProviderName = 'bedrock' | 'openai' | 'anthropic'
export type BedrockModel = 'anthropic.claude-3-7-sonnet-20250219-v1:0' | 'openai.gpt-oss-120b-1:0'
export type OpenAIModel = 'gpt-5.3-codex' | 'gpt-5.4-nano'
export type AnthropicModel = 'claude-sonnet-4-20250514' | 'claude-3-5-haiku-20241022'
export type Model = BedrockModel | OpenAIModel | AnthropicModel
export type ProviderModelConfig = {
/** Optional providerOptions to attach to the system message for this model */
promptProviderOptions?: Record<string, any>
/** The default model for this provider (used when limited or no preferred specified) */
default: boolean
}
export type ProviderRegistry = {
bedrock: {
models: Record<BedrockModel, ProviderModelConfig>
providerOptions?: Record<string, any>
}
openai: {
models: Record<OpenAIModel, ProviderModelConfig>
providerOptions?: Record<string, any>
}
anthropic: {
models: Record<AnthropicModel, ProviderModelConfig>
providerOptions?: Record<string, any>
}
}
export const PROVIDERS: ProviderRegistry = {
bedrock: {
models: {
'anthropic.claude-3-7-sonnet-20250219-v1:0': {
promptProviderOptions: {
bedrock: {
// Always cache the system prompt (must not contain dynamic content)
cachePoint: { type: 'default' },
},
},
default: false,
},
'openai.gpt-oss-120b-1:0': {
default: true,
},
},
},
openai: {
models: {
'gpt-5.3-codex': { default: false },
'gpt-5.4-nano': { default: true },
},
providerOptions: {
openai: {
reasoningEffort: 'minimal',
},
},
},
anthropic: {
models: {
'claude-sonnet-4-20250514': { default: false },
'claude-3-5-haiku-20241022': { default: true },
},
},
}
export function getDefaultModelForProvider(provider: ProviderName): Model | undefined {
const models = PROVIDERS[provider]?.models as Record<Model, ProviderModelConfig>
if (!models) return undefined
return Object.keys(models).find((id) => models[id as Model]?.default) as Model | undefined
}