| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461 |
- import { ModelInfo, ProviderName, ProviderSettings } from "../schemas"
- export type { ModelInfo, ProviderName as ApiProvider }
- export type ApiHandlerOptions = Omit<ProviderSettings, "apiProvider" | "id">
- export type ApiConfiguration = ProviderSettings
- // Anthropic
- // https://docs.anthropic.com/en/docs/about-claude/models
- export type AnthropicModelId = keyof typeof anthropicModels
- export const anthropicDefaultModelId: AnthropicModelId = "claude-3-7-sonnet-20250219"
- export const anthropicModels = {
- "claude-3-7-sonnet-20250219:thinking": {
- maxTokens: 128_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0, // $3 per million input tokens
- outputPrice: 15.0, // $15 per million output tokens
- cacheWritesPrice: 3.75, // $3.75 per million tokens
- cacheReadsPrice: 0.3, // $0.30 per million tokens
- thinking: true,
- },
- "claude-3-7-sonnet-20250219": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0, // $3 per million input tokens
- outputPrice: 15.0, // $15 per million output tokens
- cacheWritesPrice: 3.75, // $3.75 per million tokens
- cacheReadsPrice: 0.3, // $0.30 per million tokens
- thinking: false,
- },
- "claude-3-5-sonnet-20241022": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0, // $3 per million input tokens
- outputPrice: 15.0, // $15 per million output tokens
- cacheWritesPrice: 3.75, // $3.75 per million tokens
- cacheReadsPrice: 0.3, // $0.30 per million tokens
- },
- "claude-3-5-haiku-20241022": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 1.0,
- outputPrice: 5.0,
- cacheWritesPrice: 1.25,
- cacheReadsPrice: 0.1,
- },
- "claude-3-opus-20240229": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 15.0,
- outputPrice: 75.0,
- cacheWritesPrice: 18.75,
- cacheReadsPrice: 1.5,
- },
- "claude-3-haiku-20240307": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 0.25,
- outputPrice: 1.25,
- cacheWritesPrice: 0.3,
- cacheReadsPrice: 0.03,
- },
- } as const satisfies Record<string, ModelInfo> // as const assertion makes the object deeply readonly
- // Amazon Bedrock
- // https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
- export interface MessageContent {
- type: "text" | "image" | "video" | "tool_use" | "tool_result"
- text?: string
- source?: {
- type: "base64"
- data: string | Uint8Array // string for Anthropic, Uint8Array for Bedrock
- media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
- }
- // Video specific fields
- format?: string
- s3Location?: {
- uri: string
- bucketOwner?: string
- }
- // Tool use and result fields
- toolUseId?: string
- name?: string
- input?: any
- output?: any // Used for tool_result type
- }
- export type BedrockModelId = keyof typeof bedrockModels
- export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-3-7-sonnet-20250219-v1:0"
- export const bedrockDefaultPromptRouterModelId: BedrockModelId = "anthropic.claude-3-sonnet-20240229-v1:0"
- // March, 12 2025 - updated prices to match US-West-2 list price shown at https://aws.amazon.com/bedrock/pricing/
- // including older models that are part of the default prompt routers AWS enabled for GA of the promot router feature
- export const bedrockModels = {
- "amazon.nova-pro-v1:0": {
- maxTokens: 5000,
- contextWindow: 300_000,
- supportsImages: true,
- supportsComputerUse: false,
- supportsPromptCache: true,
- inputPrice: 0.8,
- outputPrice: 3.2,
- cacheWritesPrice: 0.8, // per million tokens
- cacheReadsPrice: 0.2, // per million tokens
- minTokensPerCachePoint: 1,
- maxCachePoints: 1,
- cachableFields: ["system"],
- },
- "amazon.nova-pro-latency-optimized-v1:0": {
- maxTokens: 5000,
- contextWindow: 300_000,
- supportsImages: true,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 1.0,
- outputPrice: 4.0,
- cacheWritesPrice: 1.0, // per million tokens
- cacheReadsPrice: 0.25, // per million tokens
- description: "Amazon Nova Pro with latency optimized inference",
- },
- "amazon.nova-lite-v1:0": {
- maxTokens: 5000,
- contextWindow: 300_000,
- supportsImages: true,
- supportsComputerUse: false,
- supportsPromptCache: true,
- inputPrice: 0.06,
- outputPrice: 0.24,
- cacheWritesPrice: 0.06, // per million tokens
- cacheReadsPrice: 0.015, // per million tokens
- minTokensPerCachePoint: 1,
- maxCachePoints: 1,
- cachableFields: ["system"],
- },
- "amazon.nova-micro-v1:0": {
- maxTokens: 5000,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: true,
- inputPrice: 0.035,
- outputPrice: 0.14,
- cacheWritesPrice: 0.035, // per million tokens
- cacheReadsPrice: 0.00875, // per million tokens
- minTokensPerCachePoint: 1,
- maxCachePoints: 1,
- cachableFields: ["system"],
- },
- "anthropic.claude-3-7-sonnet-20250219-v1:0": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- minTokensPerCachePoint: 1024,
- maxCachePoints: 4,
- cachableFields: ["system", "messages", "tools"],
- },
- "anthropic.claude-3-5-sonnet-20241022-v2:0": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- minTokensPerCachePoint: 1024,
- maxCachePoints: 4,
- cachableFields: ["system", "messages", "tools"],
- },
- "anthropic.claude-3-5-haiku-20241022-v1:0": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 0.8,
- outputPrice: 4.0,
- cacheWritesPrice: 1.0,
- cacheReadsPrice: 0.08,
- minTokensPerCachePoint: 2048,
- maxCachePoints: 4,
- cachableFields: ["system", "messages", "tools"],
- },
- "anthropic.claude-3-5-sonnet-20240620-v1:0": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 3.0,
- outputPrice: 15.0,
- },
- "anthropic.claude-3-opus-20240229-v1:0": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 15.0,
- outputPrice: 75.0,
- },
- "anthropic.claude-3-sonnet-20240229-v1:0": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 3.0,
- outputPrice: 15.0,
- },
- "anthropic.claude-3-haiku-20240307-v1:0": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.25,
- outputPrice: 1.25,
- },
- "anthropic.claude-2-1-v1:0": {
- maxTokens: 4096,
- contextWindow: 100_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 8.0,
- outputPrice: 24.0,
- description: "Claude 2.1",
- },
- "anthropic.claude-2-0-v1:0": {
- maxTokens: 4096,
- contextWindow: 100_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 8.0,
- outputPrice: 24.0,
- description: "Claude 2.0",
- },
- "anthropic.claude-instant-v1:0": {
- maxTokens: 4096,
- contextWindow: 100_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.8,
- outputPrice: 2.4,
- description: "Claude Instant",
- },
- "deepseek.r1-v1:0": {
- maxTokens: 32_768,
- contextWindow: 128_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 1.35,
- outputPrice: 5.4,
- },
- "meta.llama3-3-70b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.72,
- outputPrice: 0.72,
- description: "Llama 3.3 Instruct (70B)",
- },
- "meta.llama3-2-90b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: true,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.72,
- outputPrice: 0.72,
- description: "Llama 3.2 Instruct (90B)",
- },
- "meta.llama3-2-11b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: true,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.16,
- outputPrice: 0.16,
- description: "Llama 3.2 Instruct (11B)",
- },
- "meta.llama3-2-3b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 0.15,
- description: "Llama 3.2 Instruct (3B)",
- },
- "meta.llama3-2-1b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.1,
- outputPrice: 0.1,
- description: "Llama 3.2 Instruct (1B)",
- },
- "meta.llama3-1-405b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 2.4,
- outputPrice: 2.4,
- description: "Llama 3.1 Instruct (405B)",
- },
- "meta.llama3-1-70b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.72,
- outputPrice: 0.72,
- description: "Llama 3.1 Instruct (70B)",
- },
- "meta.llama3-1-70b-instruct-latency-optimized-v1:0": {
- maxTokens: 8192,
- contextWindow: 128_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.9,
- outputPrice: 0.9,
- description: "Llama 3.1 Instruct (70B) (w/ latency optimized inference)",
- },
- "meta.llama3-1-8b-instruct-v1:0": {
- maxTokens: 8192,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.22,
- outputPrice: 0.22,
- description: "Llama 3.1 Instruct (8B)",
- },
- "meta.llama3-70b-instruct-v1:0": {
- maxTokens: 2048,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 2.65,
- outputPrice: 3.5,
- },
- "meta.llama3-8b-instruct-v1:0": {
- maxTokens: 2048,
- contextWindow: 4_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.3,
- outputPrice: 0.6,
- },
- "amazon.titan-text-lite-v1:0": {
- maxTokens: 4096,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 0.2,
- description: "Amazon Titan Text Lite",
- },
- "amazon.titan-text-express-v1:0": {
- maxTokens: 4096,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.2,
- outputPrice: 0.6,
- description: "Amazon Titan Text Express",
- },
- "amazon.titan-text-embeddings-v1:0": {
- maxTokens: 8192,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.1,
- description: "Amazon Titan Text Embeddings",
- },
- "amazon.titan-text-embeddings-v2:0": {
- maxTokens: 8192,
- contextWindow: 8_000,
- supportsImages: false,
- supportsComputerUse: false,
- supportsPromptCache: false,
- inputPrice: 0.02,
- description: "Amazon Titan Text Embeddings V2",
- },
- } as const satisfies Record<string, ModelInfo>
- // Glama
- // https://glama.ai/models
- export const glamaDefaultModelId = "anthropic/claude-3-7-sonnet"
- export const glamaDefaultModelInfo: ModelInfo = {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- description:
- "Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
- }
- // Requesty
- // https://requesty.ai/router-2
- export const requestyDefaultModelId = "anthropic/claude-3-7-sonnet-latest"
- export const requestyDefaultModelInfo: ModelInfo = {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- description:
- "Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
- }
- // OpenRouter
- // https://openrouter.ai/models?order=newest&supported_parameters=tools
- export const openRouterDefaultModelId = "anthropic/claude-3.7-sonnet"
- export const openRouterDefaultModelInfo: ModelInfo = {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- description:
- "Claude 3.7 Sonnet is an advanced large language model with improved reasoning, coding, and problem-solving capabilities. It introduces a hybrid reasoning approach, allowing users to choose between rapid responses and extended, step-by-step processing for complex tasks. The model demonstrates notable improvements in coding, particularly in front-end development and full-stack updates, and excels in agentic workflows, where it can autonomously navigate multi-step processes. Claude 3.7 Sonnet maintains performance parity with its predecessor in standard mode while offering an extended reasoning mode for enhanced accuracy in math, coding, and instruction-following tasks. Read more at the [blog post here](https://www.anthropic.com/news/claude-3-7-sonnet)",
- }
- // Vertex AI
- // https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
- export type VertexModelId = keyof typeof vertexModels
- export const vertexDefaultModelId: VertexModelId = "claude-3-7-sonnet@20250219"
- export const vertexModels = {
- "gemini-2.5-flash-preview-04-17:thinking": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 3.5,
- thinking: true,
- maxThinkingTokens: 24_576,
- },
- "gemini-2.5-flash-preview-04-17": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 0.6,
- thinking: false,
- },
- "gemini-2.5-pro-preview-03-25": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 2.5,
- outputPrice: 15,
- },
- "gemini-2.5-pro-exp-03-25": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-pro-exp-02-05": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-flash-001": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 0.15,
- outputPrice: 0.6,
- },
- "gemini-2.0-flash-lite-001": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.075,
- outputPrice: 0.3,
- },
- "gemini-2.0-flash-thinking-exp-01-21": {
- maxTokens: 8192,
- contextWindow: 32_768,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-1.5-flash-002": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 0.075,
- outputPrice: 0.3,
- },
- "gemini-1.5-pro-002": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 1.25,
- outputPrice: 5,
- },
- "claude-3-7-sonnet@20250219:thinking": {
- maxTokens: 64_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- thinking: true,
- },
- "claude-3-7-sonnet@20250219": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- thinking: false,
- },
- "claude-3-5-sonnet-v2@20241022": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsComputerUse: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- },
- "claude-3-5-sonnet@20240620": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- },
- "claude-3-5-haiku@20241022": {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 1.0,
- outputPrice: 5.0,
- cacheWritesPrice: 1.25,
- cacheReadsPrice: 0.1,
- },
- "claude-3-opus@20240229": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 15.0,
- outputPrice: 75.0,
- cacheWritesPrice: 18.75,
- cacheReadsPrice: 1.5,
- },
- "claude-3-haiku@20240307": {
- maxTokens: 4096,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 0.25,
- outputPrice: 1.25,
- cacheWritesPrice: 0.3,
- cacheReadsPrice: 0.03,
- },
- } as const satisfies Record<string, ModelInfo>
- export const openAiModelInfoSaneDefaults: ModelInfo = {
- maxTokens: -1,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- }
- // Gemini
- // https://ai.google.dev/gemini-api/docs/models/gemini
- export type GeminiModelId = keyof typeof geminiModels
- export const geminiDefaultModelId: GeminiModelId = "gemini-2.0-flash-001"
- export const geminiModels = {
- "gemini-2.5-flash-preview-04-17:thinking": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 3.5,
- thinking: true,
- maxThinkingTokens: 24_576,
- },
- "gemini-2.5-flash-preview-04-17": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0.15,
- outputPrice: 0.6,
- thinking: false,
- },
- "gemini-2.5-pro-exp-03-25": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.5-pro-preview-03-25": {
- maxTokens: 65_535,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
- outputPrice: 15,
- cacheReadsPrice: 0.625,
- cacheWritesPrice: 4.5,
- tiers: [
- {
- contextWindow: 200_000,
- inputPrice: 1.25,
- outputPrice: 10,
- cacheReadsPrice: 0.31,
- },
- {
- contextWindow: Infinity,
- inputPrice: 2.5,
- outputPrice: 15,
- cacheReadsPrice: 0.625,
- },
- ],
- },
- "gemini-2.0-flash-001": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 0.1,
- outputPrice: 0.4,
- cacheReadsPrice: 0.025,
- cacheWritesPrice: 1.0,
- },
- "gemini-2.0-flash-lite-preview-02-05": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-pro-exp-02-05": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-flash-thinking-exp-01-21": {
- maxTokens: 65_536,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-flash-thinking-exp-1219": {
- maxTokens: 8192,
- contextWindow: 32_767,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-2.0-flash-exp": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-1.5-flash-002": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: true,
- isPromptCacheOptional: true,
- inputPrice: 0.15, // This is the pricing for prompts above 128k tokens.
- outputPrice: 0.6,
- cacheReadsPrice: 0.0375,
- cacheWritesPrice: 1.0,
- tiers: [
- {
- contextWindow: 128_000,
- inputPrice: 0.075,
- outputPrice: 0.3,
- cacheReadsPrice: 0.01875,
- },
- {
- contextWindow: Infinity,
- inputPrice: 0.15,
- outputPrice: 0.6,
- cacheReadsPrice: 0.0375,
- },
- ],
- },
- "gemini-1.5-flash-exp-0827": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-1.5-flash-8b-exp-0827": {
- maxTokens: 8192,
- contextWindow: 1_048_576,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-1.5-pro-002": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-1.5-pro-exp-0827": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- "gemini-exp-1206": {
- maxTokens: 8192,
- contextWindow: 2_097_152,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- },
- } as const satisfies Record<string, ModelInfo>
- // OpenAI Native
- // https://openai.com/api/pricing/
- export type OpenAiNativeModelId = keyof typeof openAiNativeModels
- export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4.1"
- export const openAiNativeModels = {
- "gpt-4.1": {
- maxTokens: 32_768,
- contextWindow: 1_047_576,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 2,
- outputPrice: 8,
- cacheReadsPrice: 0.5,
- },
- "gpt-4.1-mini": {
- maxTokens: 32_768,
- contextWindow: 1_047_576,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 0.4,
- outputPrice: 1.6,
- cacheReadsPrice: 0.1,
- },
- "gpt-4.1-nano": {
- maxTokens: 32_768,
- contextWindow: 1_047_576,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 0.1,
- outputPrice: 0.4,
- cacheReadsPrice: 0.025,
- },
- o3: {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 10.0,
- outputPrice: 40.0,
- cacheReadsPrice: 2.5,
- reasoningEffort: "medium",
- },
- "o3-high": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 10.0,
- outputPrice: 40.0,
- cacheReadsPrice: 2.5,
- reasoningEffort: "high",
- },
- "o3-low": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 10.0,
- outputPrice: 40.0,
- cacheReadsPrice: 2.5,
- reasoningEffort: "low",
- },
- "o4-mini": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.275,
- reasoningEffort: "medium",
- },
- "o4-mini-high": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.275,
- reasoningEffort: "high",
- },
- "o4-mini-low": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.275,
- reasoningEffort: "low",
- },
- "o3-mini": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.55,
- reasoningEffort: "medium",
- },
- "o3-mini-high": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.55,
- reasoningEffort: "high",
- },
- "o3-mini-low": {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.55,
- reasoningEffort: "low",
- },
- o1: {
- maxTokens: 100_000,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 15,
- outputPrice: 60,
- cacheReadsPrice: 7.5,
- },
- "o1-preview": {
- maxTokens: 32_768,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 15,
- outputPrice: 60,
- cacheReadsPrice: 7.5,
- },
- "o1-mini": {
- maxTokens: 65_536,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 1.1,
- outputPrice: 4.4,
- cacheReadsPrice: 0.55,
- },
- "gpt-4.5-preview": {
- maxTokens: 16_384,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 75,
- outputPrice: 150,
- cacheReadsPrice: 37.5,
- },
- "gpt-4o": {
- maxTokens: 16_384,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 2.5,
- outputPrice: 10,
- cacheReadsPrice: 1.25,
- },
- "gpt-4o-mini": {
- maxTokens: 16_384,
- contextWindow: 128_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 0.15,
- outputPrice: 0.6,
- cacheReadsPrice: 0.075,
- },
- } as const satisfies Record<string, ModelInfo>
- // DeepSeek
- // https://platform.deepseek.com/docs/api
- export type DeepSeekModelId = keyof typeof deepSeekModels
- export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
- export const deepSeekModels = {
- "deepseek-chat": {
- maxTokens: 8192,
- contextWindow: 64_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 0.27, // $0.27 per million tokens (cache miss)
- outputPrice: 1.1, // $1.10 per million tokens
- cacheWritesPrice: 0.27, // $0.27 per million tokens (cache miss)
- cacheReadsPrice: 0.07, // $0.07 per million tokens (cache hit).
- description: `DeepSeek-V3 achieves a significant breakthrough in inference speed over previous models. It tops the leaderboard among open-source models and rivals the most advanced closed-source models globally.`,
- },
- "deepseek-reasoner": {
- maxTokens: 8192,
- contextWindow: 64_000,
- supportsImages: false,
- supportsPromptCache: true,
- inputPrice: 0.55, // $0.55 per million tokens (cache miss)
- outputPrice: 2.19, // $2.19 per million tokens
- cacheWritesPrice: 0.55, // $0.55 per million tokens (cache miss)
- cacheReadsPrice: 0.14, // $0.14 per million tokens (cache hit)
- description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks. Supports Chain of Thought reasoning with up to 32K tokens.`,
- },
- } as const satisfies Record<string, ModelInfo>
- // Azure OpenAI
- // https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
- // https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
- export const azureOpenAiDefaultApiVersion = "2024-08-01-preview"
- // Mistral
- // https://docs.mistral.ai/getting-started/models/models_overview/
- export type MistralModelId = keyof typeof mistralModels
- export const mistralDefaultModelId: MistralModelId = "codestral-latest"
- export const mistralModels = {
- "codestral-latest": {
- maxTokens: 256_000,
- contextWindow: 256_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.3,
- outputPrice: 0.9,
- },
- "mistral-large-latest": {
- maxTokens: 131_000,
- contextWindow: 131_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 6.0,
- },
- "ministral-8b-latest": {
- maxTokens: 131_000,
- contextWindow: 131_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.1,
- outputPrice: 0.1,
- },
- "ministral-3b-latest": {
- maxTokens: 131_000,
- contextWindow: 131_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.04,
- outputPrice: 0.04,
- },
- "mistral-small-latest": {
- maxTokens: 32_000,
- contextWindow: 32_000,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.2,
- outputPrice: 0.6,
- },
- "pixtral-large-latest": {
- maxTokens: 131_000,
- contextWindow: 131_000,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 6.0,
- },
- } as const satisfies Record<string, ModelInfo>
- // Unbound Security
- // https://www.unboundsecurity.ai/ai-gateway
- export const unboundDefaultModelId = "anthropic/claude-3-7-sonnet-20250219"
- export const unboundDefaultModelInfo: ModelInfo = {
- maxTokens: 8192,
- contextWindow: 200_000,
- supportsImages: true,
- supportsPromptCache: true,
- inputPrice: 3.0,
- outputPrice: 15.0,
- cacheWritesPrice: 3.75,
- cacheReadsPrice: 0.3,
- }
- // xAI
- // https://docs.x.ai/docs/api-reference
- export type XAIModelId = keyof typeof xaiModels
- export const xaiDefaultModelId: XAIModelId = "grok-3-beta"
- export const xaiModels = {
- "grok-3-beta": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 3.0,
- outputPrice: 15.0,
- description: "xAI's Grok-3 beta model with 131K context window",
- },
- "grok-3-fast-beta": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 5.0,
- outputPrice: 25.0,
- description: "xAI's Grok-3 fast beta model with 131K context window",
- },
- "grok-3-mini-beta": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.3,
- outputPrice: 0.5,
- description: "xAI's Grok-3 mini beta model with 131K context window",
- },
- "grok-3-mini-fast-beta": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0.6,
- outputPrice: 4.0,
- description: "xAI's Grok-3 mini fast beta model with 131K context window",
- },
- "grok-2-latest": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 model - latest version with 131K context window",
- },
- "grok-2": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 model with 131K context window",
- },
- "grok-2-1212": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 model (version 1212) with 131K context window",
- },
- "grok-2-vision-latest": {
- maxTokens: 8192,
- contextWindow: 32768,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 Vision model - latest version with image support and 32K context window",
- },
- "grok-2-vision": {
- maxTokens: 8192,
- contextWindow: 32768,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 Vision model with image support and 32K context window",
- },
- "grok-2-vision-1212": {
- maxTokens: 8192,
- contextWindow: 32768,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 2.0,
- outputPrice: 10.0,
- description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window",
- },
- "grok-vision-beta": {
- maxTokens: 8192,
- contextWindow: 8192,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 5.0,
- outputPrice: 15.0,
- description: "xAI's Grok Vision Beta model with image support and 8K context window",
- },
- "grok-beta": {
- maxTokens: 8192,
- contextWindow: 131072,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 5.0,
- outputPrice: 15.0,
- description: "xAI's Grok Beta model (legacy) with 131K context window",
- },
- } as const satisfies Record<string, ModelInfo>
- export type VscodeLlmModelId = keyof typeof vscodeLlmModels
- export const vscodeLlmDefaultModelId: VscodeLlmModelId = "claude-3.5-sonnet"
- export const vscodeLlmModels = {
- "gpt-3.5-turbo": {
- contextWindow: 12114,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-3.5-turbo",
- version: "gpt-3.5-turbo-0613",
- name: "GPT 3.5 Turbo",
- supportsToolCalling: true,
- maxInputTokens: 12114,
- },
- "gpt-4o-mini": {
- contextWindow: 12115,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-4o-mini",
- version: "gpt-4o-mini-2024-07-18",
- name: "GPT-4o mini",
- supportsToolCalling: true,
- maxInputTokens: 12115,
- },
- "gpt-4": {
- contextWindow: 28501,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-4",
- version: "gpt-4-0613",
- name: "GPT 4",
- supportsToolCalling: true,
- maxInputTokens: 28501,
- },
- "gpt-4-0125-preview": {
- contextWindow: 63826,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-4-turbo",
- version: "gpt-4-0125-preview",
- name: "GPT 4 Turbo",
- supportsToolCalling: true,
- maxInputTokens: 63826,
- },
- "gpt-4o": {
- contextWindow: 63827,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-4o",
- version: "gpt-4o-2024-11-20",
- name: "GPT-4o",
- supportsToolCalling: true,
- maxInputTokens: 63827,
- },
- o1: {
- contextWindow: 19827,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "o1-ga",
- version: "o1-2024-12-17",
- name: "o1 (Preview)",
- supportsToolCalling: true,
- maxInputTokens: 19827,
- },
- "o3-mini": {
- contextWindow: 63827,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "o3-mini",
- version: "o3-mini-2025-01-31",
- name: "o3-mini",
- supportsToolCalling: true,
- maxInputTokens: 63827,
- },
- "claude-3.5-sonnet": {
- contextWindow: 81638,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "claude-3.5-sonnet",
- version: "claude-3.5-sonnet",
- name: "Claude 3.5 Sonnet",
- supportsToolCalling: true,
- maxInputTokens: 81638,
- },
- "claude-3.7-sonnet": {
- contextWindow: 89827,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "claude-3.7-sonnet",
- version: "claude-3.7-sonnet",
- name: "Claude 3.7 Sonnet",
- supportsToolCalling: true,
- maxInputTokens: 89827,
- },
- "claude-3.7-sonnet-thought": {
- contextWindow: 89827,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "claude-3.7-sonnet-thought",
- version: "claude-3.7-sonnet-thought",
- name: "Claude 3.7 Sonnet Thinking",
- supportsToolCalling: false,
- maxInputTokens: 89827,
- thinking: true,
- },
- "gemini-2.0-flash-001": {
- contextWindow: 127827,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gemini-2.0-flash",
- version: "gemini-2.0-flash-001",
- name: "Gemini 2.0 Flash",
- supportsToolCalling: false,
- maxInputTokens: 127827,
- },
- "gemini-2.5-pro": {
- contextWindow: 63830,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gemini-2.5-pro",
- version: "gemini-2.5-pro-preview-03-25",
- name: "Gemini 2.5 Pro (Preview)",
- supportsToolCalling: true,
- maxInputTokens: 63830,
- },
- "o4-mini": {
- contextWindow: 111446,
- supportsImages: false,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "o4-mini",
- version: "o4-mini-2025-04-16",
- name: "o4-mini (Preview)",
- supportsToolCalling: true,
- maxInputTokens: 111446,
- },
- "gpt-4.1": {
- contextWindow: 111446,
- supportsImages: true,
- supportsPromptCache: false,
- inputPrice: 0,
- outputPrice: 0,
- family: "gpt-4.1",
- version: "gpt-4.1-2025-04-14",
- name: "GPT-4.1 (Preview)",
- supportsToolCalling: true,
- maxInputTokens: 111446,
- },
- } as const satisfies Record<
- string,
- ModelInfo & {
- family: string
- version: string
- name: string
- supportsToolCalling: boolean
- maxInputTokens: number
- }
- >
- /**
- * Constants
- */
- // These models support reasoning efforts.
- export const REASONING_MODELS = new Set(["x-ai/grok-3-mini-beta", "grok-3-mini-beta", "grok-3-mini-fast-beta"])
- // These models support prompt caching.
- export const PROMPT_CACHING_MODELS = new Set([
- "anthropic/claude-3-haiku",
- "anthropic/claude-3-haiku:beta",
- "anthropic/claude-3-opus",
- "anthropic/claude-3-opus:beta",
- "anthropic/claude-3-sonnet",
- "anthropic/claude-3-sonnet:beta",
- "anthropic/claude-3.5-haiku",
- "anthropic/claude-3.5-haiku-20241022",
- "anthropic/claude-3.5-haiku-20241022:beta",
- "anthropic/claude-3.5-haiku:beta",
- "anthropic/claude-3.5-sonnet",
- "anthropic/claude-3.5-sonnet-20240620",
- "anthropic/claude-3.5-sonnet-20240620:beta",
- "anthropic/claude-3.5-sonnet:beta",
- "anthropic/claude-3.7-sonnet",
- "anthropic/claude-3.7-sonnet:beta",
- "anthropic/claude-3.7-sonnet:thinking",
- "google/gemini-2.5-pro-preview-03-25",
- "google/gemini-2.0-flash-001",
- "google/gemini-flash-1.5",
- "google/gemini-flash-1.5-8b",
- ])
- // These models don't have prompt caching enabled by default (you can turn it on
- // in settings).
- export const OPTIONAL_PROMPT_CACHING_MODELS = new Set([
- "google/gemini-2.5-pro-preview-03-25",
- "google/gemini-2.0-flash-001",
- "google/gemini-flash-1.5",
- "google/gemini-flash-1.5-8b",
- ])
- // https://www.anthropic.com/news/3-5-models-and-computer-use
- export const COMPUTER_USE_MODELS = new Set([
- "anthropic/claude-3.5-sonnet",
- "anthropic/claude-3.5-sonnet:beta",
- "anthropic/claude-3.7-sonnet",
- "anthropic/claude-3.7-sonnet:beta",
- "anthropic/claude-3.7-sonnet:thinking",
- ])
- const routerNames = ["openrouter", "requesty", "glama", "unbound"] as const
- export type RouterName = (typeof routerNames)[number]
- export const isRouterName = (value: string): value is RouterName => routerNames.includes(value as RouterName)
- export type ModelRecord = Record<string, ModelInfo>
- export type RouterModels = Record<RouterName, ModelRecord>
|