api.ts 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. import * as vscode from "vscode"
  2. export type ApiProvider =
  3. | "anthropic"
  4. | "glama"
  5. | "openrouter"
  6. | "bedrock"
  7. | "vertex"
  8. | "openai"
  9. | "ollama"
  10. | "lmstudio"
  11. | "gemini"
  12. | "openai-native"
  13. | "deepseek"
  14. | "vscode-lm"
  15. | "mistral"
  16. export interface ApiHandlerOptions {
  17. apiModelId?: string
  18. apiKey?: string // anthropic
  19. anthropicBaseUrl?: string
  20. vsCodeLmModelSelector?: vscode.LanguageModelChatSelector
  21. glamaModelId?: string
  22. glamaModelInfo?: ModelInfo
  23. glamaApiKey?: string
  24. openRouterApiKey?: string
  25. openRouterModelId?: string
  26. openRouterModelInfo?: ModelInfo
  27. openRouterBaseUrl?: string
  28. awsAccessKey?: string
  29. awsSecretKey?: string
  30. awsSessionToken?: string
  31. awsRegion?: string
  32. awsUseCrossRegionInference?: boolean
  33. awsUsePromptCache?: boolean
  34. awspromptCacheId?: string
  35. awsProfile?: string
  36. awsUseProfile?: boolean
  37. vertexProjectId?: string
  38. vertexRegion?: string
  39. openAiBaseUrl?: string
  40. openAiApiKey?: string
  41. openAiModelId?: string
  42. openAiCustomModelInfo?: ModelInfo
  43. openAiUseAzure?: boolean
  44. ollamaModelId?: string
  45. ollamaBaseUrl?: string
  46. lmStudioModelId?: string
  47. lmStudioBaseUrl?: string
  48. geminiApiKey?: string
  49. openAiNativeApiKey?: string
  50. mistralApiKey?: string
  51. azureApiVersion?: string
  52. openRouterUseMiddleOutTransform?: boolean
  53. openAiStreamingEnabled?: boolean
  54. setAzureApiVersion?: boolean
  55. deepSeekBaseUrl?: string
  56. deepSeekApiKey?: string
  57. includeMaxTokens?: boolean
  58. }
  59. export type ApiConfiguration = ApiHandlerOptions & {
  60. apiProvider?: ApiProvider
  61. id?: string // stable unique identifier
  62. }
  63. // Models
  64. export interface ModelInfo {
  65. maxTokens?: number
  66. contextWindow: number
  67. supportsImages?: boolean
  68. supportsComputerUse?: boolean
  69. supportsPromptCache: boolean // this value is hardcoded for now
  70. inputPrice?: number
  71. outputPrice?: number
  72. cacheWritesPrice?: number
  73. cacheReadsPrice?: number
  74. description?: string
  75. }
  76. // Anthropic
  77. // https://docs.anthropic.com/en/docs/about-claude/models
  78. export type AnthropicModelId = keyof typeof anthropicModels
  79. export const anthropicDefaultModelId: AnthropicModelId = "claude-3-5-sonnet-20241022"
  80. export const anthropicModels = {
  81. "claude-3-5-sonnet-20241022": {
  82. maxTokens: 8192,
  83. contextWindow: 200_000,
  84. supportsImages: true,
  85. supportsComputerUse: true,
  86. supportsPromptCache: true,
  87. inputPrice: 3.0, // $3 per million input tokens
  88. outputPrice: 15.0, // $15 per million output tokens
  89. cacheWritesPrice: 3.75, // $3.75 per million tokens
  90. cacheReadsPrice: 0.3, // $0.30 per million tokens
  91. },
  92. "claude-3-5-haiku-20241022": {
  93. maxTokens: 8192,
  94. contextWindow: 200_000,
  95. supportsImages: false,
  96. supportsPromptCache: true,
  97. inputPrice: 1.0,
  98. outputPrice: 5.0,
  99. cacheWritesPrice: 1.25,
  100. cacheReadsPrice: 0.1,
  101. },
  102. "claude-3-opus-20240229": {
  103. maxTokens: 4096,
  104. contextWindow: 200_000,
  105. supportsImages: true,
  106. supportsPromptCache: true,
  107. inputPrice: 15.0,
  108. outputPrice: 75.0,
  109. cacheWritesPrice: 18.75,
  110. cacheReadsPrice: 1.5,
  111. },
  112. "claude-3-haiku-20240307": {
  113. maxTokens: 4096,
  114. contextWindow: 200_000,
  115. supportsImages: true,
  116. supportsPromptCache: true,
  117. inputPrice: 0.25,
  118. outputPrice: 1.25,
  119. cacheWritesPrice: 0.3,
  120. cacheReadsPrice: 0.03,
  121. },
  122. } as const satisfies Record<string, ModelInfo> // as const assertion makes the object deeply readonly
  123. // AWS Bedrock
  124. // https://docs.aws.amazon.com/bedrock/latest/userguide/conversation-inference.html
  125. export interface MessageContent {
  126. type: "text" | "image" | "video" | "tool_use" | "tool_result"
  127. text?: string
  128. source?: {
  129. type: "base64"
  130. data: string | Uint8Array // string for Anthropic, Uint8Array for Bedrock
  131. media_type: "image/jpeg" | "image/png" | "image/gif" | "image/webp"
  132. }
  133. // Video specific fields
  134. format?: string
  135. s3Location?: {
  136. uri: string
  137. bucketOwner?: string
  138. }
  139. // Tool use and result fields
  140. toolUseId?: string
  141. name?: string
  142. input?: any
  143. output?: any // Used for tool_result type
  144. }
  145. export type BedrockModelId = keyof typeof bedrockModels
  146. export const bedrockDefaultModelId: BedrockModelId = "anthropic.claude-3-5-sonnet-20241022-v2:0"
  147. export const bedrockModels = {
  148. "amazon.nova-pro-v1:0": {
  149. maxTokens: 5000,
  150. contextWindow: 300_000,
  151. supportsImages: true,
  152. supportsComputerUse: false,
  153. supportsPromptCache: false,
  154. inputPrice: 0.8,
  155. outputPrice: 3.2,
  156. cacheWritesPrice: 0.8, // per million tokens
  157. cacheReadsPrice: 0.2, // per million tokens
  158. },
  159. "amazon.nova-lite-v1:0": {
  160. maxTokens: 5000,
  161. contextWindow: 300_000,
  162. supportsImages: true,
  163. supportsComputerUse: false,
  164. supportsPromptCache: false,
  165. inputPrice: 0.06,
  166. outputPrice: 0.024,
  167. cacheWritesPrice: 0.06, // per million tokens
  168. cacheReadsPrice: 0.015, // per million tokens
  169. },
  170. "amazon.nova-micro-v1:0": {
  171. maxTokens: 5000,
  172. contextWindow: 128_000,
  173. supportsImages: false,
  174. supportsComputerUse: false,
  175. supportsPromptCache: false,
  176. inputPrice: 0.035,
  177. outputPrice: 0.14,
  178. cacheWritesPrice: 0.035, // per million tokens
  179. cacheReadsPrice: 0.00875, // per million tokens
  180. },
  181. "anthropic.claude-3-5-sonnet-20241022-v2:0": {
  182. maxTokens: 8192,
  183. contextWindow: 200_000,
  184. supportsImages: true,
  185. supportsComputerUse: true,
  186. supportsPromptCache: false,
  187. inputPrice: 3.0,
  188. outputPrice: 15.0,
  189. cacheWritesPrice: 3.75, // per million tokens
  190. cacheReadsPrice: 0.3, // per million tokens
  191. },
  192. "anthropic.claude-3-5-haiku-20241022-v1:0": {
  193. maxTokens: 8192,
  194. contextWindow: 200_000,
  195. supportsImages: false,
  196. supportsPromptCache: false,
  197. inputPrice: 1.0,
  198. outputPrice: 5.0,
  199. cacheWritesPrice: 1.0,
  200. cacheReadsPrice: 0.08,
  201. },
  202. "anthropic.claude-3-5-sonnet-20240620-v1:0": {
  203. maxTokens: 8192,
  204. contextWindow: 200_000,
  205. supportsImages: true,
  206. supportsPromptCache: false,
  207. inputPrice: 3.0,
  208. outputPrice: 15.0,
  209. },
  210. "anthropic.claude-3-opus-20240229-v1:0": {
  211. maxTokens: 4096,
  212. contextWindow: 200_000,
  213. supportsImages: true,
  214. supportsPromptCache: false,
  215. inputPrice: 15.0,
  216. outputPrice: 75.0,
  217. },
  218. "anthropic.claude-3-sonnet-20240229-v1:0": {
  219. maxTokens: 4096,
  220. contextWindow: 200_000,
  221. supportsImages: true,
  222. supportsPromptCache: false,
  223. inputPrice: 3.0,
  224. outputPrice: 15.0,
  225. },
  226. "anthropic.claude-3-haiku-20240307-v1:0": {
  227. maxTokens: 4096,
  228. contextWindow: 200_000,
  229. supportsImages: true,
  230. supportsPromptCache: false,
  231. inputPrice: 0.25,
  232. outputPrice: 1.25,
  233. },
  234. "meta.llama3-3-70b-instruct-v1:0": {
  235. maxTokens: 8192,
  236. contextWindow: 128_000,
  237. supportsImages: false,
  238. supportsComputerUse: false,
  239. supportsPromptCache: false,
  240. inputPrice: 0.72,
  241. outputPrice: 0.72,
  242. },
  243. "meta.llama3-2-90b-instruct-v1:0": {
  244. maxTokens: 8192,
  245. contextWindow: 128_000,
  246. supportsImages: true,
  247. supportsComputerUse: false,
  248. supportsPromptCache: false,
  249. inputPrice: 0.72,
  250. outputPrice: 0.72,
  251. },
  252. "meta.llama3-2-11b-instruct-v1:0": {
  253. maxTokens: 8192,
  254. contextWindow: 128_000,
  255. supportsImages: true,
  256. supportsComputerUse: false,
  257. supportsPromptCache: false,
  258. inputPrice: 0.16,
  259. outputPrice: 0.16,
  260. },
  261. "meta.llama3-2-3b-instruct-v1:0": {
  262. maxTokens: 8192,
  263. contextWindow: 128_000,
  264. supportsImages: false,
  265. supportsComputerUse: false,
  266. supportsPromptCache: false,
  267. inputPrice: 0.15,
  268. outputPrice: 0.15,
  269. },
  270. "meta.llama3-2-1b-instruct-v1:0": {
  271. maxTokens: 8192,
  272. contextWindow: 128_000,
  273. supportsImages: false,
  274. supportsComputerUse: false,
  275. supportsPromptCache: false,
  276. inputPrice: 0.1,
  277. outputPrice: 0.1,
  278. },
  279. "meta.llama3-1-405b-instruct-v1:0": {
  280. maxTokens: 8192,
  281. contextWindow: 128_000,
  282. supportsImages: false,
  283. supportsComputerUse: false,
  284. supportsPromptCache: false,
  285. inputPrice: 2.4,
  286. outputPrice: 2.4,
  287. },
  288. "meta.llama3-1-70b-instruct-v1:0": {
  289. maxTokens: 8192,
  290. contextWindow: 128_000,
  291. supportsImages: false,
  292. supportsComputerUse: false,
  293. supportsPromptCache: false,
  294. inputPrice: 0.72,
  295. outputPrice: 0.72,
  296. },
  297. "meta.llama3-1-8b-instruct-v1:0": {
  298. maxTokens: 8192,
  299. contextWindow: 8_000,
  300. supportsImages: false,
  301. supportsComputerUse: false,
  302. supportsPromptCache: false,
  303. inputPrice: 0.22,
  304. outputPrice: 0.22,
  305. },
  306. "meta.llama3-70b-instruct-v1:0": {
  307. maxTokens: 2048,
  308. contextWindow: 8_000,
  309. supportsImages: false,
  310. supportsComputerUse: false,
  311. supportsPromptCache: false,
  312. inputPrice: 2.65,
  313. outputPrice: 3.5,
  314. },
  315. "meta.llama3-8b-instruct-v1:0": {
  316. maxTokens: 2048,
  317. contextWindow: 4_000,
  318. supportsImages: false,
  319. supportsComputerUse: false,
  320. supportsPromptCache: false,
  321. inputPrice: 0.3,
  322. outputPrice: 0.6,
  323. },
  324. } as const satisfies Record<string, ModelInfo>
  325. // Glama
  326. // https://glama.ai/models
  327. export const glamaDefaultModelId = "anthropic/claude-3-5-sonnet"
  328. export const glamaDefaultModelInfo: ModelInfo = {
  329. maxTokens: 8192,
  330. contextWindow: 200_000,
  331. supportsImages: true,
  332. supportsComputerUse: true,
  333. supportsPromptCache: true,
  334. inputPrice: 3.0,
  335. outputPrice: 15.0,
  336. cacheWritesPrice: 3.75,
  337. cacheReadsPrice: 0.3,
  338. description:
  339. "The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal\n\n_This is a faster endpoint, made available in collaboration with Anthropic, that is self-moderated: response moderation happens on the provider's side instead of OpenRouter's. For requests that pass moderation, it's identical to the [Standard](/anthropic/claude-3.5-sonnet) variant._",
  340. }
  341. // OpenRouter
  342. // https://openrouter.ai/models?order=newest&supported_parameters=tools
  343. export const openRouterDefaultModelId = "anthropic/claude-3.5-sonnet:beta" // will always exist in openRouterModels
  344. export const openRouterDefaultModelInfo: ModelInfo = {
  345. maxTokens: 8192,
  346. contextWindow: 200_000,
  347. supportsImages: true,
  348. supportsComputerUse: true,
  349. supportsPromptCache: true,
  350. inputPrice: 3.0,
  351. outputPrice: 15.0,
  352. cacheWritesPrice: 3.75,
  353. cacheReadsPrice: 0.3,
  354. description:
  355. "The new Claude 3.5 Sonnet delivers better-than-Opus capabilities, faster-than-Sonnet speeds, at the same Sonnet prices. Sonnet is particularly good at:\n\n- Coding: New Sonnet scores ~49% on SWE-Bench Verified, higher than the last best score, and without any fancy prompt scaffolding\n- Data science: Augments human data science expertise; navigates unstructured data while using multiple tools for insights\n- Visual processing: excelling at interpreting charts, graphs, and images, accurately transcribing text to derive insights beyond just the text alone\n- Agentic tasks: exceptional tool use, making it great at agentic tasks (i.e. complex, multi-step problem solving tasks that require engaging with other systems)\n\n#multimodal\n\n_This is a faster endpoint, made available in collaboration with Anthropic, that is self-moderated: response moderation happens on the provider's side instead of OpenRouter's. For requests that pass moderation, it's identical to the [Standard](/anthropic/claude-3.5-sonnet) variant._",
  356. }
  357. // Vertex AI
  358. // https://cloud.google.com/vertex-ai/generative-ai/docs/partner-models/use-claude
  359. export type VertexModelId = keyof typeof vertexModels
  360. export const vertexDefaultModelId: VertexModelId = "claude-3-5-sonnet-v2@20241022"
  361. export const vertexModels = {
  362. "claude-3-5-sonnet-v2@20241022": {
  363. maxTokens: 8192,
  364. contextWindow: 200_000,
  365. supportsImages: true,
  366. supportsComputerUse: true,
  367. supportsPromptCache: false,
  368. inputPrice: 3.0,
  369. outputPrice: 15.0,
  370. },
  371. "claude-3-5-sonnet@20240620": {
  372. maxTokens: 8192,
  373. contextWindow: 200_000,
  374. supportsImages: true,
  375. supportsPromptCache: false,
  376. inputPrice: 3.0,
  377. outputPrice: 15.0,
  378. },
  379. "claude-3-5-haiku@20241022": {
  380. maxTokens: 8192,
  381. contextWindow: 200_000,
  382. supportsImages: false,
  383. supportsPromptCache: false,
  384. inputPrice: 1.0,
  385. outputPrice: 5.0,
  386. },
  387. "claude-3-opus@20240229": {
  388. maxTokens: 4096,
  389. contextWindow: 200_000,
  390. supportsImages: true,
  391. supportsPromptCache: false,
  392. inputPrice: 15.0,
  393. outputPrice: 75.0,
  394. },
  395. "claude-3-haiku@20240307": {
  396. maxTokens: 4096,
  397. contextWindow: 200_000,
  398. supportsImages: true,
  399. supportsPromptCache: false,
  400. inputPrice: 0.25,
  401. outputPrice: 1.25,
  402. },
  403. } as const satisfies Record<string, ModelInfo>
  404. export const openAiModelInfoSaneDefaults: ModelInfo = {
  405. maxTokens: -1,
  406. contextWindow: 128_000,
  407. supportsImages: true,
  408. supportsPromptCache: false,
  409. inputPrice: 0,
  410. outputPrice: 0,
  411. }
  412. // Gemini
  413. // https://ai.google.dev/gemini-api/docs/models/gemini
  414. export type GeminiModelId = keyof typeof geminiModels
  415. export const geminiDefaultModelId: GeminiModelId = "gemini-2.0-flash-thinking-exp-01-21"
  416. export const geminiModels = {
  417. "gemini-2.0-flash-thinking-exp-01-21": {
  418. maxTokens: 65_536,
  419. contextWindow: 1_048_576,
  420. supportsImages: true,
  421. supportsPromptCache: false,
  422. inputPrice: 0,
  423. outputPrice: 0,
  424. },
  425. "gemini-2.0-flash-thinking-exp-1219": {
  426. maxTokens: 8192,
  427. contextWindow: 32_767,
  428. supportsImages: true,
  429. supportsPromptCache: false,
  430. inputPrice: 0,
  431. outputPrice: 0,
  432. },
  433. "gemini-2.0-flash-exp": {
  434. maxTokens: 8192,
  435. contextWindow: 1_048_576,
  436. supportsImages: true,
  437. supportsPromptCache: false,
  438. inputPrice: 0,
  439. outputPrice: 0,
  440. },
  441. "gemini-1.5-flash-002": {
  442. maxTokens: 8192,
  443. contextWindow: 1_048_576,
  444. supportsImages: true,
  445. supportsPromptCache: false,
  446. inputPrice: 0,
  447. outputPrice: 0,
  448. },
  449. "gemini-1.5-flash-exp-0827": {
  450. maxTokens: 8192,
  451. contextWindow: 1_048_576,
  452. supportsImages: true,
  453. supportsPromptCache: false,
  454. inputPrice: 0,
  455. outputPrice: 0,
  456. },
  457. "gemini-1.5-flash-8b-exp-0827": {
  458. maxTokens: 8192,
  459. contextWindow: 1_048_576,
  460. supportsImages: true,
  461. supportsPromptCache: false,
  462. inputPrice: 0,
  463. outputPrice: 0,
  464. },
  465. "gemini-1.5-pro-002": {
  466. maxTokens: 8192,
  467. contextWindow: 2_097_152,
  468. supportsImages: true,
  469. supportsPromptCache: false,
  470. inputPrice: 0,
  471. outputPrice: 0,
  472. },
  473. "gemini-1.5-pro-exp-0827": {
  474. maxTokens: 8192,
  475. contextWindow: 2_097_152,
  476. supportsImages: true,
  477. supportsPromptCache: false,
  478. inputPrice: 0,
  479. outputPrice: 0,
  480. },
  481. "gemini-exp-1206": {
  482. maxTokens: 8192,
  483. contextWindow: 2_097_152,
  484. supportsImages: true,
  485. supportsPromptCache: false,
  486. inputPrice: 0,
  487. outputPrice: 0,
  488. },
  489. } as const satisfies Record<string, ModelInfo>
  490. // OpenAI Native
  491. // https://openai.com/api/pricing/
  492. export type OpenAiNativeModelId = keyof typeof openAiNativeModels
  493. export const openAiNativeDefaultModelId: OpenAiNativeModelId = "gpt-4o"
  494. export const openAiNativeModels = {
  495. // don't support tool use yet
  496. o1: {
  497. maxTokens: 100_000,
  498. contextWindow: 200_000,
  499. supportsImages: true,
  500. supportsPromptCache: false,
  501. inputPrice: 15,
  502. outputPrice: 60,
  503. },
  504. "o1-preview": {
  505. maxTokens: 32_768,
  506. contextWindow: 128_000,
  507. supportsImages: true,
  508. supportsPromptCache: false,
  509. inputPrice: 15,
  510. outputPrice: 60,
  511. },
  512. "o1-mini": {
  513. maxTokens: 65_536,
  514. contextWindow: 128_000,
  515. supportsImages: true,
  516. supportsPromptCache: false,
  517. inputPrice: 3,
  518. outputPrice: 12,
  519. },
  520. "gpt-4o": {
  521. maxTokens: 4_096,
  522. contextWindow: 128_000,
  523. supportsImages: true,
  524. supportsPromptCache: false,
  525. inputPrice: 5,
  526. outputPrice: 15,
  527. },
  528. "gpt-4o-mini": {
  529. maxTokens: 16_384,
  530. contextWindow: 128_000,
  531. supportsImages: true,
  532. supportsPromptCache: false,
  533. inputPrice: 0.15,
  534. outputPrice: 0.6,
  535. },
  536. } as const satisfies Record<string, ModelInfo>
  537. // DeepSeek
  538. // https://platform.deepseek.com/docs/api
  539. export type DeepSeekModelId = keyof typeof deepSeekModels
  540. export const deepSeekDefaultModelId: DeepSeekModelId = "deepseek-chat"
  541. export const deepSeekModels = {
  542. "deepseek-chat": {
  543. maxTokens: 8192,
  544. contextWindow: 64_000,
  545. supportsImages: false,
  546. supportsPromptCache: false,
  547. inputPrice: 0.014, // $0.014 per million tokens
  548. outputPrice: 0.28, // $0.28 per million tokens
  549. 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.`,
  550. },
  551. "deepseek-reasoner": {
  552. maxTokens: 8192,
  553. contextWindow: 64_000,
  554. supportsImages: false,
  555. supportsPromptCache: false,
  556. inputPrice: 0.55, // $0.55 per million tokens
  557. outputPrice: 2.19, // $2.19 per million tokens
  558. description: `DeepSeek-R1 achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks.`,
  559. },
  560. } as const satisfies Record<string, ModelInfo>
  561. // Azure OpenAI
  562. // https://learn.microsoft.com/en-us/azure/ai-services/openai/api-version-deprecation
  563. // https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#api-specs
  564. export const azureOpenAiDefaultApiVersion = "2024-08-01-preview"
  565. // Mistral
  566. // https://docs.mistral.ai/getting-started/models/models_overview/
  567. export type MistralModelId = keyof typeof mistralModels
  568. export const mistralDefaultModelId: MistralModelId = "codestral-latest"
  569. export const mistralModels = {
  570. "codestral-latest": {
  571. maxTokens: 32_768,
  572. contextWindow: 256_000,
  573. supportsImages: false,
  574. supportsPromptCache: false,
  575. inputPrice: 0.3,
  576. outputPrice: 0.9,
  577. },
  578. } as const satisfies Record<string, ModelInfo>