feat: add reasoning model (#750)
Co-authored-by: Matt Apperson <me@mattapperson.com>
This commit is contained in:
parent
76804269c4
commit
c61d4f91d4
19 changed files with 342 additions and 209 deletions
|
|
@ -1,25 +1,49 @@
|
|||
// Define your models here.
|
||||
import { openai } from '@ai-sdk/openai';
|
||||
import { fireworks } from '@ai-sdk/fireworks';
|
||||
import {
|
||||
customProvider,
|
||||
extractReasoningMiddleware,
|
||||
wrapLanguageModel,
|
||||
} from 'ai';
|
||||
|
||||
export interface Model {
|
||||
export const DEFAULT_CHAT_MODEL: string = 'chat-model-small';
|
||||
|
||||
export const myProvider = customProvider({
|
||||
languageModels: {
|
||||
'chat-model-small': openai('gpt-4o-mini'),
|
||||
'chat-model-large': openai('gpt-4o'),
|
||||
'chat-model-reasoning': wrapLanguageModel({
|
||||
model: fireworks('accounts/fireworks/models/deepseek-r1'),
|
||||
middleware: extractReasoningMiddleware({ tagName: 'think' }),
|
||||
}),
|
||||
'title-model': openai('gpt-4-turbo'),
|
||||
'block-model': openai('gpt-4o-mini'),
|
||||
},
|
||||
imageModels: {
|
||||
'small-model': openai.image('dall-e-3'),
|
||||
},
|
||||
});
|
||||
|
||||
interface ChatModel {
|
||||
id: string;
|
||||
label: string;
|
||||
apiIdentifier: string;
|
||||
name: string;
|
||||
description: string;
|
||||
}
|
||||
|
||||
export const models: Array<Model> = [
|
||||
export const chatModels: Array<ChatModel> = [
|
||||
{
|
||||
id: 'gpt-4o-mini',
|
||||
label: 'GPT 4o mini',
|
||||
apiIdentifier: 'gpt-4o-mini',
|
||||
id: 'chat-model-small',
|
||||
name: 'Small model',
|
||||
description: 'Small model for fast, lightweight tasks',
|
||||
},
|
||||
{
|
||||
id: 'gpt-4o',
|
||||
label: 'GPT 4o',
|
||||
apiIdentifier: 'gpt-4o',
|
||||
description: 'For complex, multi-step tasks',
|
||||
id: 'chat-model-large',
|
||||
name: 'Large model',
|
||||
description: 'Large model for complex, multi-step tasks',
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const DEFAULT_MODEL_NAME: string = 'gpt-4o-mini';
|
||||
{
|
||||
id: 'chat-model-reasoning',
|
||||
name: 'Reasoning model',
|
||||
description: 'Uses advanced reasoning',
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue