api.ts 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763
  1. import { ModelInfo, ProviderName, ProviderSettings } from "../schemas"
  2. export type { ModelInfo, ProviderName }
  3. export type ApiHandlerOptions = Omit<ProviderSettings, "apiProvider" | "id">
  4. export type ApiConfiguration = ProviderSettings
  5. // Anthropic
  6. // https://docs.anthropic.com/en/docs/about-claude/models
  7. export type AnthropicModelId = keyof typeof anthropicModels
  8. export const anthropicDefaultModelId: AnthropicModelId = "claude-3-7-sonnet-20250219"
  9. export const anthropicModels = {
  10. "claude-3-7-sonnet-20250219:thinking": {
  11. maxTokens: 128_000,
  12. contextWindow: 200_000,
  13. supportsImages: true,
  14. supportsComputerUse: true,
  15. supportsPromptCache: true,
  16. inputPrice: 3.0, // $3 per million input tokens
  17. outputPrice: 15.0, // $15 per million output tokens
  18. cacheWritesPrice: 3.75, // $3.75 per million tokens
  19. cacheReadsPrice: 0.3, // $0.30 per million tokens
  20. thinking: true,
  21. },
  22. "claude-3-7-sonnet-20250219": {
  23. maxTokens: 8192,
  24. contextWindow: 200_000,
  25. supportsImages: true,
  26. supportsComputerUse: true,
  27. supportsPromptCache: true,
  28. inputPrice: 3.0, // $3 per million input tokens
  29. outputPrice: 15.0, // $15 per million output tokens
  30. cacheWritesPrice: 3.75, // $3.75 per million tokens
  31. cacheReadsPrice: 0.3, // $0.30 per million tokens
  32. thinking: false,
  33. },
  34. "claude-3-5-sonnet-20241022": {
  35. maxTokens: 8192,
  36. contextWindow: 200_000,
  37. supportsImages: true,
  38. supportsComputerUse: true,
  39. supportsPromptCache: true,
  40. inputPrice: 3.0, // $3 per million input tokens
  41. outputPrice: 15.0, // $15 per million output tokens
  42. cacheWritesPrice: 3.75, // $3.75 per million tokens
  43. cacheReadsPrice: 0.3, // $0.30 per million tokens
  44. },
  45. "claude-3-5-haiku-20241022": {
  46. maxTokens: 8192,
  47. contextWindow: 200_000,
  48. supportsImages: false,
  49. supportsPromptCache: true,
  50. inputPrice: 1.0,
  51. outputPrice: 5.0,
  52. cacheWritesPrice: 1.25,
  53. cacheReadsPrice: 0.1,
  54. },
  55. "claude-3-opus-20240229": {
  56. maxTokens: 4096,
  57. contextWindow: 200_000,
  58. supportsImages: true,
  59. supportsPromptCache: true,
  60. inputPrice: 15.0,
  61. outputPrice: 75.0,
  62. cacheWritesPrice: 18.75,
  63. cacheReadsPrice: 1.5,
  64. },
  65. "claude-3-haiku-20240307": {
  66. maxTokens: 4096,
  67. contextWindow: 200_000,
  68. supportsImages: true,
  69. supportsPromptCache: true,
  70. inputPrice: 0.25,
  71. outputPrice: 1.25,
  72. cacheWritesPrice: 0.3,
  73. cacheReadsPrice: 0.03,
  74. },
  75. } as const satisfies Record<string, ModelInfo> // as const assertion makes the object deeply readonly
  76. // Amazon Bedrock
  77. // https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
  78. export interface MessageContent {
  79. type: "text" | "image" | "video" | "tool_use" | "tool_result"
  80. text?: string
  81. source?: {
  82. type: "base64"
  83. data: string | Uint8Array // string for Anthropic, Uint8Array for Bedrock
  84. media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
  85. }
  86. // Video specific fields
  87. format?: string
  88. s3Location?: {
  89. uri: string
  90. bucketOwner?: string
  91. }
  92. // Tool use and result fields
  93. toolUseId?: string
  94. name?: string
  95. input?: any
  96. output?: any // Used for tool_result type
  97. }
  98. export type BedrockModelId = keyof typeof bedrockModels
  99. export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-3-7-sonnet-20250219-v1:0"
  100. export const bedrockDefaultPromptRouterModelId: BedrockModelId = "anthropic.claude-3-sonnet-20240229-v1:0"
  101. // March, 12 2025 - updated prices to match US-West-2 list price shown at https://aws.amazon.com/bedrock/pricing/
  102. // including older models that are part of the default prompt routers AWS enabled for GA of the promot router feature
  103. export const bedrockModels = {
  104. "amazon.nova-pro-v1:0": {
  105. maxTokens: 5000,
  106. contextWindow: 300_000,
  107. supportsImages: true,
  108. supportsComputerUse: false,
  109. supportsPromptCache: true,
  110. inputPrice: 0.8,
  111. outputPrice: 3.2,
  112. cacheWritesPrice: 0.8, // per million tokens
  113. cacheReadsPrice: 0.2, // per million tokens
  114. minTokensPerCachePoint: 1,
  115. maxCachePoints: 1,
  116. cachableFields: ["system"],
  117. },
  118. "amazon.nova-pro-latency-optimized-v1:0": {
  119. maxTokens: 5000,
  120. contextWindow: 300_000,
  121. supportsImages: true,
  122. supportsComputerUse: false,
  123. supportsPromptCache: false,
  124. inputPrice: 1.0,
  125. outputPrice: 4.0,
  126. cacheWritesPrice: 1.0, // per million tokens
  127. cacheReadsPrice: 0.25, // per million tokens
  128. description: "Amazon Nova Pro with latency optimized inference",
  129. },
  130. "amazon.nova-lite-v1:0": {
  131. maxTokens: 5000,
  132. contextWindow: 300_000,
  133. supportsImages: true,
  134. supportsComputerUse: false,
  135. supportsPromptCache: true,
  136. inputPrice: 0.06,
  137. outputPrice: 0.24,
  138. cacheWritesPrice: 0.06, // per million tokens
  139. cacheReadsPrice: 0.015, // per million tokens
  140. minTokensPerCachePoint: 1,
  141. maxCachePoints: 1,
  142. cachableFields: ["system"],
  143. },
  144. "amazon.nova-micro-v1:0": {
  145. maxTokens: 5000,
  146. contextWindow: 128_000,
  147. supportsImages: false,
  148. supportsComputerUse: false,
  149. supportsPromptCache: true,
  150. inputPrice: 0.035,
  151. outputPrice: 0.14,
  152. cacheWritesPrice: 0.035, // per million tokens
  153. cacheReadsPrice: 0.00875, // per million tokens
  154. minTokensPerCachePoint: 1,
  155. maxCachePoints: 1,
  156. cachableFields: ["system"],
  157. },
  158. "anthropic.claude-3-7-sonnet-20250219-v1:0": {
  159. maxTokens: 8192,
  160. contextWindow: 200_000,
  161. supportsImages: true,
  162. supportsComputerUse: true,
  163. supportsPromptCache: true,
  164. inputPrice: 3.0,
  165. outputPrice: 15.0,
  166. cacheWritesPrice: 3.75,
  167. cacheReadsPrice: 0.3,
  168. minTokensPerCachePoint: 1024,
  169. maxCachePoints: 4,
  170. cachableFields: ["system", "messages", "tools"],
  171. },
  172. "anthropic.claude-3-5-sonnet-20241022-v2:0": {
  173. maxTokens: 8192,
  174. contextWindow: 200_000,
  175. supportsImages: true,
  176. supportsComputerUse: true,
  177. supportsPromptCache: true,
  178. inputPrice: 3.0,
  179. outputPrice: 15.0,
  180. cacheWritesPrice: 3.75,
  181. cacheReadsPrice: 0.3,
  182. minTokensPerCachePoint: 1024,
  183. maxCachePoints: 4,
  184. cachableFields: ["system", "messages", "tools"],
  185. },
  186. "anthropic.claude-3-5-haiku-20241022-v1:0": {
  187. maxTokens: 8192,
  188. contextWindow: 200_000,
  189. supportsImages: false,
  190. supportsPromptCache: true,
  191. inputPrice: 0.8,
  192. outputPrice: 4.0,
  193. cacheWritesPrice: 1.0,
  194. cacheReadsPrice: 0.08,
  195. minTokensPerCachePoint: 2048,
  196. maxCachePoints: 4,
  197. cachableFields: ["system", "messages", "tools"],
  198. },
  199. "anthropic.claude-3-5-sonnet-20240620-v1:0": {
  200. maxTokens: 8192,
  201. contextWindow: 200_000,
  202. supportsImages: true,
  203. supportsPromptCache: false,
  204. inputPrice: 3.0,
  205. outputPrice: 15.0,
  206. },
  207. "anthropic.claude-3-opus-20240229-v1:0": {
  208. maxTokens: 4096,
  209. contextWindow: 200_000,
  210. supportsImages: true,
  211. supportsPromptCache: false,
  212. inputPrice: 15.0,
  213. outputPrice: 75.0,
  214. },
  215. "anthropic.claude-3-sonnet-20240229-v1:0": {
  216. maxTokens: 4096,
  217. contextWindow: 200_000,
  218. supportsImages: true,
  219. supportsPromptCache: false,
  220. inputPrice: 3.0,
  221. outputPrice: 15.0,
  222. },
  223. "anthropic.claude-3-haiku-20240307-v1:0": {
  224. maxTokens: 4096,
  225. contextWindow: 200_000,
  226. supportsImages: true,
  227. supportsPromptCache: false,
  228. inputPrice: 0.25,
  229. outputPrice: 1.25,
  230. },
  231. "anthropic.claude-2-1-v1:0": {
  232. maxTokens: 4096,
  233. contextWindow: 100_000,
  234. supportsImages: false,
  235. supportsPromptCache: false,
  236. inputPrice: 8.0,
  237. outputPrice: 24.0,
  238. description: "Claude 2.1",
  239. },
  240. "anthropic.claude-2-0-v1:0": {
  241. maxTokens: 4096,
  242. contextWindow: 100_000,
  243. supportsImages: false,
  244. supportsPromptCache: false,
  245. inputPrice: 8.0,
  246. outputPrice: 24.0,
  247. description: "Claude 2.0",
  248. },
  249. "anthropic.claude-instant-v1:0": {
  250. maxTokens: 4096,
  251. contextWindow: 100_000,
  252. supportsImages: false,
  253. supportsPromptCache: false,
  254. inputPrice: 0.8,
  255. outputPrice: 2.4,
  256. description: "Claude Instant",
  257. },
  258. "deepseek.r1-v1:0": {
  259. maxTokens: 32_768,
  260. contextWindow: 128_000,
  261. supportsImages: false,
  262. supportsPromptCache: false,
  263. inputPrice: 1.35,
  264. outputPrice: 5.4,
  265. },
  266. "meta.llama3-3-70b-instruct-v1:0": {
  267. maxTokens: 8192,
  268. contextWindow: 128_000,
  269. supportsImages: false,
  270. supportsComputerUse: false,
  271. supportsPromptCache: false,
  272. inputPrice: 0.72,
  273. outputPrice: 0.72,
  274. description: "Llama 3.3 Instruct (70B)",
  275. },
  276. "meta.llama3-2-90b-instruct-v1:0": {
  277. maxTokens: 8192,
  278. contextWindow: 128_000,
  279. supportsImages: true,
  280. supportsComputerUse: false,
  281. supportsPromptCache: false,
  282. inputPrice: 0.72,
  283. outputPrice: 0.72,
  284. description: "Llama 3.2 Instruct (90B)",
  285. },
  286. "meta.llama3-2-11b-instruct-v1:0": {
  287. maxTokens: 8192,
  288. contextWindow: 128_000,
  289. supportsImages: true,
  290. supportsComputerUse: false,
  291. supportsPromptCache: false,
  292. inputPrice: 0.16,
  293. outputPrice: 0.16,
  294. description: "Llama 3.2 Instruct (11B)",
  295. },
  296. "meta.llama3-2-3b-instruct-v1:0": {
  297. maxTokens: 8192,
  298. contextWindow: 128_000,
  299. supportsImages: false,
  300. supportsComputerUse: false,
  301. supportsPromptCache: false,
  302. inputPrice: 0.15,
  303. outputPrice: 0.15,
  304. description: "Llama 3.2 Instruct (3B)",
  305. },
  306. "meta.llama3-2-1b-instruct-v1:0": {
  307. maxTokens: 8192,
  308. contextWindow: 128_000,
  309. supportsImages: false,
  310. supportsComputerUse: false,
  311. supportsPromptCache: false,
  312. inputPrice: 0.1,
  313. outputPrice: 0.1,
  314. description: "Llama 3.2 Instruct (1B)",
  315. },
  316. "meta.llama3-1-405b-instruct-v1:0": {
  317. maxTokens: 8192,
  318. contextWindow: 128_000,
  319. supportsImages: false,
  320. supportsComputerUse: false,
  321. supportsPromptCache: false,
  322. inputPrice: 2.4,
  323. outputPrice: 2.4,
  324. description: "Llama 3.1 Instruct (405B)",
  325. },
  326. "meta.llama3-1-70b-instruct-v1:0": {
  327. maxTokens: 8192,
  328. contextWindow: 128_000,
  329. supportsImages: false,
  330. supportsComputerUse: false,
  331. supportsPromptCache: false,
  332. inputPrice: 0.72,
  333. outputPrice: 0.72,
  334. description: "Llama 3.1 Instruct (70B)",
  335. },
  336. "meta.llama3-1-70b-instruct-latency-optimized-v1:0": {
  337. maxTokens: 8192,
  338. contextWindow: 128_000,
  339. supportsImages: false,
  340. supportsComputerUse: false,
  341. supportsPromptCache: false,
  342. inputPrice: 0.9,
  343. outputPrice: 0.9,
  344. description: "Llama 3.1 Instruct (70B) (w/ latency optimized inference)",
  345. },
  346. "meta.llama3-1-8b-instruct-v1:0": {
  347. maxTokens: 8192,
  348. contextWindow: 8_000,
  349. supportsImages: false,
  350. supportsComputerUse: false,
  351. supportsPromptCache: false,
  352. inputPrice: 0.22,
  353. outputPrice: 0.22,
  354. description: "Llama 3.1 Instruct (8B)",
  355. },
  356. "meta.llama3-70b-instruct-v1:0": {
  357. maxTokens: 2048,
  358. contextWindow: 8_000,
  359. supportsImages: false,
  360. supportsComputerUse: false,
  361. supportsPromptCache: false,
  362. inputPrice: 2.65,
  363. outputPrice: 3.5,
  364. },
  365. "meta.llama3-8b-instruct-v1:0": {
  366. maxTokens: 2048,
  367. contextWindow: 4_000,
  368. supportsImages: false,
  369. supportsComputerUse: false,
  370. supportsPromptCache: false,
  371. inputPrice: 0.3,
  372. outputPrice: 0.6,
  373. },
  374. "amazon.titan-text-lite-v1:0": {
  375. maxTokens: 4096,
  376. contextWindow: 8_000,
  377. supportsImages: false,
  378. supportsComputerUse: false,
  379. supportsPromptCache: false,
  380. inputPrice: 0.15,
  381. outputPrice: 0.2,
  382. description: "Amazon Titan Text Lite",
  383. },
  384. "amazon.titan-text-express-v1:0": {
  385. maxTokens: 4096,
  386. contextWindow: 8_000,
  387. supportsImages: false,
  388. supportsComputerUse: false,
  389. supportsPromptCache: false,
  390. inputPrice: 0.2,
  391. outputPrice: 0.6,
  392. description: "Amazon Titan Text Express",
  393. },
  394. "amazon.titan-text-embeddings-v1:0": {
  395. maxTokens: 8192,
  396. contextWindow: 8_000,
  397. supportsImages: false,
  398. supportsComputerUse: false,
  399. supportsPromptCache: false,
  400. inputPrice: 0.1,
  401. description: "Amazon Titan Text Embeddings",
  402. },
  403. "amazon.titan-text-embeddings-v2:0": {
  404. maxTokens: 8192,
  405. contextWindow: 8_000,
  406. supportsImages: false,
  407. supportsComputerUse: false,
  408. supportsPromptCache: false,
  409. inputPrice: 0.02,
  410. description: "Amazon Titan Text Embeddings V2",
  411. },
  412. } as const satisfies Record<string, ModelInfo>
  413. // Glama
  414. // https://glama.ai/models
  415. export const glamaDefaultModelId = "anthropic/claude-3-7-sonnet"
  416. export const glamaDefaultModelInfo: ModelInfo = {
  417. maxTokens: 8192,
  418. contextWindow: 200_000,
  419. supportsImages: true,
  420. supportsComputerUse: true,
  421. supportsPromptCache: true,
  422. inputPrice: 3.0,
  423. outputPrice: 15.0,
  424. cacheWritesPrice: 3.75,
  425. cacheReadsPrice: 0.3,
  426. description:
  427. "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)",
  428. }
  429. // Requesty
  430. // https://requesty.ai/router-2
  431. export const requestyDefaultModelId = "coding/claude-3-7-sonnet"
  432. export const requestyDefaultModelInfo: ModelInfo = {
  433. maxTokens: 8192,
  434. contextWindow: 200_000,
  435. supportsImages: true,
  436. supportsComputerUse: true,
  437. supportsPromptCache: true,
  438. inputPrice: 3.0,
  439. outputPrice: 15.0,
  440. cacheWritesPrice: 3.75,
  441. cacheReadsPrice: 0.3,
  442. description:
  443. "The best coding model, optimized by Requesty, and automatically routed to the fastest provider. 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)",
  444. }
  445. // OpenRouter
  446. // https://openrouter.ai/models?order=newest&supported_parameters=tools
  447. export const openRouterDefaultModelId = "anthropic/claude-3.7-sonnet"
  448. export const openRouterDefaultModelInfo: ModelInfo = {
  449. maxTokens: 8192,
  450. contextWindow: 200_000,
  451. supportsImages: true,
  452. supportsComputerUse: true,
  453. supportsPromptCache: true,
  454. inputPrice: 3.0,
  455. outputPrice: 15.0,
  456. cacheWritesPrice: 3.75,
  457. cacheReadsPrice: 0.3,
  458. description:
  459. "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)",
  460. }
  461. // Vertex AI
  462. // https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
  463. export type VertexModelId = keyof typeof vertexModels
  464. export const vertexDefaultModelId: VertexModelId = "claude-3-7-sonnet@20250219"
  465. export const vertexModels = {
  466. "gemini-2.5-flash-preview-04-17:thinking": {
  467. maxTokens: 65_535,
  468. contextWindow: 1_048_576,
  469. supportsImages: true,
  470. supportsPromptCache: false,
  471. inputPrice: 0.15,
  472. outputPrice: 3.5,
  473. thinking: true,
  474. maxThinkingTokens: 24_576,
  475. },
  476. "gemini-2.5-flash-preview-04-17": {
  477. maxTokens: 65_535,
  478. contextWindow: 1_048_576,
  479. supportsImages: true,
  480. supportsPromptCache: false,
  481. inputPrice: 0.15,
  482. outputPrice: 0.6,
  483. thinking: false,
  484. },
  485. "gemini-2.5-pro-preview-03-25": {
  486. maxTokens: 65_535,
  487. contextWindow: 1_048_576,
  488. supportsImages: true,
  489. supportsPromptCache: true,
  490. isPromptCacheOptional: true,
  491. inputPrice: 2.5,
  492. outputPrice: 15,
  493. },
  494. "gemini-2.5-pro-preview-05-06": {
  495. maxTokens: 65_535,
  496. contextWindow: 1_048_576,
  497. supportsImages: true,
  498. supportsPromptCache: true,
  499. isPromptCacheOptional: true,
  500. inputPrice: 2.5,
  501. outputPrice: 15,
  502. },
  503. "gemini-2.5-pro-exp-03-25": {
  504. maxTokens: 65_535,
  505. contextWindow: 1_048_576,
  506. supportsImages: true,
  507. supportsPromptCache: false,
  508. inputPrice: 0,
  509. outputPrice: 0,
  510. },
  511. "gemini-2.0-pro-exp-02-05": {
  512. maxTokens: 8192,
  513. contextWindow: 2_097_152,
  514. supportsImages: true,
  515. supportsPromptCache: false,
  516. inputPrice: 0,
  517. outputPrice: 0,
  518. },
  519. "gemini-2.0-flash-001": {
  520. maxTokens: 8192,
  521. contextWindow: 1_048_576,
  522. supportsImages: true,
  523. supportsPromptCache: true,
  524. isPromptCacheOptional: true,
  525. inputPrice: 0.15,
  526. outputPrice: 0.6,
  527. },
  528. "gemini-2.0-flash-lite-001": {
  529. maxTokens: 8192,
  530. contextWindow: 1_048_576,
  531. supportsImages: true,
  532. supportsPromptCache: false,
  533. inputPrice: 0.075,
  534. outputPrice: 0.3,
  535. },
  536. "gemini-2.0-flash-thinking-exp-01-21": {
  537. maxTokens: 8192,
  538. contextWindow: 32_768,
  539. supportsImages: true,
  540. supportsPromptCache: false,
  541. inputPrice: 0,
  542. outputPrice: 0,
  543. },
  544. "gemini-1.5-flash-002": {
  545. maxTokens: 8192,
  546. contextWindow: 1_048_576,
  547. supportsImages: true,
  548. supportsPromptCache: true,
  549. isPromptCacheOptional: true,
  550. inputPrice: 0.075,
  551. outputPrice: 0.3,
  552. },
  553. "gemini-1.5-pro-002": {
  554. maxTokens: 8192,
  555. contextWindow: 2_097_152,
  556. supportsImages: true,
  557. supportsPromptCache: false,
  558. inputPrice: 1.25,
  559. outputPrice: 5,
  560. },
  561. "claude-3-7-sonnet@20250219:thinking": {
  562. maxTokens: 64_000,
  563. contextWindow: 200_000,
  564. supportsImages: true,
  565. supportsComputerUse: true,
  566. supportsPromptCache: true,
  567. inputPrice: 3.0,
  568. outputPrice: 15.0,
  569. cacheWritesPrice: 3.75,
  570. cacheReadsPrice: 0.3,
  571. thinking: true,
  572. },
  573. "claude-3-7-sonnet@20250219": {
  574. maxTokens: 8192,
  575. contextWindow: 200_000,
  576. supportsImages: true,
  577. supportsComputerUse: true,
  578. supportsPromptCache: true,
  579. inputPrice: 3.0,
  580. outputPrice: 15.0,
  581. cacheWritesPrice: 3.75,
  582. cacheReadsPrice: 0.3,
  583. thinking: false,
  584. },
  585. "claude-3-5-sonnet-v2@20241022": {
  586. maxTokens: 8192,
  587. contextWindow: 200_000,
  588. supportsImages: true,
  589. supportsComputerUse: true,
  590. supportsPromptCache: true,
  591. inputPrice: 3.0,
  592. outputPrice: 15.0,
  593. cacheWritesPrice: 3.75,
  594. cacheReadsPrice: 0.3,
  595. },
  596. "claude-3-5-sonnet@20240620": {
  597. maxTokens: 8192,
  598. contextWindow: 200_000,
  599. supportsImages: true,
  600. supportsPromptCache: true,
  601. inputPrice: 3.0,
  602. outputPrice: 15.0,
  603. cacheWritesPrice: 3.75,
  604. cacheReadsPrice: 0.3,
  605. },
  606. "claude-3-5-haiku@20241022": {
  607. maxTokens: 8192,
  608. contextWindow: 200_000,
  609. supportsImages: false,
  610. supportsPromptCache: true,
  611. inputPrice: 1.0,
  612. outputPrice: 5.0,
  613. cacheWritesPrice: 1.25,
  614. cacheReadsPrice: 0.1,
  615. },
  616. "claude-3-opus@20240229": {
  617. maxTokens: 4096,
  618. contextWindow: 200_000,
  619. supportsImages: true,
  620. supportsPromptCache: true,
  621. inputPrice: 15.0,
  622. outputPrice: 75.0,
  623. cacheWritesPrice: 18.75,
  624. cacheReadsPrice: 1.5,
  625. },
  626. "claude-3-haiku@20240307": {
  627. maxTokens: 4096,
  628. contextWindow: 200_000,
  629. supportsImages: true,
  630. supportsPromptCache: true,
  631. inputPrice: 0.25,
  632. outputPrice: 1.25,
  633. cacheWritesPrice: 0.3,
  634. cacheReadsPrice: 0.03,
  635. },
  636. } as const satisfies Record<string, ModelInfo>
  637. export const openAiModelInfoSaneDefaults: ModelInfo = {
  638. maxTokens: -1,
  639. contextWindow: 128_000,
  640. supportsImages: true,
  641. supportsPromptCache: false,
  642. inputPrice: 0,
  643. outputPrice: 0,
  644. }
  645. // Gemini
  646. // https://ai.google.dev/gemini-api/docs/models/gemini
  647. export type GeminiModelId = keyof typeof geminiModels
  648. export const geminiDefaultModelId: GeminiModelId = "gemini-2.0-flash-001"
  649. export const geminiModels = {
  650. "gemini-2.5-flash-preview-04-17:thinking": {
  651. maxTokens: 65_535,
  652. contextWindow: 1_048_576,
  653. supportsImages: true,
  654. supportsPromptCache: false,
  655. inputPrice: 0.15,
  656. outputPrice: 3.5,
  657. thinking: true,
  658. maxThinkingTokens: 24_576,
  659. },
  660. "gemini-2.5-flash-preview-04-17": {
  661. maxTokens: 65_535,
  662. contextWindow: 1_048_576,
  663. supportsImages: true,
  664. supportsPromptCache: false,
  665. inputPrice: 0.15,
  666. outputPrice: 0.6,
  667. thinking: false,
  668. },
  669. "gemini-2.5-pro-exp-03-25": {
  670. maxTokens: 65_535,
  671. contextWindow: 1_048_576,
  672. supportsImages: true,
  673. supportsPromptCache: false,
  674. inputPrice: 0,
  675. outputPrice: 0,
  676. },
  677. "gemini-2.5-pro-preview-03-25": {
  678. maxTokens: 65_535,
  679. contextWindow: 1_048_576,
  680. supportsImages: true,
  681. supportsPromptCache: true,
  682. isPromptCacheOptional: true,
  683. inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
  684. outputPrice: 15,
  685. cacheReadsPrice: 0.625,
  686. cacheWritesPrice: 4.5,
  687. tiers: [
  688. {
  689. contextWindow: 200_000,
  690. inputPrice: 1.25,
  691. outputPrice: 10,
  692. cacheReadsPrice: 0.31,
  693. },
  694. {
  695. contextWindow: Infinity,
  696. inputPrice: 2.5,
  697. outputPrice: 15,
  698. cacheReadsPrice: 0.625,
  699. },
  700. ],
  701. },
  702. "gemini-2.5-pro-preview-05-06": {
  703. maxTokens: 65_535,
  704. contextWindow: 1_048_576,
  705. supportsImages: true,
  706. supportsPromptCache: true,
  707. isPromptCacheOptional: true,
  708. inputPrice: 2.5, // This is the pricing for prompts above 200k tokens.
  709. outputPrice: 15,
  710. cacheReadsPrice: 0.625,
  711. cacheWritesPrice: 4.5,
  712. tiers: [
  713. {
  714. contextWindow: 200_000,
  715. inputPrice: 1.25,
  716. outputPrice: 10,
  717. cacheReadsPrice: 0.31,
  718. },
  719. {
  720. contextWindow: Infinity,
  721. inputPrice: 2.5,
  722. outputPrice: 15,
  723. cacheReadsPrice: 0.625,
  724. },
  725. ],
  726. },
  727. "gemini-2.0-flash-001": {
  728. maxTokens: 8192,
  729. contextWindow: 1_048_576,
  730. supportsImages: true,
  731. supportsPromptCache: true,
  732. isPromptCacheOptional: true,
  733. inputPrice: 0.1,
  734. outputPrice: 0.4,
  735. cacheReadsPrice: 0.025,
  736. cacheWritesPrice: 1.0,
  737. },
  738. "gemini-2.0-flash-lite-preview-02-05": {
  739. maxTokens: 8192,
  740. contextWindow: 1_048_576,
  741. supportsImages: true,
  742. supportsPromptCache: false,
  743. inputPrice: 0,
  744. outputPrice: 0,
  745. },
  746. "gemini-2.0-pro-exp-02-05": {
  747. maxTokens: 8192,
  748. contextWindow: 2_097_152,
  749. supportsImages: true,
  750. supportsPromptCache: false,
  751. inputPrice: 0,
  752. outputPrice: 0,
  753. },
  754. "gemini-2.0-flash-thinking-exp-01-21": {
  755. maxTokens: 65_536,
  756. contextWindow: 1_048_576,
  757. supportsImages: true,
  758. supportsPromptCache: false,
  759. inputPrice: 0,
  760. outputPrice: 0,
  761. },
  762. "gemini-2.0-flash-thinking-exp-1219": {
  763. maxTokens: 8192,
  764. contextWindow: 32_767,
  765. supportsImages: true,
  766. supportsPromptCache: false,
  767. inputPrice: 0,
  768. outputPrice: 0,
  769. },
  770. "gemini-2.0-flash-exp": {
  771. maxTokens: 8192,
  772. contextWindow: 1_048_576,
  773. supportsImages: true,
  774. supportsPromptCache: false,
  775. inputPrice: 0,
  776. outputPrice: 0,
  777. },
  778. "gemini-1.5-flash-002": {
  779. maxTokens: 8192,
  780. contextWindow: 1_048_576,
  781. supportsImages: true,
  782. supportsPromptCache: true,
  783. isPromptCacheOptional: true,
  784. inputPrice: 0.15, // This is the pricing for prompts above 128k tokens.
  785. outputPrice: 0.6,
  786. cacheReadsPrice: 0.0375,
  787. cacheWritesPrice: 1.0,
  788. tiers: [
  789. {
  790. contextWindow: 128_000,
  791. inputPrice: 0.075,
  792. outputPrice: 0.3,
  793. cacheReadsPrice: 0.01875,
  794. },
  795. {
  796. contextWindow: Infinity,
  797. inputPrice: 0.15,
  798. outputPrice: 0.6,
  799. cacheReadsPrice: 0.0375,
  800. },
  801. ],
  802. },
  803. "gemini-1.5-flash-exp-0827": {
  804. maxTokens: 8192,
  805. contextWindow: 1_048_576,
  806. supportsImages: true,
  807. supportsPromptCache: false,
  808. inputPrice: 0,
  809. outputPrice: 0,
  810. },
  811. "gemini-1.5-flash-8b-exp-0827": {
  812. maxTokens: 8192,
  813. contextWindow: 1_048_576,
  814. supportsImages: true,
  815. supportsPromptCache: false,
  816. inputPrice: 0,
  817. outputPrice: 0,
  818. },
  819. "gemini-1.5-pro-002": {
  820. maxTokens: 8192,
  821. contextWindow: 2_097_152,
  822. supportsImages: true,
  823. supportsPromptCache: false,
  824. inputPrice: 0,
  825. outputPrice: 0,
  826. },
  827. "gemini-1.5-pro-exp-0827": {
  828. maxTokens: 8192,
  829. contextWindow: 2_097_152,
  830. supportsImages: true,
  831. supportsPromptCache: false,
  832. inputPrice: 0,
  833. outputPrice: 0,
  834. },
  835. "gemini-exp-1206": {
  836. maxTokens: 8192,
  837. contextWindow: 2_097_152,
  838. supportsImages: true,
  839. supportsPromptCache: false,
  840. inputPrice: 0,
  841. outputPrice: 0,
  842. },
  843. } as const satisfies Record<string, ModelInfo>
  844. // OpenAI Native
  845. // https://openai.com/api/pricing/
  846. export type OpenAiNativeModelId = keyof typeof openAiNativeModels
  847. export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4.1"
  848. export const openAiNativeModels = {
  849. "gpt-4.1": {
  850. maxTokens: 32_768,
  851. contextWindow: 1_047_576,
  852. supportsImages: true,
  853. supportsPromptCache: true,
  854. inputPrice: 2,
  855. outputPrice: 8,
  856. cacheReadsPrice: 0.5,
  857. },
  858. "gpt-4.1-mini": {
  859. maxTokens: 32_768,
  860. contextWindow: 1_047_576,
  861. supportsImages: true,
  862. supportsPromptCache: true,
  863. inputPrice: 0.4,
  864. outputPrice: 1.6,
  865. cacheReadsPrice: 0.1,
  866. },
  867. "gpt-4.1-nano": {
  868. maxTokens: 32_768,
  869. contextWindow: 1_047_576,
  870. supportsImages: true,
  871. supportsPromptCache: true,
  872. inputPrice: 0.1,
  873. outputPrice: 0.4,
  874. cacheReadsPrice: 0.025,
  875. },
  876. o3: {
  877. maxTokens: 100_000,
  878. contextWindow: 200_000,
  879. supportsImages: true,
  880. supportsPromptCache: true,
  881. inputPrice: 10.0,
  882. outputPrice: 40.0,
  883. cacheReadsPrice: 2.5,
  884. reasoningEffort: "medium",
  885. },
  886. "o3-high": {
  887. maxTokens: 100_000,
  888. contextWindow: 200_000,
  889. supportsImages: true,
  890. supportsPromptCache: true,
  891. inputPrice: 10.0,
  892. outputPrice: 40.0,
  893. cacheReadsPrice: 2.5,
  894. reasoningEffort: "high",
  895. },
  896. "o3-low": {
  897. maxTokens: 100_000,
  898. contextWindow: 200_000,
  899. supportsImages: true,
  900. supportsPromptCache: true,
  901. inputPrice: 10.0,
  902. outputPrice: 40.0,
  903. cacheReadsPrice: 2.5,
  904. reasoningEffort: "low",
  905. },
  906. "o4-mini": {
  907. maxTokens: 100_000,
  908. contextWindow: 200_000,
  909. supportsImages: true,
  910. supportsPromptCache: true,
  911. inputPrice: 1.1,
  912. outputPrice: 4.4,
  913. cacheReadsPrice: 0.275,
  914. reasoningEffort: "medium",
  915. },
  916. "o4-mini-high": {
  917. maxTokens: 100_000,
  918. contextWindow: 200_000,
  919. supportsImages: true,
  920. supportsPromptCache: true,
  921. inputPrice: 1.1,
  922. outputPrice: 4.4,
  923. cacheReadsPrice: 0.275,
  924. reasoningEffort: "high",
  925. },
  926. "o4-mini-low": {
  927. maxTokens: 100_000,
  928. contextWindow: 200_000,
  929. supportsImages: true,
  930. supportsPromptCache: true,
  931. inputPrice: 1.1,
  932. outputPrice: 4.4,
  933. cacheReadsPrice: 0.275,
  934. reasoningEffort: "low",
  935. },
  936. "o3-mini": {
  937. maxTokens: 100_000,
  938. contextWindow: 200_000,
  939. supportsImages: false,
  940. supportsPromptCache: true,
  941. inputPrice: 1.1,
  942. outputPrice: 4.4,
  943. cacheReadsPrice: 0.55,
  944. reasoningEffort: "medium",
  945. },
  946. "o3-mini-high": {
  947. maxTokens: 100_000,
  948. contextWindow: 200_000,
  949. supportsImages: false,
  950. supportsPromptCache: true,
  951. inputPrice: 1.1,
  952. outputPrice: 4.4,
  953. cacheReadsPrice: 0.55,
  954. reasoningEffort: "high",
  955. },
  956. "o3-mini-low": {
  957. maxTokens: 100_000,
  958. contextWindow: 200_000,
  959. supportsImages: false,
  960. supportsPromptCache: true,
  961. inputPrice: 1.1,
  962. outputPrice: 4.4,
  963. cacheReadsPrice: 0.55,
  964. reasoningEffort: "low",
  965. },
  966. o1: {
  967. maxTokens: 100_000,
  968. contextWindow: 200_000,
  969. supportsImages: true,
  970. supportsPromptCache: true,
  971. inputPrice: 15,
  972. outputPrice: 60,
  973. cacheReadsPrice: 7.5,
  974. },
  975. "o1-preview": {
  976. maxTokens: 32_768,
  977. contextWindow: 128_000,
  978. supportsImages: true,
  979. supportsPromptCache: true,
  980. inputPrice: 15,
  981. outputPrice: 60,
  982. cacheReadsPrice: 7.5,
  983. },
  984. "o1-mini": {
  985. maxTokens: 65_536,
  986. contextWindow: 128_000,
  987. supportsImages: true,
  988. supportsPromptCache: true,
  989. inputPrice: 1.1,
  990. outputPrice: 4.4,
  991. cacheReadsPrice: 0.55,
  992. },
  993. "gpt-4.5-preview": {
  994. maxTokens: 16_384,
  995. contextWindow: 128_000,
  996. supportsImages: true,
  997. supportsPromptCache: true,
  998. inputPrice: 75,
  999. outputPrice: 150,
  1000. cacheReadsPrice: 37.5,
  1001. },
  1002. "gpt-4o": {
  1003. maxTokens: 16_384,
  1004. contextWindow: 128_000,
  1005. supportsImages: true,
  1006. supportsPromptCache: true,
  1007. inputPrice: 2.5,
  1008. outputPrice: 10,
  1009. cacheReadsPrice: 1.25,
  1010. },
  1011. "gpt-4o-mini": {
  1012. maxTokens: 16_384,
  1013. contextWindow: 128_000,
  1014. supportsImages: true,
  1015. supportsPromptCache: true,
  1016. inputPrice: 0.15,
  1017. outputPrice: 0.6,
  1018. cacheReadsPrice: 0.075,
  1019. },
  1020. } as const satisfies Record<string, ModelInfo>
  1021. // DeepSeek
  1022. // https://platform.deepseek.com/docs/api
  1023. export type DeepSeekModelId = keyof typeof deepSeekModels
  1024. export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
  1025. export const deepSeekModels = {
  1026. "deepseek-chat": {
  1027. maxTokens: 8192,
  1028. contextWindow: 64_000,
  1029. supportsImages: false,
  1030. supportsPromptCache: true,
  1031. inputPrice: 0.27, // $0.27 per million tokens (cache miss)
  1032. outputPrice: 1.1, // $1.10 per million tokens
  1033. cacheWritesPrice: 0.27, // $0.27 per million tokens (cache miss)
  1034. cacheReadsPrice: 0.07, // $0.07 per million tokens (cache hit).
  1035. 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.`,
  1036. },
  1037. "deepseek-reasoner": {
  1038. maxTokens: 8192,
  1039. contextWindow: 64_000,
  1040. supportsImages: false,
  1041. supportsPromptCache: true,
  1042. inputPrice: 0.55, // $0.55 per million tokens (cache miss)
  1043. outputPrice: 2.19, // $2.19 per million tokens
  1044. cacheWritesPrice: 0.55, // $0.55 per million tokens (cache miss)
  1045. cacheReadsPrice: 0.14, // $0.14 per million tokens (cache hit)
  1046. 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.`,
  1047. },
  1048. } as const satisfies Record<string, ModelInfo>
  1049. // Azure OpenAI
  1050. // https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
  1051. // https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
  1052. export const azureOpenAiDefaultApiVersion = "2024-08-01-preview"
  1053. // Mistral
  1054. // https://docs.mistral.ai/getting-started/models/models_overview/
  1055. export type MistralModelId = keyof typeof mistralModels
  1056. export const mistralDefaultModelId: MistralModelId = "codestral-latest"
  1057. export const mistralModels = {
  1058. "codestral-latest": {
  1059. maxTokens: 256_000,
  1060. contextWindow: 256_000,
  1061. supportsImages: false,
  1062. supportsPromptCache: false,
  1063. inputPrice: 0.3,
  1064. outputPrice: 0.9,
  1065. },
  1066. "mistral-large-latest": {
  1067. maxTokens: 131_000,
  1068. contextWindow: 131_000,
  1069. supportsImages: false,
  1070. supportsPromptCache: false,
  1071. inputPrice: 2.0,
  1072. outputPrice: 6.0,
  1073. },
  1074. "ministral-8b-latest": {
  1075. maxTokens: 131_000,
  1076. contextWindow: 131_000,
  1077. supportsImages: false,
  1078. supportsPromptCache: false,
  1079. inputPrice: 0.1,
  1080. outputPrice: 0.1,
  1081. },
  1082. "ministral-3b-latest": {
  1083. maxTokens: 131_000,
  1084. contextWindow: 131_000,
  1085. supportsImages: false,
  1086. supportsPromptCache: false,
  1087. inputPrice: 0.04,
  1088. outputPrice: 0.04,
  1089. },
  1090. "mistral-small-latest": {
  1091. maxTokens: 32_000,
  1092. contextWindow: 32_000,
  1093. supportsImages: false,
  1094. supportsPromptCache: false,
  1095. inputPrice: 0.2,
  1096. outputPrice: 0.6,
  1097. },
  1098. "pixtral-large-latest": {
  1099. maxTokens: 131_000,
  1100. contextWindow: 131_000,
  1101. supportsImages: true,
  1102. supportsPromptCache: false,
  1103. inputPrice: 2.0,
  1104. outputPrice: 6.0,
  1105. },
  1106. } as const satisfies Record<string, ModelInfo>
  1107. // Unbound Security
  1108. // https://www.unboundsecurity.ai/ai-gateway
  1109. export const unboundDefaultModelId = "anthropic/claude-3-7-sonnet-20250219"
  1110. export const unboundDefaultModelInfo: ModelInfo = {
  1111. maxTokens: 8192,
  1112. contextWindow: 200_000,
  1113. supportsImages: true,
  1114. supportsPromptCache: true,
  1115. inputPrice: 3.0,
  1116. outputPrice: 15.0,
  1117. cacheWritesPrice: 3.75,
  1118. cacheReadsPrice: 0.3,
  1119. }
  1120. // LiteLLM
  1121. // https://docs.litellm.ai/
  1122. export const litellmDefaultModelId = "anthropic/claude-3-7-sonnet-20250219"
  1123. export const litellmDefaultModelInfo: ModelInfo = {
  1124. maxTokens: 8192,
  1125. contextWindow: 200_000,
  1126. supportsImages: true,
  1127. supportsComputerUse: true,
  1128. supportsPromptCache: true,
  1129. inputPrice: 3.0,
  1130. outputPrice: 15.0,
  1131. cacheWritesPrice: 3.75,
  1132. cacheReadsPrice: 0.3,
  1133. }
  1134. // xAI
  1135. // https://docs.x.ai/docs/api-reference
  1136. export type XAIModelId = keyof typeof xaiModels
  1137. export const xaiDefaultModelId: XAIModelId = "grok-3-beta"
  1138. export const xaiModels = {
  1139. "grok-3-beta": {
  1140. maxTokens: 8192,
  1141. contextWindow: 131072,
  1142. supportsImages: false,
  1143. supportsPromptCache: false,
  1144. inputPrice: 3.0,
  1145. outputPrice: 15.0,
  1146. description: "xAI's Grok-3 beta model with 131K context window",
  1147. },
  1148. "grok-3-fast-beta": {
  1149. maxTokens: 8192,
  1150. contextWindow: 131072,
  1151. supportsImages: false,
  1152. supportsPromptCache: false,
  1153. inputPrice: 5.0,
  1154. outputPrice: 25.0,
  1155. description: "xAI's Grok-3 fast beta model with 131K context window",
  1156. },
  1157. "grok-3-mini-beta": {
  1158. maxTokens: 8192,
  1159. contextWindow: 131072,
  1160. supportsImages: false,
  1161. supportsPromptCache: false,
  1162. inputPrice: 0.3,
  1163. outputPrice: 0.5,
  1164. description: "xAI's Grok-3 mini beta model with 131K context window",
  1165. },
  1166. "grok-3-mini-fast-beta": {
  1167. maxTokens: 8192,
  1168. contextWindow: 131072,
  1169. supportsImages: false,
  1170. supportsPromptCache: false,
  1171. inputPrice: 0.6,
  1172. outputPrice: 4.0,
  1173. description: "xAI's Grok-3 mini fast beta model with 131K context window",
  1174. },
  1175. "grok-2-latest": {
  1176. maxTokens: 8192,
  1177. contextWindow: 131072,
  1178. supportsImages: false,
  1179. supportsPromptCache: false,
  1180. inputPrice: 2.0,
  1181. outputPrice: 10.0,
  1182. description: "xAI's Grok-2 model - latest version with 131K context window",
  1183. },
  1184. "grok-2": {
  1185. maxTokens: 8192,
  1186. contextWindow: 131072,
  1187. supportsImages: false,
  1188. supportsPromptCache: false,
  1189. inputPrice: 2.0,
  1190. outputPrice: 10.0,
  1191. description: "xAI's Grok-2 model with 131K context window",
  1192. },
  1193. "grok-2-1212": {
  1194. maxTokens: 8192,
  1195. contextWindow: 131072,
  1196. supportsImages: false,
  1197. supportsPromptCache: false,
  1198. inputPrice: 2.0,
  1199. outputPrice: 10.0,
  1200. description: "xAI's Grok-2 model (version 1212) with 131K context window",
  1201. },
  1202. "grok-2-vision-latest": {
  1203. maxTokens: 8192,
  1204. contextWindow: 32768,
  1205. supportsImages: true,
  1206. supportsPromptCache: false,
  1207. inputPrice: 2.0,
  1208. outputPrice: 10.0,
  1209. description: "xAI's Grok-2 Vision model - latest version with image support and 32K context window",
  1210. },
  1211. "grok-2-vision": {
  1212. maxTokens: 8192,
  1213. contextWindow: 32768,
  1214. supportsImages: true,
  1215. supportsPromptCache: false,
  1216. inputPrice: 2.0,
  1217. outputPrice: 10.0,
  1218. description: "xAI's Grok-2 Vision model with image support and 32K context window",
  1219. },
  1220. "grok-2-vision-1212": {
  1221. maxTokens: 8192,
  1222. contextWindow: 32768,
  1223. supportsImages: true,
  1224. supportsPromptCache: false,
  1225. inputPrice: 2.0,
  1226. outputPrice: 10.0,
  1227. description: "xAI's Grok-2 Vision model (version 1212) with image support and 32K context window",
  1228. },
  1229. "grok-vision-beta": {
  1230. maxTokens: 8192,
  1231. contextWindow: 8192,
  1232. supportsImages: true,
  1233. supportsPromptCache: false,
  1234. inputPrice: 5.0,
  1235. outputPrice: 15.0,
  1236. description: "xAI's Grok Vision Beta model with image support and 8K context window",
  1237. },
  1238. "grok-beta": {
  1239. maxTokens: 8192,
  1240. contextWindow: 131072,
  1241. supportsImages: false,
  1242. supportsPromptCache: false,
  1243. inputPrice: 5.0,
  1244. outputPrice: 15.0,
  1245. description: "xAI's Grok Beta model (legacy) with 131K context window",
  1246. },
  1247. } as const satisfies Record<string, ModelInfo>
  1248. export type VscodeLlmModelId = keyof typeof vscodeLlmModels
  1249. export const vscodeLlmDefaultModelId: VscodeLlmModelId = "claude-3.5-sonnet"
  1250. export const vscodeLlmModels = {
  1251. "gpt-3.5-turbo": {
  1252. contextWindow: 12114,
  1253. supportsImages: false,
  1254. supportsPromptCache: false,
  1255. inputPrice: 0,
  1256. outputPrice: 0,
  1257. family: "gpt-3.5-turbo",
  1258. version: "gpt-3.5-turbo-0613",
  1259. name: "GPT 3.5 Turbo",
  1260. supportsToolCalling: true,
  1261. maxInputTokens: 12114,
  1262. },
  1263. "gpt-4o-mini": {
  1264. contextWindow: 12115,
  1265. supportsImages: false,
  1266. supportsPromptCache: false,
  1267. inputPrice: 0,
  1268. outputPrice: 0,
  1269. family: "gpt-4o-mini",
  1270. version: "gpt-4o-mini-2024-07-18",
  1271. name: "GPT-4o mini",
  1272. supportsToolCalling: true,
  1273. maxInputTokens: 12115,
  1274. },
  1275. "gpt-4": {
  1276. contextWindow: 28501,
  1277. supportsImages: false,
  1278. supportsPromptCache: false,
  1279. inputPrice: 0,
  1280. outputPrice: 0,
  1281. family: "gpt-4",
  1282. version: "gpt-4-0613",
  1283. name: "GPT 4",
  1284. supportsToolCalling: true,
  1285. maxInputTokens: 28501,
  1286. },
  1287. "gpt-4-0125-preview": {
  1288. contextWindow: 63826,
  1289. supportsImages: false,
  1290. supportsPromptCache: false,
  1291. inputPrice: 0,
  1292. outputPrice: 0,
  1293. family: "gpt-4-turbo",
  1294. version: "gpt-4-0125-preview",
  1295. name: "GPT 4 Turbo",
  1296. supportsToolCalling: true,
  1297. maxInputTokens: 63826,
  1298. },
  1299. "gpt-4o": {
  1300. contextWindow: 63827,
  1301. supportsImages: true,
  1302. supportsPromptCache: false,
  1303. inputPrice: 0,
  1304. outputPrice: 0,
  1305. family: "gpt-4o",
  1306. version: "gpt-4o-2024-11-20",
  1307. name: "GPT-4o",
  1308. supportsToolCalling: true,
  1309. maxInputTokens: 63827,
  1310. },
  1311. o1: {
  1312. contextWindow: 19827,
  1313. supportsImages: false,
  1314. supportsPromptCache: false,
  1315. inputPrice: 0,
  1316. outputPrice: 0,
  1317. family: "o1-ga",
  1318. version: "o1-2024-12-17",
  1319. name: "o1 (Preview)",
  1320. supportsToolCalling: true,
  1321. maxInputTokens: 19827,
  1322. },
  1323. "o3-mini": {
  1324. contextWindow: 63827,
  1325. supportsImages: false,
  1326. supportsPromptCache: false,
  1327. inputPrice: 0,
  1328. outputPrice: 0,
  1329. family: "o3-mini",
  1330. version: "o3-mini-2025-01-31",
  1331. name: "o3-mini",
  1332. supportsToolCalling: true,
  1333. maxInputTokens: 63827,
  1334. },
  1335. "claude-3.5-sonnet": {
  1336. contextWindow: 81638,
  1337. supportsImages: true,
  1338. supportsPromptCache: false,
  1339. inputPrice: 0,
  1340. outputPrice: 0,
  1341. family: "claude-3.5-sonnet",
  1342. version: "claude-3.5-sonnet",
  1343. name: "Claude 3.5 Sonnet",
  1344. supportsToolCalling: true,
  1345. maxInputTokens: 81638,
  1346. },
  1347. "claude-3.7-sonnet": {
  1348. contextWindow: 89827,
  1349. supportsImages: true,
  1350. supportsPromptCache: false,
  1351. inputPrice: 0,
  1352. outputPrice: 0,
  1353. family: "claude-3.7-sonnet",
  1354. version: "claude-3.7-sonnet",
  1355. name: "Claude 3.7 Sonnet",
  1356. supportsToolCalling: true,
  1357. maxInputTokens: 89827,
  1358. },
  1359. "claude-3.7-sonnet-thought": {
  1360. contextWindow: 89827,
  1361. supportsImages: true,
  1362. supportsPromptCache: false,
  1363. inputPrice: 0,
  1364. outputPrice: 0,
  1365. family: "claude-3.7-sonnet-thought",
  1366. version: "claude-3.7-sonnet-thought",
  1367. name: "Claude 3.7 Sonnet Thinking",
  1368. supportsToolCalling: false,
  1369. maxInputTokens: 89827,
  1370. thinking: true,
  1371. },
  1372. "gemini-2.0-flash-001": {
  1373. contextWindow: 127827,
  1374. supportsImages: true,
  1375. supportsPromptCache: false,
  1376. inputPrice: 0,
  1377. outputPrice: 0,
  1378. family: "gemini-2.0-flash",
  1379. version: "gemini-2.0-flash-001",
  1380. name: "Gemini 2.0 Flash",
  1381. supportsToolCalling: false,
  1382. maxInputTokens: 127827,
  1383. },
  1384. "gemini-2.5-pro": {
  1385. contextWindow: 63830,
  1386. supportsImages: true,
  1387. supportsPromptCache: false,
  1388. inputPrice: 0,
  1389. outputPrice: 0,
  1390. family: "gemini-2.5-pro",
  1391. version: "gemini-2.5-pro-preview-03-25",
  1392. name: "Gemini 2.5 Pro (Preview)",
  1393. supportsToolCalling: true,
  1394. maxInputTokens: 63830,
  1395. },
  1396. "o4-mini": {
  1397. contextWindow: 111446,
  1398. supportsImages: false,
  1399. supportsPromptCache: false,
  1400. inputPrice: 0,
  1401. outputPrice: 0,
  1402. family: "o4-mini",
  1403. version: "o4-mini-2025-04-16",
  1404. name: "o4-mini (Preview)",
  1405. supportsToolCalling: true,
  1406. maxInputTokens: 111446,
  1407. },
  1408. "gpt-4.1": {
  1409. contextWindow: 111446,
  1410. supportsImages: true,
  1411. supportsPromptCache: false,
  1412. inputPrice: 0,
  1413. outputPrice: 0,
  1414. family: "gpt-4.1",
  1415. version: "gpt-4.1-2025-04-14",
  1416. name: "GPT-4.1 (Preview)",
  1417. supportsToolCalling: true,
  1418. maxInputTokens: 111446,
  1419. },
  1420. } as const satisfies Record<
  1421. string,
  1422. ModelInfo & {
  1423. family: string
  1424. version: string
  1425. name: string
  1426. supportsToolCalling: boolean
  1427. maxInputTokens: number
  1428. }
  1429. >
  1430. // Groq
  1431. // https://console.groq.com/docs/models
  1432. export type GroqModelId =
  1433. | "llama-3.1-8b-instant"
  1434. | "llama-3.3-70b-versatile"
  1435. | "meta-llama/llama-4-scout-17b-16e-instruct"
  1436. | "meta-llama/llama-4-maverick-17b-128e-instruct"
  1437. | "mistral-saba-24b"
  1438. | "qwen-qwq-32b"
  1439. | "deepseek-r1-distill-llama-70b"
  1440. export const groqDefaultModelId: GroqModelId = "llama-3.3-70b-versatile" // Defaulting to Llama3 70B Versatile
  1441. export const groqModels = {
  1442. // Models based on API response: https://api.groq.com/openai/v1/models
  1443. "llama-3.1-8b-instant": {
  1444. maxTokens: 131072,
  1445. contextWindow: 131072,
  1446. supportsImages: false,
  1447. supportsPromptCache: false,
  1448. inputPrice: 0,
  1449. outputPrice: 0,
  1450. description: "Meta Llama 3.1 8B Instant model, 128K context.",
  1451. },
  1452. "llama-3.3-70b-versatile": {
  1453. maxTokens: 32768,
  1454. contextWindow: 131072,
  1455. supportsImages: false,
  1456. supportsPromptCache: false,
  1457. inputPrice: 0,
  1458. outputPrice: 0,
  1459. description: "Meta Llama 3.3 70B Versatile model, 128K context.",
  1460. },
  1461. "meta-llama/llama-4-scout-17b-16e-instruct": {
  1462. maxTokens: 8192,
  1463. contextWindow: 131072,
  1464. supportsImages: false,
  1465. supportsPromptCache: false,
  1466. inputPrice: 0,
  1467. outputPrice: 0,
  1468. description: "Meta Llama 4 Scout 17B Instruct model, 128K context.",
  1469. },
  1470. "meta-llama/llama-4-maverick-17b-128e-instruct": {
  1471. maxTokens: 8192,
  1472. contextWindow: 131072,
  1473. supportsImages: false,
  1474. supportsPromptCache: false,
  1475. inputPrice: 0,
  1476. outputPrice: 0,
  1477. description: "Meta Llama 4 Maverick 17B Instruct model, 128K context.",
  1478. },
  1479. "mistral-saba-24b": {
  1480. maxTokens: 32768,
  1481. contextWindow: 32768,
  1482. supportsImages: false,
  1483. supportsPromptCache: false,
  1484. inputPrice: 0,
  1485. outputPrice: 0,
  1486. description: "Mistral Saba 24B model, 32K context.",
  1487. },
  1488. "qwen-qwq-32b": {
  1489. maxTokens: 131072,
  1490. contextWindow: 131072,
  1491. supportsImages: false,
  1492. supportsPromptCache: false,
  1493. inputPrice: 0,
  1494. outputPrice: 0,
  1495. description: "Alibaba Qwen QwQ 32B model, 128K context.",
  1496. },
  1497. "deepseek-r1-distill-llama-70b": {
  1498. maxTokens: 131072,
  1499. contextWindow: 131072,
  1500. supportsImages: false,
  1501. supportsPromptCache: false,
  1502. inputPrice: 0,
  1503. outputPrice: 0,
  1504. description: "DeepSeek R1 Distill Llama 70B model, 128K context.",
  1505. },
  1506. } as const satisfies Record<string, ModelInfo>
  1507. // Chutes AI
  1508. // https://llm.chutes.ai/v1 (OpenAI compatible)
  1509. export type ChutesModelId =
  1510. | "deepseek-ai/DeepSeek-R1"
  1511. | "deepseek-ai/DeepSeek-V3"
  1512. | "unsloth/Llama-3.3-70B-Instruct"
  1513. | "chutesai/Llama-4-Scout-17B-16E-Instruct"
  1514. | "unsloth/Mistral-Nemo-Instruct-2407"
  1515. | "unsloth/gemma-3-12b-it"
  1516. | "NousResearch/DeepHermes-3-Llama-3-8B-Preview"
  1517. | "unsloth/gemma-3-4b-it"
  1518. | "nvidia/Llama-3_3-Nemotron-Super-49B-v1"
  1519. | "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1"
  1520. | "chutesai/Llama-4-Maverick-17B-128E-Instruct-FP8"
  1521. | "deepseek-ai/DeepSeek-V3-Base"
  1522. | "deepseek-ai/DeepSeek-R1-Zero"
  1523. | "deepseek-ai/DeepSeek-V3-0324"
  1524. | "microsoft/MAI-DS-R1-FP8"
  1525. | "tngtech/DeepSeek-R1T-Chimera"
  1526. export const chutesDefaultModelId: ChutesModelId = "deepseek-ai/DeepSeek-R1"
  1527. export const chutesModels = {
  1528. "deepseek-ai/DeepSeek-R1": {
  1529. maxTokens: 32768,
  1530. contextWindow: 163840,
  1531. supportsImages: false,
  1532. supportsPromptCache: false,
  1533. inputPrice: 0,
  1534. outputPrice: 0,
  1535. description: "DeepSeek R1 model.",
  1536. },
  1537. "deepseek-ai/DeepSeek-V3": {
  1538. maxTokens: 32768,
  1539. contextWindow: 163840,
  1540. supportsImages: false,
  1541. supportsPromptCache: false,
  1542. inputPrice: 0,
  1543. outputPrice: 0,
  1544. description: "DeepSeek V3 model.",
  1545. },
  1546. "unsloth/Llama-3.3-70B-Instruct": {
  1547. maxTokens: 32768, // From Groq
  1548. contextWindow: 131072, // From Groq
  1549. supportsImages: false,
  1550. supportsPromptCache: false,
  1551. inputPrice: 0,
  1552. outputPrice: 0,
  1553. description: "Unsloth Llama 3.3 70B Instruct model.",
  1554. },
  1555. "chutesai/Llama-4-Scout-17B-16E-Instruct": {
  1556. maxTokens: 32768,
  1557. contextWindow: 512000,
  1558. supportsImages: false,
  1559. supportsPromptCache: false,
  1560. inputPrice: 0,
  1561. outputPrice: 0,
  1562. description: "ChutesAI Llama 4 Scout 17B Instruct model, 512K context.",
  1563. },
  1564. "unsloth/Mistral-Nemo-Instruct-2407": {
  1565. maxTokens: 32768,
  1566. contextWindow: 128000,
  1567. supportsImages: false,
  1568. supportsPromptCache: false,
  1569. inputPrice: 0,
  1570. outputPrice: 0,
  1571. description: "Unsloth Mistral Nemo Instruct model.",
  1572. },
  1573. "unsloth/gemma-3-12b-it": {
  1574. maxTokens: 32768,
  1575. contextWindow: 131072,
  1576. supportsImages: false,
  1577. supportsPromptCache: false,
  1578. inputPrice: 0,
  1579. outputPrice: 0,
  1580. description: "Unsloth Gemma 3 12B IT model.",
  1581. },
  1582. "NousResearch/DeepHermes-3-Llama-3-8B-Preview": {
  1583. maxTokens: 32768,
  1584. contextWindow: 131072,
  1585. supportsImages: false,
  1586. supportsPromptCache: false,
  1587. inputPrice: 0,
  1588. outputPrice: 0,
  1589. description: "Nous DeepHermes 3 Llama 3 8B Preview model.",
  1590. },
  1591. "unsloth/gemma-3-4b-it": {
  1592. maxTokens: 32768,
  1593. contextWindow: 131072,
  1594. supportsImages: false,
  1595. supportsPromptCache: false,
  1596. inputPrice: 0,
  1597. outputPrice: 0,
  1598. description: "Unsloth Gemma 3 4B IT model.",
  1599. },
  1600. "nvidia/Llama-3_3-Nemotron-Super-49B-v1": {
  1601. maxTokens: 32768,
  1602. contextWindow: 131072,
  1603. supportsImages: false,
  1604. supportsPromptCache: false,
  1605. inputPrice: 0,
  1606. outputPrice: 0,
  1607. description: "Nvidia Llama 3.3 Nemotron Super 49B model.",
  1608. },
  1609. "nvidia/Llama-3_1-Nemotron-Ultra-253B-v1": {
  1610. maxTokens: 32768,
  1611. contextWindow: 131072,
  1612. supportsImages: false,
  1613. supportsPromptCache: false,
  1614. inputPrice: 0,
  1615. outputPrice: 0,
  1616. description: "Nvidia Llama 3.1 Nemotron Ultra 253B model.",
  1617. },
  1618. "chutesai/Llama-4-Maverick-17B-128E-Instruct-FP8": {
  1619. maxTokens: 32768,
  1620. contextWindow: 256000,
  1621. supportsImages: false,
  1622. supportsPromptCache: false,
  1623. inputPrice: 0,
  1624. outputPrice: 0,
  1625. description: "ChutesAI Llama 4 Maverick 17B Instruct FP8 model.",
  1626. },
  1627. "deepseek-ai/DeepSeek-V3-Base": {
  1628. maxTokens: 32768,
  1629. contextWindow: 163840,
  1630. supportsImages: false,
  1631. supportsPromptCache: false,
  1632. inputPrice: 0,
  1633. outputPrice: 0,
  1634. description: "DeepSeek V3 Base model.",
  1635. },
  1636. "deepseek-ai/DeepSeek-R1-Zero": {
  1637. maxTokens: 32768,
  1638. contextWindow: 163840,
  1639. supportsImages: false,
  1640. supportsPromptCache: false,
  1641. inputPrice: 0,
  1642. outputPrice: 0,
  1643. description: "DeepSeek R1 Zero model.",
  1644. },
  1645. "deepseek-ai/DeepSeek-V3-0324": {
  1646. maxTokens: 32768,
  1647. contextWindow: 163840,
  1648. supportsImages: false,
  1649. supportsPromptCache: false,
  1650. inputPrice: 0,
  1651. outputPrice: 0,
  1652. description: "DeepSeek V3 (0324) model.",
  1653. },
  1654. "microsoft/MAI-DS-R1-FP8": {
  1655. maxTokens: 32768,
  1656. contextWindow: 163840,
  1657. supportsImages: false,
  1658. supportsPromptCache: false,
  1659. inputPrice: 0,
  1660. outputPrice: 0,
  1661. description: "Microsoft MAI-DS-R1 FP8 model.",
  1662. },
  1663. "tngtech/DeepSeek-R1T-Chimera": {
  1664. maxTokens: 32768,
  1665. contextWindow: 163840,
  1666. supportsImages: false,
  1667. supportsPromptCache: false,
  1668. inputPrice: 0,
  1669. outputPrice: 0,
  1670. description: "TNGTech DeepSeek R1T Chimera model.",
  1671. },
  1672. } as const satisfies Record<string, ModelInfo>
  1673. /**
  1674. * Constants
  1675. */
  1676. // These models support reasoning efforts.
  1677. export const REASONING_MODELS = new Set(["x-ai/grok-3-mini-beta", "grok-3-mini-beta", "grok-3-mini-fast-beta"])
  1678. // These models support prompt caching.
  1679. export const PROMPT_CACHING_MODELS = new Set([
  1680. "anthropic/claude-3-haiku",
  1681. "anthropic/claude-3-haiku:beta",
  1682. "anthropic/claude-3-opus",
  1683. "anthropic/claude-3-opus:beta",
  1684. "anthropic/claude-3-sonnet",
  1685. "anthropic/claude-3-sonnet:beta",
  1686. "anthropic/claude-3.5-haiku",
  1687. "anthropic/claude-3.5-haiku-20241022",
  1688. "anthropic/claude-3.5-haiku-20241022:beta",
  1689. "anthropic/claude-3.5-haiku:beta",
  1690. "anthropic/claude-3.5-sonnet",
  1691. "anthropic/claude-3.5-sonnet-20240620",
  1692. "anthropic/claude-3.5-sonnet-20240620:beta",
  1693. "anthropic/claude-3.5-sonnet:beta",
  1694. "anthropic/claude-3.7-sonnet",
  1695. "anthropic/claude-3.7-sonnet:beta",
  1696. "anthropic/claude-3.7-sonnet:thinking",
  1697. "google/gemini-2.5-pro-preview-03-25",
  1698. "google/gemini-2.5-pro-preview-05-06",
  1699. "google/gemini-2.0-flash-001",
  1700. "google/gemini-flash-1.5",
  1701. "google/gemini-flash-1.5-8b",
  1702. ])
  1703. // These models don't have prompt caching enabled by default (you can turn it on
  1704. // in settings).
  1705. export const OPTIONAL_PROMPT_CACHING_MODELS = new Set([
  1706. "google/gemini-2.5-pro-preview-03-25",
  1707. "google/gemini-2.5-pro-preview-05-06",
  1708. "google/gemini-2.0-flash-001",
  1709. "google/gemini-flash-1.5",
  1710. "google/gemini-flash-1.5-8b",
  1711. ])
  1712. // https://www.anthropic.com/news/3-5-models-and-computer-use
  1713. export const COMPUTER_USE_MODELS = new Set([
  1714. "anthropic/claude-3.5-sonnet",
  1715. "anthropic/claude-3.5-sonnet:beta",
  1716. "anthropic/claude-3.7-sonnet",
  1717. "anthropic/claude-3.7-sonnet:beta",
  1718. "anthropic/claude-3.7-sonnet:thinking",
  1719. ])
  1720. const routerNames = ["openrouter", "requesty", "glama", "unbound", "litellm"] as const
  1721. export type RouterName = (typeof routerNames)[number]
  1722. export const isRouterName = (value: string): value is RouterName => routerNames.includes(value as RouterName)
  1723. export function toRouterName(value?: string): RouterName {
  1724. if (value && isRouterName(value)) {
  1725. return value
  1726. }
  1727. throw new Error(`Invalid router name: ${value}`)
  1728. }
  1729. export type ModelRecord = Record<string, ModelInfo>
  1730. export type RouterModels = Record<RouterName, ModelRecord>