@cjhyy/code-shell 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/anthropic-UBSB5AQH.js +1 -0
  2. package/dist/arena/index.js +1 -104
  3. package/dist/arena-OW55ZCHT.js +3 -0
  4. package/dist/bwrap-PVZMLHZR.js +2 -0
  5. package/dist/chunk-2NS3JMNK.js +1 -0
  6. package/dist/chunk-3QP5BQ3L.js +1 -0
  7. package/dist/chunk-B7K2OWKC.js +2 -0
  8. package/dist/chunk-EWWK56K6.js +2 -0
  9. package/dist/chunk-FU7AHZNN.js +1 -0
  10. package/dist/chunk-HIJ2XXGX.js +1 -0
  11. package/dist/chunk-KCXSARAA.js +1 -0
  12. package/dist/chunk-NFH3UQ3E.js +2 -0
  13. package/dist/chunk-NMBYBGC7.js +250 -0
  14. package/dist/chunk-NVAZJ5XS.js +2 -0
  15. package/dist/chunk-O5HFCH2U.js +1 -0
  16. package/dist/chunk-P6JSTIFM.js +1 -0
  17. package/dist/chunk-PGANL6F2.js +3 -0
  18. package/dist/chunk-Q4O2HGWS.js +251 -0
  19. package/dist/chunk-QTWU7UNA.js +5 -0
  20. package/dist/chunk-RP26WO4R.js +1 -0
  21. package/dist/chunk-SNFAPSLA.js +1 -0
  22. package/dist/chunk-T222K6IV.js +18 -0
  23. package/dist/chunk-TKJA6W36.js +3 -0
  24. package/dist/chunk-UDPUTFQT.js +2 -0
  25. package/dist/chunk-W47Z7MGS.js +33 -0
  26. package/dist/chunk-WI6FSWGU.js +1 -0
  27. package/dist/chunk-WOP6MJKW.js +1 -0
  28. package/dist/chunk-XDOWC7EG.js +4 -0
  29. package/dist/chunk-Y2NS6HPO.js +641 -0
  30. package/dist/cli/main.js +303 -22060
  31. package/dist/client-base-6ZZJJYDY.js +1 -0
  32. package/dist/compaction-ECVQVOCT.js +1 -0
  33. package/dist/devtools-SGDUOOM4.js +1 -0
  34. package/dist/engine/engine.d.ts +8 -0
  35. package/dist/export-md-U72T7NW7.js +22 -0
  36. package/dist/file-history-7FQFEQOL.js +1 -0
  37. package/dist/index.d.ts +1 -1
  38. package/dist/index.js +1 -347
  39. package/dist/llm/token-counter.d.ts +17 -0
  40. package/dist/manager-C3TDN6MS.js +1 -0
  41. package/dist/mcp-manager-OP4XYV53.js +1 -0
  42. package/dist/memory-BNI4WEWL.js +1 -0
  43. package/dist/model-cache-HEDXI7UJ.js +1 -0
  44. package/dist/model-fetcher-BJ64META.js +1 -0
  45. package/dist/off-7SDVMMXW.js +1 -0
  46. package/dist/openai-KEWQ54TM.js +1 -0
  47. package/dist/openrouter-models-AM6M52D6.js +1 -0
  48. package/dist/openrouter-sync-5JNBL3Z6.js +1 -0
  49. package/dist/product/index.js +1 -21
  50. package/dist/run/index.js +1 -48
  51. package/dist/seatbelt-WBYROQT6.js +37 -0
  52. package/dist/session/session-manager.d.ts +2 -0
  53. package/dist/session-manager-AGWS5SMJ.js +1 -0
  54. package/dist/settings/schema.d.ts +72 -6
  55. package/dist/tool-summary-5UE62VU4.js +2 -0
  56. package/dist/tool-system/builtin/bash.d.ts +7 -1
  57. package/dist/tool-system/context.d.ts +7 -0
  58. package/dist/tool-system/sandbox/bwrap.d.ts +13 -0
  59. package/dist/tool-system/sandbox/index.d.ts +71 -0
  60. package/dist/tool-system/sandbox/off.d.ts +2 -0
  61. package/dist/tool-system/sandbox/seatbelt.d.ts +18 -0
  62. package/dist/types.d.ts +4 -0
  63. package/dist/ui/components/SessionPicker.d.ts +2 -0
  64. package/dist/ui/components/SpinnerWithVerb.d.ts +2 -2
  65. package/dist/ui/components/StatusLine.d.ts +2 -2
  66. package/dist/updater-OCNU2K2Z.js +1 -0
  67. package/package.json +7 -10
  68. package/dist/anthropic-IBTI4WL2.cjs +0 -10
  69. package/dist/anthropic-PRZZKHEZ.js +0 -10
  70. package/dist/arena/index.cjs +0 -104
  71. package/dist/arena-2LTLIXOL.js +0 -261
  72. package/dist/arena-ADB7DRFI.cjs +0 -261
  73. package/dist/chunk-2YW4FPFG.cjs +0 -101
  74. package/dist/chunk-3OA5G4TM.js +0 -47
  75. package/dist/chunk-3QO25N6E.js +0 -4711
  76. package/dist/chunk-3SBSUOWZ.js +0 -447
  77. package/dist/chunk-52LGZKT3.cjs +0 -47
  78. package/dist/chunk-55XGPMAP.cjs +0 -146
  79. package/dist/chunk-6QVAYW7C.cjs +0 -438
  80. package/dist/chunk-6S4BJ65N.js +0 -113
  81. package/dist/chunk-76HYEPDM.js +0 -307
  82. package/dist/chunk-7BI3V74Y.cjs +0 -447
  83. package/dist/chunk-7EG3V4JY.cjs +0 -113
  84. package/dist/chunk-7JVTYEEC.js +0 -340
  85. package/dist/chunk-7QIM3BKD.js +0 -44
  86. package/dist/chunk-7Y6S3OCX.js +0 -438
  87. package/dist/chunk-ABRRONJ7.js +0 -107
  88. package/dist/chunk-BSW22MPA.js +0 -146
  89. package/dist/chunk-BXCY2FSE.js +0 -203
  90. package/dist/chunk-BZ5TNE7L.js +0 -5128
  91. package/dist/chunk-DDB6QOKJ.cjs +0 -1252
  92. package/dist/chunk-HEKQCI7B.cjs +0 -224
  93. package/dist/chunk-IK4EWJBP.cjs +0 -203
  94. package/dist/chunk-ILHE7XLT.cjs +0 -107
  95. package/dist/chunk-JMR33QVF.cjs +0 -169
  96. package/dist/chunk-KAQHULYN.js +0 -54
  97. package/dist/chunk-KE4EQOWA.js +0 -294
  98. package/dist/chunk-KOVYSDHZ.cjs +0 -340
  99. package/dist/chunk-KS3RYAYL.cjs +0 -45
  100. package/dist/chunk-MD32R22I.js +0 -50
  101. package/dist/chunk-MV7YI4WO.cjs +0 -293
  102. package/dist/chunk-MY5XHADU.cjs +0 -216
  103. package/dist/chunk-NUNC3VFB.cjs +0 -307
  104. package/dist/chunk-PKGRTCCY.js +0 -9092
  105. package/dist/chunk-QARL3IDQ.js +0 -1252
  106. package/dist/chunk-S754JHLR.cjs +0 -54
  107. package/dist/chunk-SFXHZSRF.js +0 -101
  108. package/dist/chunk-SIHHIQLO.js +0 -224
  109. package/dist/chunk-T6VYG46N.js +0 -105
  110. package/dist/chunk-TNLGBJYS.cjs +0 -44
  111. package/dist/chunk-TUY2T5KP.cjs +0 -105
  112. package/dist/chunk-UXOCVJJ6.cjs +0 -9092
  113. package/dist/chunk-VIAGTYYW.js +0 -169
  114. package/dist/chunk-WASS5YWB.js +0 -215
  115. package/dist/chunk-WZJV6DJC.cjs +0 -5128
  116. package/dist/chunk-YIQBXAYU.cjs +0 -264
  117. package/dist/chunk-YKIAELDZ.cjs +0 -4711
  118. package/dist/chunk-ZBPSQCPU.js +0 -264
  119. package/dist/cli/main.cjs +0 -22156
  120. package/dist/client-base-HTF236ZD.cjs +0 -9
  121. package/dist/client-base-QKRKCOWB.js +0 -9
  122. package/dist/compaction-6VU2T643.js +0 -33
  123. package/dist/compaction-OKUNTCA7.cjs +0 -33
  124. package/dist/devtools-T2NIZBJK.cjs +0 -6
  125. package/dist/devtools-YXWHOVKR.js +0 -6
  126. package/dist/export-md-RXDW6F5W.cjs +0 -135
  127. package/dist/export-md-XXKZANW5.js +0 -135
  128. package/dist/file-history-KYPE3ECT.cjs +0 -7
  129. package/dist/file-history-LF4F7X26.js +0 -7
  130. package/dist/index.cjs +0 -347
  131. package/dist/manager-D65VFAPX.js +0 -7
  132. package/dist/manager-TTF5VHJC.cjs +0 -7
  133. package/dist/mcp-manager-QMKWPBZ4.js +0 -8
  134. package/dist/mcp-manager-Z3OKI74O.cjs +0 -8
  135. package/dist/memory-5LWZ6FI2.cjs +0 -9
  136. package/dist/memory-VIJLBAMQ.js +0 -9
  137. package/dist/model-cache-5KIYL5SL.js +0 -13
  138. package/dist/model-cache-OED3IM4R.cjs +0 -13
  139. package/dist/model-fetcher-HKGICACL.js +0 -8
  140. package/dist/model-fetcher-UR6WJOQP.cjs +0 -8
  141. package/dist/openai-JR2WEKOF.js +0 -10
  142. package/dist/openai-YBTOET4O.cjs +0 -10
  143. package/dist/openrouter-models-H56GHBHN.js +0 -15
  144. package/dist/openrouter-models-TWUFWZ5T.cjs +0 -15
  145. package/dist/openrouter-sync-5VMGN6C2.cjs +0 -11
  146. package/dist/openrouter-sync-ALEMF5IU.js +0 -11
  147. package/dist/product/index.cjs +0 -21
  148. package/dist/run/index.cjs +0 -48
  149. package/dist/session-manager-Q22BBMD3.js +0 -8
  150. package/dist/session-manager-XODQVL3C.cjs +0 -8
  151. package/dist/tool-summary-63DPIS7G.cjs +0 -31
  152. package/dist/tool-summary-NP5CDBKG.js +0 -31
  153. package/dist/updater-I7QBW4DP.cjs +0 -17
  154. package/dist/updater-NVME5S3Z.js +0 -17
@@ -0,0 +1,2 @@
1
+ import {h as h$1,a as a$1}from'./chunk-3QP5BQ3L.js';h$1();var a={fetchedAt:"2026-05-14T07:47:36.405Z",source:"https://openrouter.ai/api/v1/models",count:364,models:[{id:"anthropic/claude-opus-4.7-fast",name:"Anthropic: Claude Opus 4.7 (Fast)",created:1778613011,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:150,modalities:["text","image","file"]},{id:"perceptron/perceptron-mk1",name:"Perceptron: Perceptron Mk1",created:1778597029,contextLength:32768,maxOutputTokens:8192,inputPricePerMillion:.15,outputPricePerMillion:1.5,modalities:["text","image","video"]},{id:"inclusionai/ring-2.6-1t:free",name:"inclusionAI: Ring-2.6-1T (free)",created:1778247440,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"google/gemini-3.1-flash-lite",name:"Google: Gemini 3.1 Flash Lite",created:1778168828,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:.25,outputPricePerMillion:1.5,modalities:["text","image","video","file","audio"]},{id:"baidu/cobuddy:free",name:"Baidu Qianfan: CoBuddy (free)",created:1778035480,contextLength:131072,maxOutputTokens:65536,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"openai/gpt-chat-latest",name:"OpenAI: GPT Chat Latest",created:1778000212,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:30,modalities:["text","image","file"]},{id:"x-ai/grok-4.3",name:"xAI: Grok 4.3",created:1777591821,contextLength:1e6,maxOutputTokens:0,inputPricePerMillion:1.25,outputPricePerMillion:2.5,modalities:["text","image"]},{id:"ibm-granite/granite-4.1-8b",name:"IBM: Granite 4.1 8B",created:1777577071,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.049999999999999996,outputPricePerMillion:.09999999999999999,modalities:["text"]},{id:"mistralai/mistral-medium-3-5",name:"Mistral: Mistral Medium 3.5",created:1777570439,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:1.5,outputPricePerMillion:7.5,modalities:["text","image"]},{id:"openrouter/owl-alpha",name:"Owl Alpha",created:1777398589,contextLength:1048756,maxOutputTokens:262144,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free",name:"NVIDIA: Nemotron 3 Nano Omni (free)",created:1777393095,contextLength:256e3,maxOutputTokens:65536,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text","audio","image","video"]},{id:"poolside/laguna-xs.2:free",name:"Poolside: Laguna XS.2 (free)",created:1777389604,contextLength:131072,maxOutputTokens:8192,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"poolside/laguna-m.1:free",name:"Poolside: Laguna M.1 (free)",created:1777388504,contextLength:131072,maxOutputTokens:8192,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"~anthropic/claude-haiku-latest",name:"Anthropic Claude Haiku Latest",created:1777318492,contextLength:2e5,maxOutputTokens:64e3,inputPricePerMillion:1,outputPricePerMillion:5,modalities:["text","image","file"]},{id:"~openai/gpt-mini-latest",name:"OpenAI GPT Mini Latest",created:1777318471,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.75,outputPricePerMillion:4.5,modalities:["file","image","text"]},{id:"~google/gemini-pro-latest",name:"Google Gemini Pro Latest",created:1777318451,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:2,outputPricePerMillion:12,modalities:["audio","file","image","text","video"]},{id:"~moonshotai/kimi-latest",name:"MoonshotAI Kimi Latest",created:1777318428,contextLength:262142,maxOutputTokens:262142,inputPricePerMillion:.74,outputPricePerMillion:3.5,modalities:["text","image"]},{id:"~google/gemini-flash-latest",name:"Google Gemini Flash Latest",created:1777318398,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:.5,outputPricePerMillion:3,modalities:["text","image","file","audio","video"]},{id:"~anthropic/claude-sonnet-latest",name:"Anthropic Claude Sonnet Latest",created:1777318368,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text","image","file"]},{id:"~openai/gpt-latest",name:"OpenAI GPT Latest",created:1777318334,contextLength:105e4,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:30,modalities:["file","image","text"]},{id:"qwen/qwen3.5-plus-20260420",name:"Qwen: Qwen3.5 Plus 2026-04-20",created:1777261368,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2.4,modalities:["text","image","video"]},{id:"qwen/qwen3.6-flash",name:"Qwen: Qwen3.6 Flash",created:1777261362,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.25,outputPricePerMillion:1.5,modalities:["text","image","video"]},{id:"qwen/qwen3.6-35b-a3b",name:"Qwen: Qwen3.6 35B A3B",created:1777260255,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.15,outputPricePerMillion:1,modalities:["text","image","video"]},{id:"qwen/qwen3.6-max-preview",name:"Qwen: Qwen3.6 Max Preview",created:1777260242,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:1.04,outputPricePerMillion:6.24,modalities:["text"]},{id:"qwen/qwen3.6-27b",name:"Qwen: Qwen3.6 27B",created:1777255064,contextLength:262144,maxOutputTokens:81920,inputPricePerMillion:.32,outputPricePerMillion:3.1999999999999997,modalities:["text","image","video"]},{id:"openai/gpt-5.5-pro",name:"OpenAI: GPT-5.5 Pro",created:1777051896,contextLength:105e4,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:180,modalities:["file","image","text"]},{id:"openai/gpt-5.5",name:"OpenAI: GPT-5.5",created:1777051893,contextLength:105e4,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:30,modalities:["file","image","text"]},{id:"deepseek/deepseek-v4-pro",name:"DeepSeek: DeepSeek V4 Pro",created:1777000679,contextLength:1048576,maxOutputTokens:384e3,inputPricePerMillion:.435,outputPricePerMillion:.87,modalities:["text"]},{id:"deepseek/deepseek-v4-flash:free",name:"DeepSeek: DeepSeek V4 Flash (free)",created:1777000666,contextLength:256e3,maxOutputTokens:256e3,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"deepseek/deepseek-v4-flash",name:"DeepSeek: DeepSeek V4 Flash",created:1777000666,contextLength:1048576,maxOutputTokens:131072,inputPricePerMillion:.126,outputPricePerMillion:.252,modalities:["text"]},{id:"inclusionai/ling-2.6-1t",name:"inclusionAI: Ling-2.6-1T",created:1776948238,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.3,outputPricePerMillion:2.5,modalities:["text"]},{id:"tencent/hy3-preview",name:"Tencent: Hy3 preview",created:1776878150,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.06599999999999999,outputPricePerMillion:.26,modalities:["text"]},{id:"xiaomi/mimo-v2.5-pro",name:"Xiaomi: MiMo-V2.5-Pro",created:1776874273,contextLength:1048576,maxOutputTokens:16384,inputPricePerMillion:1,outputPricePerMillion:3,modalities:["text"]},{id:"xiaomi/mimo-v2.5",name:"Xiaomi: MiMo-V2.5",created:1776874269,contextLength:1048576,maxOutputTokens:131072,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text","audio","image","video"]},{id:"openai/gpt-5.4-image-2",name:"OpenAI: GPT-5.4 Image 2",created:1776797528,contextLength:272e3,maxOutputTokens:128e3,inputPricePerMillion:8,outputPricePerMillion:15,modalities:["image","text","file"]},{id:"inclusionai/ling-2.6-flash",name:"inclusionAI: Ling-2.6-flash",created:1776795886,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.08,outputPricePerMillion:.24,modalities:["text"]},{id:"~anthropic/claude-opus-latest",name:"Anthropic: Claude Opus Latest",created:1776795361,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:25,modalities:["text","image","file"]},{id:"openrouter/pareto-code",name:"Pareto Code Router",created:1776747900,contextLength:2e6,maxOutputTokens:0,inputPricePerMillion:-1e6,outputPricePerMillion:-1e6,modalities:["text"]},{id:"baidu/qianfan-ocr-fast:free",name:"Baidu: Qianfan-OCR-Fast (free)",created:1776707472,contextLength:65536,maxOutputTokens:28672,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["image","text"]},{id:"moonshotai/kimi-k2.6",name:"MoonshotAI: Kimi K2.6",created:1776699402,contextLength:262142,maxOutputTokens:262142,inputPricePerMillion:.74,outputPricePerMillion:3.5,modalities:["text","image"]},{id:"anthropic/claude-opus-4.7",name:"Anthropic: Claude Opus 4.7",created:1776351100,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:25,modalities:["text","image","file"]},{id:"anthropic/claude-opus-4.6-fast",name:"Anthropic: Claude Opus 4.6 (Fast)",created:1775592472,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:150,modalities:["text","image","file"]},{id:"z-ai/glm-5.1",name:"Z.ai: GLM 5.1",created:1775578025,contextLength:202752,maxOutputTokens:65535,inputPricePerMillion:1.0499999999999998,outputPricePerMillion:3.5,modalities:["text"]},{id:"google/gemma-4-26b-a4b-it:free",name:"Google: Gemma 4 26B A4B (free)",created:1775227989,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["image","text","video"]},{id:"google/gemma-4-26b-a4b-it",name:"Google: Gemma 4 26B A4B ",created:1775227989,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.06,outputPricePerMillion:.33,modalities:["image","text","video"]},{id:"google/gemma-4-31b-it:free",name:"Google: Gemma 4 31B (free)",created:1775148486,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["image","text","video"]},{id:"google/gemma-4-31b-it",name:"Google: Gemma 4 31B",created:1775148486,contextLength:262144,maxOutputTokens:16384,inputPricePerMillion:.12,outputPricePerMillion:.37,modalities:["image","text","video"]},{id:"qwen/qwen3.6-plus",name:"Qwen: Qwen3.6 Plus",created:1775133557,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.325,outputPricePerMillion:1.95,modalities:["text","image","video"]},{id:"z-ai/glm-5v-turbo",name:"Z.ai: GLM 5V Turbo",created:1775061458,contextLength:202752,maxOutputTokens:131072,inputPricePerMillion:1.2,outputPricePerMillion:4,modalities:["image","text","video"]},{id:"arcee-ai/trinity-large-thinking:free",name:"Arcee AI: Trinity Large Thinking (free)",created:1775058318,contextLength:262144,maxOutputTokens:8e4,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"arcee-ai/trinity-large-thinking",name:"Arcee AI: Trinity Large Thinking",created:1775058318,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.22,outputPricePerMillion:.85,modalities:["text"]},{id:"x-ai/grok-4.20-multi-agent",name:"xAI: Grok 4.20 Multi-Agent",created:1774979158,contextLength:2e6,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text","image","file"]},{id:"x-ai/grok-4.20",name:"xAI: Grok 4.20",created:1774979019,contextLength:2e6,maxOutputTokens:0,inputPricePerMillion:1.25,outputPricePerMillion:2.5,modalities:["text","image","file"]},{id:"google/lyria-3-pro-preview",name:"Google: Lyria 3 Pro Preview",created:1774907286,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text","image"]},{id:"google/lyria-3-clip-preview",name:"Google: Lyria 3 Clip Preview",created:1774907255,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text","image"]},{id:"kwaipilot/kat-coder-pro-v2",name:"Kwaipilot: KAT-Coder-Pro V2",created:1774649310,contextLength:256e3,maxOutputTokens:8e4,inputPricePerMillion:.3,outputPricePerMillion:1.2,modalities:["text"]},{id:"rekaai/reka-edge",name:"Reka Edge",created:1774026965,contextLength:16384,maxOutputTokens:16384,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.09999999999999999,modalities:["image","text","video"]},{id:"xiaomi/mimo-v2-omni",name:"Xiaomi: MiMo-V2-Omni",created:1773863703,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text","audio","image","video"]},{id:"xiaomi/mimo-v2-pro",name:"Xiaomi: MiMo-V2-Pro",created:1773863643,contextLength:1048576,maxOutputTokens:131072,inputPricePerMillion:1,outputPricePerMillion:3,modalities:["text"]},{id:"minimax/minimax-m2.7",name:"MiniMax: MiniMax M2.7",created:1773836697,contextLength:196608,maxOutputTokens:131072,inputPricePerMillion:.27899999999999997,outputPricePerMillion:1.2,modalities:["text"]},{id:"openai/gpt-5.4-nano",name:"OpenAI: GPT-5.4 Nano",created:1773748187,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.19999999999999998,outputPricePerMillion:1.25,modalities:["file","image","text"]},{id:"openai/gpt-5.4-mini",name:"OpenAI: GPT-5.4 Mini",created:1773748178,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.75,outputPricePerMillion:4.5,modalities:["file","image","text"]},{id:"mistralai/mistral-small-2603",name:"Mistral: Mistral Small 4",created:1773695685,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text","image"]},{id:"z-ai/glm-5-turbo",name:"Z.ai: GLM 5 Turbo",created:1773583573,contextLength:202752,maxOutputTokens:131072,inputPricePerMillion:1.2,outputPricePerMillion:4,modalities:["text"]},{id:"nvidia/nemotron-3-super-120b-a12b:free",name:"NVIDIA: Nemotron 3 Super (free)",created:1773245239,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"nvidia/nemotron-3-super-120b-a12b",name:"NVIDIA: Nemotron 3 Super",created:1773245239,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.09,outputPricePerMillion:.44999999999999996,modalities:["text"]},{id:"bytedance-seed/seed-2.0-lite",name:"ByteDance Seed: Seed-2.0-Lite",created:1773157231,contextLength:262144,maxOutputTokens:131072,inputPricePerMillion:.25,outputPricePerMillion:2,modalities:["text","image","video"]},{id:"qwen/qwen3.5-9b",name:"Qwen: Qwen3.5-9B",created:1773152396,contextLength:262144,maxOutputTokens:81920,inputPricePerMillion:.04,outputPricePerMillion:.15,modalities:["text","image","video"]},{id:"openai/gpt-5.4-pro",name:"OpenAI: GPT-5.4 Pro",created:1772734366,contextLength:105e4,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:180,modalities:["text","image","file"]},{id:"openai/gpt-5.4",name:"OpenAI: GPT-5.4",created:1772734352,contextLength:105e4,maxOutputTokens:128e3,inputPricePerMillion:2.5,outputPricePerMillion:15,modalities:["text","image","file"]},{id:"inception/mercury-2",name:"Inception: Mercury 2",created:1772636275,contextLength:128e3,maxOutputTokens:5e4,inputPricePerMillion:.25,outputPricePerMillion:.75,modalities:["text"]},{id:"openai/gpt-5.3-chat",name:"OpenAI: GPT-5.3 Chat",created:1772564061,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["text","image","file"]},{id:"google/gemini-3.1-flash-lite-preview",name:"Google: Gemini 3.1 Flash Lite Preview",created:1772512673,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:.25,outputPricePerMillion:1.5,modalities:["text","image","video","file","audio"]},{id:"bytedance-seed/seed-2.0-mini",name:"ByteDance Seed: Seed-2.0-Mini",created:1772131107,contextLength:262144,maxOutputTokens:131072,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["text","image","video"]},{id:"google/gemini-3.1-flash-image-preview",name:"Google: Nano Banana 2 (Gemini 3.1 Flash Image Preview)",created:1772119558,contextLength:65536,maxOutputTokens:65536,inputPricePerMillion:.5,outputPricePerMillion:3,modalities:["image","text"]},{id:"qwen/qwen3.5-35b-a3b",name:"Qwen: Qwen3.5-35B-A3B",created:1772053822,contextLength:262144,maxOutputTokens:81920,inputPricePerMillion:.14,outputPricePerMillion:1,modalities:["text","image","video"]},{id:"qwen/qwen3.5-27b",name:"Qwen: Qwen3.5-27B",created:1772053810,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.195,outputPricePerMillion:1.56,modalities:["text","image","video"]},{id:"qwen/qwen3.5-122b-a10b",name:"Qwen: Qwen3.5-122B-A10B",created:1772053789,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.26,outputPricePerMillion:2.08,modalities:["text","image","video"]},{id:"qwen/qwen3.5-flash-02-23",name:"Qwen: Qwen3.5-Flash",created:1772053776,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.065,outputPricePerMillion:.26,modalities:["text","image","video"]},{id:"liquid/lfm-2-24b-a2b",name:"LiquidAI: LFM2-24B-A2B",created:1772048711,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.03,outputPricePerMillion:.12,modalities:["text"]},{id:"google/gemini-3.1-pro-preview-customtools",name:"Google: Gemini 3.1 Pro Preview Custom Tools",created:1772045923,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:2,outputPricePerMillion:12,modalities:["text","audio","image","video","file"]},{id:"openai/gpt-5.3-codex",name:"OpenAI: GPT-5.3-Codex",created:1771959164,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["text","image","file"]},{id:"aion-labs/aion-2.0",name:"AionLabs: Aion-2.0",created:1771881306,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.7999999999999999,outputPricePerMillion:1.5999999999999999,modalities:["text"]},{id:"google/gemini-3.1-pro-preview",name:"Google: Gemini 3.1 Pro Preview",created:1771509627,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:2,outputPricePerMillion:12,modalities:["audio","file","image","text","video"]},{id:"anthropic/claude-sonnet-4.6",name:"Anthropic: Claude Sonnet 4.6",created:1771342990,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text","image","file"]},{id:"qwen/qwen3.5-plus-02-15",name:"Qwen: Qwen3.5 Plus 2026-02-15",created:1771229416,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.26,outputPricePerMillion:1.56,modalities:["text","image","video"]},{id:"qwen/qwen3.5-397b-a17b",name:"Qwen: Qwen3.5 397B A17B",created:1771223018,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.39,outputPricePerMillion:2.34,modalities:["text","image","video"]},{id:"minimax/minimax-m2.5:free",name:"MiniMax: MiniMax M2.5 (free)",created:1770908502,contextLength:196608,maxOutputTokens:8192,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"minimax/minimax-m2.5",name:"MiniMax: MiniMax M2.5",created:1770908502,contextLength:196608,maxOutputTokens:196608,inputPricePerMillion:.15,outputPricePerMillion:1.15,modalities:["text"]},{id:"z-ai/glm-5",name:"Z.ai: GLM 5",created:1770829182,contextLength:202752,maxOutputTokens:0,inputPricePerMillion:.6,outputPricePerMillion:1.92,modalities:["text"]},{id:"qwen/qwen3-max-thinking",name:"Qwen: Qwen3 Max Thinking",created:1770671901,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.78,outputPricePerMillion:3.9,modalities:["text"]},{id:"anthropic/claude-opus-4.6",name:"Anthropic: Claude Opus 4.6",created:1770219050,contextLength:1e6,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:25,modalities:["text","image","file"]},{id:"qwen/qwen3-coder-next",name:"Qwen: Qwen3 Coder Next",created:1770164101,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.11,outputPricePerMillion:.7999999999999999,modalities:["text"]},{id:"openrouter/free",name:"Free Models Router",created:1769917427,contextLength:2e5,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text","image"]},{id:"stepfun/step-3.5-flash",name:"StepFun: Step 3.5 Flash",created:1769728337,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.3,modalities:["text"]},{id:"arcee-ai/trinity-large-preview",name:"Arcee AI: Trinity Large Preview",created:1769552670,contextLength:131e3,maxOutputTokens:0,inputPricePerMillion:.15,outputPricePerMillion:.44999999999999996,modalities:["text"]},{id:"moonshotai/kimi-k2.5",name:"MoonshotAI: Kimi K2.5",created:1769487076,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.39999999999999997,outputPricePerMillion:1.9,modalities:["text","image"]},{id:"upstage/solar-pro-3",name:"Upstage: Solar Pro 3",created:1769481200,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text"]},{id:"minimax/minimax-m2-her",name:"MiniMax: MiniMax M2-her",created:1769177239,contextLength:65536,maxOutputTokens:2048,inputPricePerMillion:.3,outputPricePerMillion:1.2,modalities:["text"]},{id:"writer/palmyra-x5",name:"Writer: Palmyra X5",created:1769003823,contextLength:104e4,maxOutputTokens:8192,inputPricePerMillion:.6,outputPricePerMillion:6,modalities:["text"]},{id:"liquid/lfm-2.5-1.2b-thinking:free",name:"LiquidAI: LFM2.5-1.2B-Thinking (free)",created:1768927527,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"liquid/lfm-2.5-1.2b-instruct:free",name:"LiquidAI: LFM2.5-1.2B-Instruct (free)",created:1768927521,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"openai/gpt-audio",name:"OpenAI: GPT Audio",created:1768862569,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text","audio"]},{id:"openai/gpt-audio-mini",name:"OpenAI: GPT Audio Mini",created:1768859419,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:.6,outputPricePerMillion:2.4,modalities:["text","audio"]},{id:"z-ai/glm-4.7-flash",name:"Z.ai: GLM 4.7 Flash",created:1768833913,contextLength:202752,maxOutputTokens:16384,inputPricePerMillion:.06,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"openai/gpt-5.2-codex",name:"OpenAI: GPT-5.2-Codex",created:1768409315,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["text","image"]},{id:"bytedance-seed/seed-1.6-flash",name:"ByteDance Seed: Seed 1.6 Flash",created:1766505011,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.075,outputPricePerMillion:.3,modalities:["image","text","video"]},{id:"bytedance-seed/seed-1.6",name:"ByteDance Seed: Seed 1.6",created:1766504997,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.25,outputPricePerMillion:2,modalities:["image","text","video"]},{id:"minimax/minimax-m2.1",name:"MiniMax: MiniMax M2.1",created:1766454997,contextLength:196608,maxOutputTokens:196608,inputPricePerMillion:.29,outputPricePerMillion:.95,modalities:["text"]},{id:"z-ai/glm-4.7",name:"Z.ai: GLM 4.7",created:1766378014,contextLength:202752,maxOutputTokens:131072,inputPricePerMillion:.39999999999999997,outputPricePerMillion:1.75,modalities:["text"]},{id:"google/gemini-3-flash-preview",name:"Google: Gemini 3 Flash Preview",created:1765987078,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:.5,outputPricePerMillion:3,modalities:["text","image","file","audio","video"]},{id:"xiaomi/mimo-v2-flash",name:"Xiaomi: MiMo-V2-Flash",created:1765731308,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.3,modalities:["text"]},{id:"nvidia/nemotron-3-nano-30b-a3b:free",name:"NVIDIA: Nemotron 3 Nano 30B A3B (free)",created:1765731275,contextLength:256e3,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"nvidia/nemotron-3-nano-30b-a3b",name:"NVIDIA: Nemotron 3 Nano 30B A3B",created:1765731275,contextLength:262144,maxOutputTokens:228e3,inputPricePerMillion:.049999999999999996,outputPricePerMillion:.19999999999999998,modalities:["text"]},{id:"openai/gpt-5.2-chat",name:"OpenAI: GPT-5.2 Chat",created:1765389783,contextLength:128e3,maxOutputTokens:32e3,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["file","image","text"]},{id:"openai/gpt-5.2-pro",name:"OpenAI: GPT-5.2 Pro",created:1765389780,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:21,outputPricePerMillion:168,modalities:["image","text","file"]},{id:"openai/gpt-5.2",name:"OpenAI: GPT-5.2",created:1765389775,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["file","image","text"]},{id:"mistralai/devstral-2512",name:"Mistral: Devstral 2 2512",created:1765285419,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text"]},{id:"relace/relace-search",name:"Relace: Relace Search",created:1765213560,contextLength:256e3,maxOutputTokens:128e3,inputPricePerMillion:1,outputPricePerMillion:3,modalities:["text"]},{id:"z-ai/glm-4.6v",name:"Z.ai: GLM 4.6V",created:1765207462,contextLength:131072,maxOutputTokens:24e3,inputPricePerMillion:.3,outputPricePerMillion:.8999999999999999,modalities:["image","text","video"]},{id:"nex-agi/deepseek-v3.1-nex-n1",name:"Nex AGI: DeepSeek V3.1 Nex N1",created:1765204393,contextLength:131072,maxOutputTokens:163840,inputPricePerMillion:.135,outputPricePerMillion:.5,modalities:["text"]},{id:"essentialai/rnj-1-instruct",name:"EssentialAI: Rnj 1 Instruct",created:1765094847,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.15,outputPricePerMillion:.15,modalities:["text"]},{id:"openrouter/bodybuilder",name:"Body Builder (beta)",created:1764903653,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:-1e6,outputPricePerMillion:-1e6,modalities:["text"]},{id:"openai/gpt-5.1-codex-max",name:"OpenAI: GPT-5.1-Codex-Max",created:1764878934,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image"]},{id:"amazon/nova-2-lite-v1",name:"Amazon: Nova 2 Lite",created:1764696672,contextLength:1e6,maxOutputTokens:65535,inputPricePerMillion:.3,outputPricePerMillion:2.5,modalities:["text","image","video","file"]},{id:"mistralai/ministral-14b-2512",name:"Mistral: Ministral 3 14B 2512",created:1764681735,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.19999999999999998,modalities:["text","image"]},{id:"mistralai/ministral-8b-2512",name:"Mistral: Ministral 3 8B 2512",created:1764681654,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.15,outputPricePerMillion:.15,modalities:["text","image"]},{id:"mistralai/ministral-3b-2512",name:"Mistral: Ministral 3 3B 2512",created:1764681560,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.09999999999999999,modalities:["text","image"]},{id:"mistralai/mistral-large-2512",name:"Mistral: Mistral Large 3 2512",created:1764624472,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:.5,outputPricePerMillion:1.5,modalities:["text","image"]},{id:"arcee-ai/trinity-mini",name:"Arcee AI: Trinity Mini",created:1764601720,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.045,outputPricePerMillion:.15,modalities:["text"]},{id:"deepseek/deepseek-v3.2-speciale",name:"DeepSeek: DeepSeek V3.2 Speciale",created:1764594837,contextLength:163840,maxOutputTokens:163840,inputPricePerMillion:.28700000000000003,outputPricePerMillion:.431,modalities:["text"]},{id:"deepseek/deepseek-v3.2",name:"DeepSeek: DeepSeek V3.2",created:1764594642,contextLength:131072,maxOutputTokens:65536,inputPricePerMillion:.252,outputPricePerMillion:.378,modalities:["text"]},{id:"prime-intellect/intellect-3",name:"Prime Intellect: INTELLECT-3",created:1764212534,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.19999999999999998,outputPricePerMillion:1.1,modalities:["text"]},{id:"anthropic/claude-opus-4.5",name:"Anthropic: Claude Opus 4.5",created:1764010580,contextLength:2e5,maxOutputTokens:64e3,inputPricePerMillion:5,outputPricePerMillion:25,modalities:["file","image","text"]},{id:"allenai/olmo-3-32b-think",name:"AllenAI: Olmo 3 32B Think",created:1763758276,contextLength:65536,maxOutputTokens:65536,inputPricePerMillion:.15,outputPricePerMillion:.5,modalities:["text"]},{id:"google/gemini-3-pro-image-preview",name:"Google: Nano Banana Pro (Gemini 3 Pro Image Preview)",created:1763653797,contextLength:65536,maxOutputTokens:32768,inputPricePerMillion:2,outputPricePerMillion:12,modalities:["image","text"]},{id:"x-ai/grok-4.1-fast",name:"xAI: Grok 4.1 Fast",created:1763587502,contextLength:2e6,maxOutputTokens:3e4,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.5,modalities:["text","image","file"]},{id:"deepcogito/cogito-v2.1-671b",name:"Deep Cogito: Cogito v2.1 671B",created:1763071233,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:1.25,outputPricePerMillion:1.25,modalities:["text"]},{id:"openai/gpt-5.1",name:"OpenAI: GPT-5.1",created:1763060305,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["image","text","file"]},{id:"openai/gpt-5.1-chat",name:"OpenAI: GPT-5.1 Chat",created:1763060302,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["file","image","text"]},{id:"openai/gpt-5.1-codex",name:"OpenAI: GPT-5.1-Codex",created:1763060298,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image"]},{id:"openai/gpt-5.1-codex-mini",name:"OpenAI: GPT-5.1-Codex-Mini",created:1763057820,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.25,outputPricePerMillion:2,modalities:["image","text"]},{id:"moonshotai/kimi-k2-thinking",name:"MoonshotAI: Kimi K2 Thinking",created:1762440622,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.6,outputPricePerMillion:2.5,modalities:["text"]},{id:"amazon/nova-premier-v1",name:"Amazon: Nova Premier 1.0",created:1761950332,contextLength:1e6,maxOutputTokens:32e3,inputPricePerMillion:2.5,outputPricePerMillion:12.5,modalities:["text","image"]},{id:"perplexity/sonar-pro-search",name:"Perplexity: Sonar Pro Search",created:1761854366,contextLength:2e5,maxOutputTokens:8e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text","image"]},{id:"mistralai/voxtral-small-24b-2507",name:"Mistral: Voxtral Small 24B 2507",created:1761835144,contextLength:32e3,maxOutputTokens:0,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.3,modalities:["text","audio"]},{id:"openai/gpt-oss-safeguard-20b",name:"OpenAI: gpt-oss-safeguard-20b",created:1761752836,contextLength:131072,maxOutputTokens:65536,inputPricePerMillion:.075,outputPricePerMillion:.3,modalities:["text"]},{id:"nvidia/nemotron-nano-12b-v2-vl:free",name:"NVIDIA: Nemotron Nano 12B 2 VL (free)",created:1761675565,contextLength:128e3,maxOutputTokens:128e3,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["image","text","video"]},{id:"minimax/minimax-m2",name:"MiniMax: MiniMax M2",created:1761252093,contextLength:196608,maxOutputTokens:196608,inputPricePerMillion:.255,outputPricePerMillion:1,modalities:["text"]},{id:"qwen/qwen3-vl-32b-instruct",name:"Qwen: Qwen3 VL 32B Instruct",created:1761231332,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.10400000000000001,outputPricePerMillion:.41600000000000004,modalities:["text","image"]},{id:"ibm-granite/granite-4.0-h-micro",name:"IBM: Granite 4.0 Micro",created:1760927695,contextLength:131e3,maxOutputTokens:0,inputPricePerMillion:.017,outputPricePerMillion:.11,modalities:["text"]},{id:"microsoft/phi-4-mini-instruct",name:"Microsoft: Phi 4 Mini Instruct",created:1760726049,contextLength:128e3,maxOutputTokens:128e3,inputPricePerMillion:.08,outputPricePerMillion:.35,modalities:["text"]},{id:"openai/gpt-5-image-mini",name:"OpenAI: GPT-5 Image Mini",created:1760624583,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:2.5,outputPricePerMillion:2,modalities:["file","image","text"]},{id:"anthropic/claude-haiku-4.5",name:"Anthropic: Claude Haiku 4.5",created:1760547638,contextLength:2e5,maxOutputTokens:64e3,inputPricePerMillion:1,outputPricePerMillion:5,modalities:["text","image","file"]},{id:"qwen/qwen3-vl-8b-thinking",name:"Qwen: Qwen3 VL 8B Thinking",created:1760463746,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.117,outputPricePerMillion:1.365,modalities:["image","text"]},{id:"qwen/qwen3-vl-8b-instruct",name:"Qwen: Qwen3 VL 8B Instruct",created:1760463308,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.08,outputPricePerMillion:.5,modalities:["image","text"]},{id:"openai/gpt-5-image",name:"OpenAI: GPT-5 Image",created:1760447986,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:10,outputPricePerMillion:10,modalities:["image","text","file"]},{id:"openai/o3-deep-research",name:"OpenAI: o3 Deep Research",created:1760129661,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:10,outputPricePerMillion:40,modalities:["image","text","file"]},{id:"openai/o4-mini-deep-research",name:"OpenAI: o4 Mini Deep Research",created:1760129642,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["file","image","text"]},{id:"nvidia/llama-3.3-nemotron-super-49b-v1.5",name:"NVIDIA: Llama 3.3 Nemotron Super 49B V1.5",created:1760101395,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"baidu/ernie-4.5-21b-a3b-thinking",name:"Baidu: ERNIE 4.5 21B A3B Thinking",created:1760048887,contextLength:131072,maxOutputTokens:65536,inputPricePerMillion:.07,outputPricePerMillion:.28,modalities:["text"]},{id:"google/gemini-2.5-flash-image",name:"Google: Nano Banana (Gemini 2.5 Flash Image)",created:1759870431,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.3,outputPricePerMillion:2.5,modalities:["image","text"]},{id:"qwen/qwen3-vl-30b-a3b-thinking",name:"Qwen: Qwen3 VL 30B A3B Thinking",created:1759794479,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.13,outputPricePerMillion:1.56,modalities:["text","image"]},{id:"qwen/qwen3-vl-30b-a3b-instruct",name:"Qwen: Qwen3 VL 30B A3B Instruct",created:1759794476,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.13,outputPricePerMillion:.52,modalities:["text","image"]},{id:"openai/gpt-5-pro",name:"OpenAI: GPT-5 Pro",created:1759776663,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:15,outputPricePerMillion:120,modalities:["image","text","file"]},{id:"z-ai/glm-4.6",name:"Z.ai: GLM 4.6",created:1759235576,contextLength:202752,maxOutputTokens:131072,inputPricePerMillion:.43,outputPricePerMillion:1.74,modalities:["text"]},{id:"anthropic/claude-sonnet-4.5",name:"Anthropic: Claude Sonnet 4.5",created:1759161676,contextLength:1e6,maxOutputTokens:64e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text","image","file"]},{id:"deepseek/deepseek-v3.2-exp",name:"DeepSeek: DeepSeek V3.2 Exp",created:1759150481,contextLength:163840,maxOutputTokens:65536,inputPricePerMillion:.27,outputPricePerMillion:.41,modalities:["text"]},{id:"thedrummer/cydonia-24b-v4.1",name:"TheDrummer: Cydonia 24B V4.1",created:1758931878,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.3,outputPricePerMillion:.5,modalities:["text"]},{id:"relace/relace-apply-3",name:"Relace: Relace Apply 3",created:1758891572,contextLength:256e3,maxOutputTokens:128e3,inputPricePerMillion:.85,outputPricePerMillion:1.25,modalities:["text"]},{id:"google/gemini-2.5-flash-lite-preview-09-2025",name:"Google: Gemini 2.5 Flash Lite Preview 09-2025",created:1758819686,contextLength:1048576,maxOutputTokens:65535,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["text","image","file","audio","video"]},{id:"qwen/qwen3-vl-235b-a22b-thinking",name:"Qwen: Qwen3 VL 235B A22B Thinking",created:1758668690,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.26,outputPricePerMillion:2.6,modalities:["text","image"]},{id:"qwen/qwen3-vl-235b-a22b-instruct",name:"Qwen: Qwen3 VL 235B A22B Instruct",created:1758668687,contextLength:262144,maxOutputTokens:16384,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.88,modalities:["text","image"]},{id:"qwen/qwen3-max",name:"Qwen: Qwen3 Max",created:1758662808,contextLength:262144,maxOutputTokens:32768,inputPricePerMillion:.78,outputPricePerMillion:3.9,modalities:["text"]},{id:"qwen/qwen3-coder-plus",name:"Qwen: Qwen3 Coder Plus",created:1758662707,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.65,outputPricePerMillion:3.25,modalities:["text"]},{id:"openai/gpt-5-codex",name:"OpenAI: GPT-5 Codex",created:1758643403,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image"]},{id:"deepseek/deepseek-v3.1-terminus",name:"DeepSeek: DeepSeek V3.1 Terminus",created:1758548275,contextLength:163840,maxOutputTokens:32768,inputPricePerMillion:.27,outputPricePerMillion:.95,modalities:["text"]},{id:"x-ai/grok-4-fast",name:"xAI: Grok 4 Fast",created:1758240090,contextLength:2e6,maxOutputTokens:3e4,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.5,modalities:["text","image","file"]},{id:"alibaba/tongyi-deepresearch-30b-a3b",name:"Tongyi DeepResearch 30B A3B",created:1758210804,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.09,outputPricePerMillion:.44999999999999996,modalities:["text"]},{id:"qwen/qwen3-coder-flash",name:"Qwen: Qwen3 Coder Flash",created:1758115536,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.195,outputPricePerMillion:.975,modalities:["text"]},{id:"qwen/qwen3-next-80b-a3b-thinking",name:"Qwen: Qwen3 Next 80B A3B Thinking",created:1757612284,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.0975,outputPricePerMillion:.78,modalities:["text"]},{id:"qwen/qwen3-next-80b-a3b-instruct:free",name:"Qwen: Qwen3 Next 80B A3B Instruct (free)",created:1757612213,contextLength:262144,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"qwen/qwen3-next-80b-a3b-instruct",name:"Qwen: Qwen3 Next 80B A3B Instruct",created:1757612213,contextLength:262144,maxOutputTokens:16384,inputPricePerMillion:.09,outputPricePerMillion:1.1,modalities:["text"]},{id:"qwen/qwen-plus-2025-07-28:thinking",name:"Qwen: Qwen Plus 0728 (thinking)",created:1757347599,contextLength:1e6,maxOutputTokens:32768,inputPricePerMillion:.26,outputPricePerMillion:.78,modalities:["text"]},{id:"qwen/qwen-plus-2025-07-28",name:"Qwen: Qwen Plus 0728",created:1757347599,contextLength:1e6,maxOutputTokens:32768,inputPricePerMillion:.26,outputPricePerMillion:.78,modalities:["text"]},{id:"nvidia/nemotron-nano-9b-v2:free",name:"NVIDIA: Nemotron Nano 9B V2 (free)",created:1757106807,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"nvidia/nemotron-nano-9b-v2",name:"NVIDIA: Nemotron Nano 9B V2",created:1757106807,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.04,outputPricePerMillion:.16,modalities:["text"]},{id:"moonshotai/kimi-k2-0905",name:"MoonshotAI: Kimi K2 0905",created:1757021147,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.6,outputPricePerMillion:2.5,modalities:["text"]},{id:"qwen/qwen3-30b-a3b-thinking-2507",name:"Qwen: Qwen3 30B A3B Thinking 2507",created:1756399192,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.08,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"x-ai/grok-code-fast-1",name:"xAI: Grok Code Fast 1",created:1756238927,contextLength:256e3,maxOutputTokens:1e4,inputPricePerMillion:.19999999999999998,outputPricePerMillion:1.5,modalities:["text"]},{id:"nousresearch/hermes-4-70b",name:"Nous: Hermes 4 70B",created:1756236182,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.13,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"nousresearch/hermes-4-405b",name:"Nous: Hermes 4 405B",created:1756235463,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:1,outputPricePerMillion:3,modalities:["text"]},{id:"deepseek/deepseek-chat-v3.1",name:"DeepSeek: DeepSeek V3.1",created:1755779628,contextLength:163840,maxOutputTokens:32768,inputPricePerMillion:.21,outputPricePerMillion:.7899999999999999,modalities:["text"]},{id:"openai/gpt-4o-audio-preview",name:"OpenAI: GPT-4o Audio",created:1755233061,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["audio","text"]},{id:"mistralai/mistral-medium-3.1",name:"Mistral: Mistral Medium 3.1",created:1755095639,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text","image"]},{id:"baidu/ernie-4.5-21b-a3b",name:"Baidu: ERNIE 4.5 21B A3B",created:1755034167,contextLength:12e4,maxOutputTokens:8e3,inputPricePerMillion:.07,outputPricePerMillion:.28,modalities:["text"]},{id:"baidu/ernie-4.5-vl-28b-a3b",name:"Baidu: ERNIE 4.5 VL 28B A3B",created:1755032836,contextLength:3e4,maxOutputTokens:8e3,inputPricePerMillion:.14,outputPricePerMillion:.56,modalities:["text","image"]},{id:"z-ai/glm-4.5v",name:"Z.ai: GLM 4.5V",created:1754922288,contextLength:65536,maxOutputTokens:16384,inputPricePerMillion:.6,outputPricePerMillion:1.7999999999999998,modalities:["text","image"]},{id:"ai21/jamba-large-1.7",name:"AI21: Jamba Large 1.7",created:1754669020,contextLength:256e3,maxOutputTokens:4096,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["text"]},{id:"openai/gpt-5-chat",name:"OpenAI: GPT-5 Chat",created:1754587837,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["file","image","text"]},{id:"openai/gpt-5",name:"OpenAI: GPT-5",created:1754587413,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image","file"]},{id:"openai/gpt-5-mini",name:"OpenAI: GPT-5 Mini",created:1754587407,contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.25,outputPricePerMillion:2,modalities:["text","image","file"]},{id:"openai/gpt-5-nano",name:"OpenAI: GPT-5 Nano",created:1754587402,contextLength:4e5,maxOutputTokens:0,inputPricePerMillion:.049999999999999996,outputPricePerMillion:.39999999999999997,modalities:["text","image","file"]},{id:"openai/gpt-oss-120b:free",name:"OpenAI: gpt-oss-120b (free)",created:1754414231,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"openai/gpt-oss-120b",name:"OpenAI: gpt-oss-120b",created:1754414231,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.039,outputPricePerMillion:.18,modalities:["text"]},{id:"openai/gpt-oss-20b:free",name:"OpenAI: gpt-oss-20b (free)",created:1754414229,contextLength:131072,maxOutputTokens:8192,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"openai/gpt-oss-20b",name:"OpenAI: gpt-oss-20b",created:1754414229,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.03,outputPricePerMillion:.14,modalities:["text"]},{id:"anthropic/claude-opus-4.1",name:"Anthropic: Claude Opus 4.1",created:1754411591,contextLength:2e5,maxOutputTokens:32e3,inputPricePerMillion:15,outputPricePerMillion:75,modalities:["image","text","file"]},{id:"mistralai/codestral-2508",name:"Mistral: Codestral 2508",created:1754079630,contextLength:256e3,maxOutputTokens:0,inputPricePerMillion:.3,outputPricePerMillion:.8999999999999999,modalities:["text"]},{id:"qwen/qwen3-coder-30b-a3b-instruct",name:"Qwen: Qwen3 Coder 30B A3B Instruct",created:1753972379,contextLength:16e4,maxOutputTokens:32768,inputPricePerMillion:.07,outputPricePerMillion:.27,modalities:["text"]},{id:"qwen/qwen3-30b-a3b-instruct-2507",name:"Qwen: Qwen3 30B A3B Instruct 2507",created:1753806965,contextLength:262144,maxOutputTokens:262144,inputPricePerMillion:.09,outputPricePerMillion:.3,modalities:["text"]},{id:"z-ai/glm-4.5",name:"Z.ai: GLM 4.5",created:1753471347,contextLength:131072,maxOutputTokens:98304,inputPricePerMillion:.6,outputPricePerMillion:2.2,modalities:["text"]},{id:"z-ai/glm-4.5-air:free",name:"Z.ai: GLM 4.5 Air (free)",created:1753471258,contextLength:131072,maxOutputTokens:96e3,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"z-ai/glm-4.5-air",name:"Z.ai: GLM 4.5 Air",created:1753471258,contextLength:131072,maxOutputTokens:98304,inputPricePerMillion:.13,outputPricePerMillion:.85,modalities:["text"]},{id:"qwen/qwen3-235b-a22b-thinking-2507",name:"Qwen: Qwen3 235B A22B Thinking 2507",created:1753449557,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.14950000000000002,outputPricePerMillion:1.495,modalities:["text"]},{id:"z-ai/glm-4-32b",name:"Z.ai: GLM 4 32B ",created:1753376617,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.09999999999999999,modalities:["text"]},{id:"qwen/qwen3-coder:free",name:"Qwen: Qwen3 Coder 480B A35B (free)",created:1753230546,contextLength:262e3,maxOutputTokens:262e3,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"qwen/qwen3-coder",name:"Qwen: Qwen3 Coder 480B A35B",created:1753230546,contextLength:262144,maxOutputTokens:65536,inputPricePerMillion:.22,outputPricePerMillion:1.7999999999999998,modalities:["text"]},{id:"bytedance/ui-tars-1.5-7b",name:"ByteDance: UI-TARS 7B ",created:1753205056,contextLength:128e3,maxOutputTokens:2048,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.19999999999999998,modalities:["image","text"]},{id:"google/gemini-2.5-flash-lite",name:"Google: Gemini 2.5 Flash Lite",created:1753200276,contextLength:1048576,maxOutputTokens:65535,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["text","image","file","audio","video"]},{id:"qwen/qwen3-235b-a22b-2507",name:"Qwen: Qwen3 235B A22B Instruct 2507",created:1753119555,contextLength:262144,maxOutputTokens:16384,inputPricePerMillion:.071,outputPricePerMillion:.09999999999999999,modalities:["text"]},{id:"switchpoint/router",name:"Switchpoint Router",created:1752272899,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.85,outputPricePerMillion:3.4,modalities:["text"]},{id:"moonshotai/kimi-k2",name:"MoonshotAI: Kimi K2 0711",created:1752263252,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.5700000000000001,outputPricePerMillion:2.3,modalities:["text"]},{id:"mistralai/devstral-medium",name:"Mistral: Devstral Medium",created:1752161321,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text"]},{id:"mistralai/devstral-small",name:"Mistral: Devstral Small 1.1",created:1752160751,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.3,modalities:["text"]},{id:"cognitivecomputations/dolphin-mistral-24b-venice-edition:free",name:"Venice: Uncensored (free)",created:1752094966,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"x-ai/grok-4",name:"xAI: Grok 4",created:1752087689,contextLength:256e3,maxOutputTokens:0,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["image","text","file"]},{id:"tencent/hunyuan-a13b-instruct",name:"Tencent: Hunyuan A13B Instruct",created:1751987664,contextLength:131072,maxOutputTokens:131072,inputPricePerMillion:.14,outputPricePerMillion:.5700000000000001,modalities:["text"]},{id:"morph/morph-v3-large",name:"Morph: Morph V3 Large",created:1751910858,contextLength:262144,maxOutputTokens:131072,inputPricePerMillion:.8999999999999999,outputPricePerMillion:1.9,modalities:["text"]},{id:"morph/morph-v3-fast",name:"Morph: Morph V3 Fast",created:1751910002,contextLength:81920,maxOutputTokens:38e3,inputPricePerMillion:.7999999999999999,outputPricePerMillion:1.2,modalities:["text"]},{id:"baidu/ernie-4.5-vl-424b-a47b",name:"Baidu: ERNIE 4.5 VL 424B A47B ",created:1751300903,contextLength:123e3,maxOutputTokens:16e3,inputPricePerMillion:.42,outputPricePerMillion:1.25,modalities:["image","text"]},{id:"baidu/ernie-4.5-300b-a47b",name:"Baidu: ERNIE 4.5 300B A47B ",created:1751300139,contextLength:123e3,maxOutputTokens:12e3,inputPricePerMillion:.28,outputPricePerMillion:1.1,modalities:["text"]},{id:"mistralai/mistral-small-3.2-24b-instruct",name:"Mistral: Mistral Small 3.2 24B",created:1750443016,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:.075,outputPricePerMillion:.19999999999999998,modalities:["image","text"]},{id:"minimax/minimax-m1",name:"MiniMax: MiniMax M1",created:1750200414,contextLength:1e6,maxOutputTokens:4e4,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2.2,modalities:["text"]},{id:"google/gemini-2.5-flash",name:"Google: Gemini 2.5 Flash",created:1750172488,contextLength:1048576,maxOutputTokens:65535,inputPricePerMillion:.3,outputPricePerMillion:2.5,modalities:["file","image","text","audio","video"]},{id:"google/gemini-2.5-pro",name:"Google: Gemini 2.5 Pro",created:1750169544,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image","file","audio","video"]},{id:"openai/o3-pro",name:"OpenAI: o3 Pro",created:1749598352,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:20,outputPricePerMillion:80,modalities:["text","file","image"]},{id:"x-ai/grok-3-mini",name:"xAI: Grok 3 Mini",created:1749583245,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.3,outputPricePerMillion:.5,modalities:["text"]},{id:"x-ai/grok-3",name:"xAI: Grok 3",created:1749582908,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text"]},{id:"google/gemini-2.5-pro-preview",name:"Google: Gemini 2.5 Pro Preview 06-05",created:1749137257,contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["file","image","text","audio"]},{id:"deepseek/deepseek-r1-0528",name:"DeepSeek: R1 0528",created:1748455170,contextLength:163840,maxOutputTokens:32768,inputPricePerMillion:.5,outputPricePerMillion:2.1500000000000004,modalities:["text"]},{id:"anthropic/claude-opus-4",name:"Anthropic: Claude Opus 4",created:1747931245,contextLength:2e5,maxOutputTokens:32e3,inputPricePerMillion:15,outputPricePerMillion:75,modalities:["image","text","file"]},{id:"anthropic/claude-sonnet-4",name:"Anthropic: Claude Sonnet 4",created:1747930371,contextLength:1e6,maxOutputTokens:64e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["image","text","file"]},{id:"google/gemma-3n-e4b-it",name:"Google: Gemma 3n 4B",created:1747776824,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.06,outputPricePerMillion:.12,modalities:["text"]},{id:"mistralai/mistral-medium-3",name:"Mistral: Mistral Medium 3",created:1746627341,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.39999999999999997,outputPricePerMillion:2,modalities:["text","image"]},{id:"google/gemini-2.5-pro-preview-05-06",name:"Google: Gemini 2.5 Pro Preview 05-06",created:1746578513,contextLength:1048576,maxOutputTokens:65535,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image","file","audio","video"]},{id:"arcee-ai/spotlight",name:"Arcee AI: Spotlight",created:1746481552,contextLength:131072,maxOutputTokens:65537,inputPricePerMillion:.18,outputPricePerMillion:.18,modalities:["image","text"]},{id:"arcee-ai/maestro-reasoning",name:"Arcee AI: Maestro Reasoning",created:1746481269,contextLength:131072,maxOutputTokens:32e3,inputPricePerMillion:.8999999999999999,outputPricePerMillion:3.3000000000000003,modalities:["text"]},{id:"arcee-ai/virtuoso-large",name:"Arcee AI: Virtuoso Large",created:1746478885,contextLength:131072,maxOutputTokens:64e3,inputPricePerMillion:.75,outputPricePerMillion:1.2,modalities:["text"]},{id:"arcee-ai/coder-large",name:"Arcee AI: Coder Large",created:1746478663,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.5,outputPricePerMillion:.7999999999999999,modalities:["text"]},{id:"meta-llama/llama-guard-4-12b",name:"Meta: Llama Guard 4 12B",created:1745975193,contextLength:163840,maxOutputTokens:16384,inputPricePerMillion:.18,outputPricePerMillion:.18,modalities:["image","text"]},{id:"qwen/qwen3-30b-a3b",name:"Qwen: Qwen3 30B A3B",created:1745878604,contextLength:40960,maxOutputTokens:2e4,inputPricePerMillion:.09,outputPricePerMillion:.44999999999999996,modalities:["text"]},{id:"qwen/qwen3-8b",name:"Qwen: Qwen3 8B",created:1745876632,contextLength:40960,maxOutputTokens:8192,inputPricePerMillion:.049999999999999996,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"qwen/qwen3-14b",name:"Qwen: Qwen3 14B",created:1745876478,contextLength:40960,maxOutputTokens:40960,inputPricePerMillion:.06,outputPricePerMillion:.24,modalities:["text"]},{id:"qwen/qwen3-32b",name:"Qwen: Qwen3 32B",created:1745875945,contextLength:40960,maxOutputTokens:16384,inputPricePerMillion:.08,outputPricePerMillion:.28,modalities:["text"]},{id:"qwen/qwen3-235b-a22b",name:"Qwen: Qwen3 235B A22B",created:1745875757,contextLength:131072,maxOutputTokens:8192,inputPricePerMillion:.45499999999999996,outputPricePerMillion:1.8199999999999998,modalities:["text"]},{id:"openai/o4-mini-high",name:"OpenAI: o4 Mini High",created:1744824212,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:1.1,outputPricePerMillion:4.4,modalities:["image","text","file"]},{id:"openai/o3",name:"OpenAI: o3",created:1744823457,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["image","text","file"]},{id:"openai/o4-mini",name:"OpenAI: o4 Mini",created:1744820942,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:1.1,outputPricePerMillion:4.4,modalities:["image","text","file"]},{id:"openai/gpt-4.1",name:"OpenAI: GPT-4.1",created:1744651385,contextLength:1047576,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["image","text","file"]},{id:"openai/gpt-4.1-mini",name:"OpenAI: GPT-4.1 Mini",created:1744651381,contextLength:1047576,maxOutputTokens:32768,inputPricePerMillion:.39999999999999997,outputPricePerMillion:1.5999999999999999,modalities:["image","text","file"]},{id:"openai/gpt-4.1-nano",name:"OpenAI: GPT-4.1 Nano",created:1744651369,contextLength:1047576,maxOutputTokens:32768,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["image","text","file"]},{id:"alfredpros/codellama-7b-instruct-solidity",name:"AlfredPros: CodeLLaMa 7B Instruct Solidity",created:1744641874,contextLength:4096,maxOutputTokens:4096,inputPricePerMillion:.7999999999999999,outputPricePerMillion:1.2,modalities:["text"]},{id:"x-ai/grok-3-mini-beta",name:"xAI: Grok 3 Mini Beta",created:1744240195,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.3,outputPricePerMillion:.5,modalities:["text"]},{id:"x-ai/grok-3-beta",name:"xAI: Grok 3 Beta",created:1744240068,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text"]},{id:"meta-llama/llama-4-maverick",name:"Meta: Llama 4 Maverick",created:1743881822,contextLength:1048576,maxOutputTokens:16384,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text","image"]},{id:"meta-llama/llama-4-scout",name:"Meta: Llama 4 Scout",created:1743881519,contextLength:327680,maxOutputTokens:16384,inputPricePerMillion:.08,outputPricePerMillion:.3,modalities:["text","image"]},{id:"deepseek/deepseek-chat-v3-0324",name:"DeepSeek: DeepSeek V3 0324",created:1742824755,contextLength:163840,maxOutputTokens:16384,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.77,modalities:["text"]},{id:"openai/o1-pro",name:"OpenAI: o1-pro",created:1742423211,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:150,outputPricePerMillion:600,modalities:["text","image","file"]},{id:"mistralai/mistral-small-3.1-24b-instruct",name:"Mistral: Mistral Small 3.1 24B",created:1742238937,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:.35,outputPricePerMillion:.56,modalities:["text","image"]},{id:"google/gemma-3-4b-it",name:"Google: Gemma 3 4B",created:1741905510,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.04,outputPricePerMillion:.08,modalities:["text","image"]},{id:"google/gemma-3-12b-it",name:"Google: Gemma 3 12B",created:1741902625,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.04,outputPricePerMillion:.13,modalities:["text","image"]},{id:"cohere/command-a",name:"Cohere: Command A",created:1741894342,contextLength:256e3,maxOutputTokens:8192,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text"]},{id:"openai/gpt-4o-mini-search-preview",name:"OpenAI: GPT-4o-mini Search Preview",created:1741818122,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text"]},{id:"openai/gpt-4o-search-preview",name:"OpenAI: GPT-4o Search Preview",created:1741817949,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text"]},{id:"rekaai/reka-flash-3",name:"Reka Flash 3",created:1741812813,contextLength:65536,maxOutputTokens:65536,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.19999999999999998,modalities:["text"]},{id:"google/gemma-3-27b-it",name:"Google: Gemma 3 27B",created:1741756359,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.08,outputPricePerMillion:.16,modalities:["text","image"]},{id:"thedrummer/skyfall-36b-v2",name:"TheDrummer: Skyfall 36B V2",created:1741636566,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.55,outputPricePerMillion:.7999999999999999,modalities:["text"]},{id:"perplexity/sonar-reasoning-pro",name:"Perplexity: Sonar Reasoning Pro",created:1741313308,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["text","image"]},{id:"perplexity/sonar-pro",name:"Perplexity: Sonar Pro",created:1741312423,contextLength:2e5,maxOutputTokens:8e3,inputPricePerMillion:3,outputPricePerMillion:15,modalities:["text","image"]},{id:"perplexity/sonar-deep-research",name:"Perplexity: Sonar Deep Research",created:1741311246,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["text"]},{id:"google/gemini-2.0-flash-lite-001",name:"Google: Gemini 2.0 Flash Lite",created:1740506212,contextLength:1048576,maxOutputTokens:8192,inputPricePerMillion:.075,outputPricePerMillion:.3,modalities:["text","image","file","audio","video"]},{id:"mistralai/mistral-saba",name:"Mistral: Saba",created:1739803239,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.19999999999999998,outputPricePerMillion:.6,modalities:["text"]},{id:"meta-llama/llama-guard-3-8b",name:"Llama Guard 3 8B",created:1739401318,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.48,outputPricePerMillion:.03,modalities:["text"]},{id:"openai/o3-mini-high",name:"OpenAI: o3 Mini High",created:1739372611,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:1.1,outputPricePerMillion:4.4,modalities:["text","file"]},{id:"google/gemini-2.0-flash-001",name:"Google: Gemini 2.0 Flash",created:1738769413,contextLength:1048576,maxOutputTokens:8192,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.39999999999999997,modalities:["text","image","file","audio","video"]},{id:"aion-labs/aion-1.0",name:"AionLabs: Aion-1.0",created:1738697557,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:4,outputPricePerMillion:8,modalities:["text"]},{id:"aion-labs/aion-1.0-mini",name:"AionLabs: Aion-1.0-Mini",created:1738697107,contextLength:131072,maxOutputTokens:32768,inputPricePerMillion:.7,outputPricePerMillion:1.4,modalities:["text"]},{id:"aion-labs/aion-rp-llama-3.1-8b",name:"AionLabs: Aion-RP 1.0 (8B)",created:1738696718,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.7999999999999999,outputPricePerMillion:1.5999999999999999,modalities:["text"]},{id:"qwen/qwen2.5-vl-72b-instruct",name:"Qwen: Qwen2.5 VL 72B Instruct",created:1738410311,contextLength:32e3,maxOutputTokens:0,inputPricePerMillion:.25,outputPricePerMillion:.75,modalities:["text","image"]},{id:"qwen/qwen-plus",name:"Qwen: Qwen-Plus",created:1738409840,contextLength:1e6,maxOutputTokens:32768,inputPricePerMillion:.26,outputPricePerMillion:.78,modalities:["text"]},{id:"openai/o3-mini",name:"OpenAI: o3 Mini",created:1738351721,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:1.1,outputPricePerMillion:4.4,modalities:["text","file"]},{id:"mistralai/mistral-small-24b-instruct-2501",name:"Mistral: Mistral Small 3",created:1738255409,contextLength:32768,maxOutputTokens:16384,inputPricePerMillion:.049999999999999996,outputPricePerMillion:.08,modalities:["text"]},{id:"deepseek/deepseek-r1-distill-qwen-32b",name:"DeepSeek: R1 Distill Qwen 32B",created:1738194830,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.29,outputPricePerMillion:.29,modalities:["text"]},{id:"perplexity/sonar",name:"Perplexity: Sonar",created:1738013808,contextLength:127072,maxOutputTokens:0,inputPricePerMillion:1,outputPricePerMillion:1,modalities:["text","image"]},{id:"deepseek/deepseek-r1-distill-llama-70b",name:"DeepSeek: R1 Distill Llama 70B",created:1737663169,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.7,outputPricePerMillion:.7999999999999999,modalities:["text"]},{id:"deepseek/deepseek-r1",name:"DeepSeek: R1",created:1737381095,contextLength:64e3,maxOutputTokens:16e3,inputPricePerMillion:.7,outputPricePerMillion:2.5,modalities:["text"]},{id:"minimax/minimax-01",name:"MiniMax: MiniMax-01",created:1736915462,contextLength:1000192,maxOutputTokens:1000192,inputPricePerMillion:.19999999999999998,outputPricePerMillion:1.1,modalities:["text","image"]},{id:"microsoft/phi-4",name:"Microsoft: Phi 4",created:1736489872,contextLength:16384,maxOutputTokens:16384,inputPricePerMillion:.065,outputPricePerMillion:.14,modalities:["text"]},{id:"sao10k/l3.1-70b-hanami-x1",name:"Sao10K: Llama 3.1 70B Hanami x1",created:1736302854,contextLength:16e3,maxOutputTokens:0,inputPricePerMillion:3,outputPricePerMillion:3,modalities:["text"]},{id:"deepseek/deepseek-chat",name:"DeepSeek: DeepSeek V3",created:1735241320,contextLength:163840,maxOutputTokens:16384,inputPricePerMillion:.32,outputPricePerMillion:.8899999999999999,modalities:["text"]},{id:"sao10k/l3.3-euryale-70b",name:"Sao10K: Llama 3.3 Euryale 70B",created:1734535928,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.65,outputPricePerMillion:.75,modalities:["text"]},{id:"openai/o1",name:"OpenAI: o1",created:1734459999,contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:15,outputPricePerMillion:60,modalities:["text","image","file"]},{id:"cohere/command-r7b-12-2024",name:"Cohere: Command R7B (12-2024)",created:1734158152,contextLength:128e3,maxOutputTokens:4e3,inputPricePerMillion:.0375,outputPricePerMillion:.15,modalities:["text"]},{id:"meta-llama/llama-3.3-70b-instruct:free",name:"Meta: Llama 3.3 70B Instruct (free)",created:1733506137,contextLength:65536,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"meta-llama/llama-3.3-70b-instruct",name:"Meta: Llama 3.3 70B Instruct",created:1733506137,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.32,modalities:["text"]},{id:"amazon/nova-lite-v1",name:"Amazon: Nova Lite 1.0",created:1733437363,contextLength:3e5,maxOutputTokens:5120,inputPricePerMillion:.06,outputPricePerMillion:.24,modalities:["text","image"]},{id:"amazon/nova-micro-v1",name:"Amazon: Nova Micro 1.0",created:1733437237,contextLength:128e3,maxOutputTokens:5120,inputPricePerMillion:.035,outputPricePerMillion:.14,modalities:["text"]},{id:"amazon/nova-pro-v1",name:"Amazon: Nova Pro 1.0",created:1733436303,contextLength:3e5,maxOutputTokens:5120,inputPricePerMillion:.7999999999999999,outputPricePerMillion:3.1999999999999997,modalities:["text","image"]},{id:"openai/gpt-4o-2024-11-20",name:"OpenAI: GPT-4o (2024-11-20)",created:1732127594,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text","image","file"]},{id:"mistralai/mistral-large-2411",name:"Mistral Large 2411",created:1731978685,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text"]},{id:"mistralai/mistral-large-2407",name:"Mistral Large 2407",created:1731978415,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text"]},{id:"mistralai/pixtral-large-2411",name:"Mistral: Pixtral Large 2411",created:1731977388,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text","image"]},{id:"qwen/qwen-2.5-coder-32b-instruct",name:"Qwen2.5 Coder 32B Instruct",created:1731368400,contextLength:32768,maxOutputTokens:0,inputPricePerMillion:.66,outputPricePerMillion:1,modalities:["text"]},{id:"thedrummer/unslopnemo-12b",name:"TheDrummer: UnslopNemo 12B",created:1731103448,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.39999999999999997,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"anthropic/claude-3.5-haiku",name:"Anthropic: Claude 3.5 Haiku",created:1730678400,contextLength:2e5,maxOutputTokens:8192,inputPricePerMillion:.7999999999999999,outputPricePerMillion:4,modalities:["text","image"]},{id:"anthracite-org/magnum-v4-72b",name:"Magnum v4 72B",created:1729555200,contextLength:16384,maxOutputTokens:2048,inputPricePerMillion:3,outputPricePerMillion:5,modalities:["text"]},{id:"qwen/qwen-2.5-7b-instruct",name:"Qwen: Qwen2.5 7B Instruct",created:1729036800,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.04,outputPricePerMillion:.09999999999999999,modalities:["text"]},{id:"inflection/inflection-3-pi",name:"Inflection: Inflection 3 Pi",created:1728604800,contextLength:8e3,maxOutputTokens:1024,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text"]},{id:"inflection/inflection-3-productivity",name:"Inflection: Inflection 3 Productivity",created:1728604800,contextLength:8e3,maxOutputTokens:1024,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text"]},{id:"thedrummer/rocinante-12b",name:"TheDrummer: Rocinante 12B",created:1727654400,contextLength:32768,maxOutputTokens:32768,inputPricePerMillion:.16999999999999998,outputPricePerMillion:.43,modalities:["text"]},{id:"meta-llama/llama-3.2-1b-instruct",name:"Meta: Llama 3.2 1B Instruct",created:1727222400,contextLength:6e4,maxOutputTokens:0,inputPricePerMillion:.027,outputPricePerMillion:.19999999999999998,modalities:["text"]},{id:"meta-llama/llama-3.2-3b-instruct:free",name:"Meta: Llama 3.2 3B Instruct (free)",created:1727222400,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"meta-llama/llama-3.2-3b-instruct",name:"Meta: Llama 3.2 3B Instruct",created:1727222400,contextLength:8e4,maxOutputTokens:0,inputPricePerMillion:.051,outputPricePerMillion:.33999999999999997,modalities:["text"]},{id:"meta-llama/llama-3.2-11b-vision-instruct",name:"Meta: Llama 3.2 11B Vision Instruct",created:1727222400,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.245,outputPricePerMillion:.245,modalities:["text","image"]},{id:"qwen/qwen-2.5-72b-instruct",name:"Qwen2.5 72B Instruct",created:1726704e3,contextLength:32768,maxOutputTokens:16384,inputPricePerMillion:.36,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"cohere/command-r-plus-08-2024",name:"Cohere: Command R+ (08-2024)",created:1724976e3,contextLength:128e3,maxOutputTokens:4e3,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text"]},{id:"cohere/command-r-08-2024",name:"Cohere: Command R (08-2024)",created:1724976e3,contextLength:128e3,maxOutputTokens:4e3,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text"]},{id:"sao10k/l3.1-euryale-70b",name:"Sao10K: Llama 3.1 Euryale 70B v2.2",created:1724803200,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.85,outputPricePerMillion:.85,modalities:["text"]},{id:"nousresearch/hermes-3-llama-3.1-70b",name:"Nous: Hermes 3 70B Instruct",created:1723939200,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.3,outputPricePerMillion:.3,modalities:["text"]},{id:"nousresearch/hermes-3-llama-3.1-405b:free",name:"Nous: Hermes 3 405B Instruct (free)",created:1723766400,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]},{id:"nousresearch/hermes-3-llama-3.1-405b",name:"Nous: Hermes 3 405B Instruct",created:1723766400,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:1,outputPricePerMillion:1,modalities:["text"]},{id:"sao10k/l3-lunaris-8b",name:"Sao10K: Llama 3 8B Lunaris",created:1723507200,contextLength:8192,maxOutputTokens:16384,inputPricePerMillion:.04,outputPricePerMillion:.049999999999999996,modalities:["text"]},{id:"openai/gpt-4o-2024-08-06",name:"OpenAI: GPT-4o (2024-08-06)",created:1722902400,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text","image","file"]},{id:"meta-llama/llama-3.1-8b-instruct",name:"Meta: Llama 3.1 8B Instruct",created:1721692800,contextLength:16384,maxOutputTokens:16384,inputPricePerMillion:.02,outputPricePerMillion:.049999999999999996,modalities:["text"]},{id:"meta-llama/llama-3.1-70b-instruct",name:"Meta: Llama 3.1 70B Instruct",created:1721692800,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.39999999999999997,outputPricePerMillion:.39999999999999997,modalities:["text"]},{id:"mistralai/mistral-nemo",name:"Mistral: Mistral Nemo",created:1721347200,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.02,outputPricePerMillion:.03,modalities:["text"]},{id:"openai/gpt-4o-mini",name:"OpenAI: GPT-4o-mini",created:1721260800,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text","image","file"]},{id:"openai/gpt-4o-mini-2024-07-18",name:"OpenAI: GPT-4o-mini (2024-07-18)",created:1721260800,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:.15,outputPricePerMillion:.6,modalities:["text","image","file"]},{id:"google/gemma-2-27b-it",name:"Google: Gemma 2 27B",created:1720828800,contextLength:8192,maxOutputTokens:2048,inputPricePerMillion:.65,outputPricePerMillion:.65,modalities:["text"]},{id:"sao10k/l3-euryale-70b",name:"Sao10k: Llama 3 Euryale 70B v2.1",created:1718668800,contextLength:8192,maxOutputTokens:8192,inputPricePerMillion:1.48,outputPricePerMillion:1.48,modalities:["text"]},{id:"nousresearch/hermes-2-pro-llama-3-8b",name:"NousResearch: Hermes 2 Pro - Llama-3 8B",created:1716768e3,contextLength:8192,maxOutputTokens:8192,inputPricePerMillion:.14,outputPricePerMillion:.14,modalities:["text"]},{id:"openai/gpt-4o",name:"OpenAI: GPT-4o",created:1715558400,contextLength:128e3,maxOutputTokens:16384,inputPricePerMillion:2.5,outputPricePerMillion:10,modalities:["text","image","file"]},{id:"openai/gpt-4o-2024-05-13",name:"OpenAI: GPT-4o (2024-05-13)",created:1715558400,contextLength:128e3,maxOutputTokens:4096,inputPricePerMillion:5,outputPricePerMillion:15,modalities:["text","image","file"]},{id:"meta-llama/llama-3-8b-instruct",name:"Meta: Llama 3 8B Instruct",created:1713398400,contextLength:8192,maxOutputTokens:8192,inputPricePerMillion:.04,outputPricePerMillion:.04,modalities:["text"]},{id:"meta-llama/llama-3-70b-instruct",name:"Meta: Llama 3 70B Instruct",created:1713398400,contextLength:8192,maxOutputTokens:8e3,inputPricePerMillion:.51,outputPricePerMillion:.74,modalities:["text"]},{id:"mistralai/mixtral-8x22b-instruct",name:"Mistral: Mixtral 8x22B Instruct",created:1713312e3,contextLength:65536,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text"]},{id:"microsoft/wizardlm-2-8x22b",name:"WizardLM-2 8x22B",created:1713225600,contextLength:65535,maxOutputTokens:8e3,inputPricePerMillion:.62,outputPricePerMillion:.62,modalities:["text"]},{id:"openai/gpt-4-turbo",name:"OpenAI: GPT-4 Turbo",created:1712620800,contextLength:128e3,maxOutputTokens:4096,inputPricePerMillion:10,outputPricePerMillion:30,modalities:["text","image"]},{id:"anthropic/claude-3-haiku",name:"Anthropic: Claude 3 Haiku",created:1710288e3,contextLength:2e5,maxOutputTokens:4096,inputPricePerMillion:.25,outputPricePerMillion:1.25,modalities:["text","image"]},{id:"mistralai/mistral-large",name:"Mistral Large",created:1708905600,contextLength:128e3,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text"]},{id:"openai/gpt-3.5-turbo-0613",name:"OpenAI: GPT-3.5 Turbo (older v0613)",created:1706140800,contextLength:4095,maxOutputTokens:4096,inputPricePerMillion:1,outputPricePerMillion:2,modalities:["text"]},{id:"openai/gpt-4-turbo-preview",name:"OpenAI: GPT-4 Turbo Preview",created:1706140800,contextLength:128e3,maxOutputTokens:4096,inputPricePerMillion:10,outputPricePerMillion:30,modalities:["text"]},{id:"openrouter/auto",name:"Auto Router",created:1699401600,contextLength:2e6,maxOutputTokens:0,inputPricePerMillion:-1e6,outputPricePerMillion:-1e6,modalities:["text","image","audio","file","video"]},{id:"openai/gpt-4-1106-preview",name:"OpenAI: GPT-4 Turbo (older v1106)",created:1699228800,contextLength:128e3,maxOutputTokens:4096,inputPricePerMillion:10,outputPricePerMillion:30,modalities:["text"]},{id:"mistralai/mistral-7b-instruct-v0.1",name:"Mistral: Mistral 7B Instruct v0.1",created:1695859200,contextLength:2824,maxOutputTokens:0,inputPricePerMillion:.11,outputPricePerMillion:.19,modalities:["text"]},{id:"openai/gpt-3.5-turbo-instruct",name:"OpenAI: GPT-3.5 Turbo Instruct",created:1695859200,contextLength:4095,maxOutputTokens:4096,inputPricePerMillion:1.5,outputPricePerMillion:2,modalities:["text"]},{id:"openai/gpt-3.5-turbo-16k",name:"OpenAI: GPT-3.5 Turbo 16k",created:1693180800,contextLength:16385,maxOutputTokens:4096,inputPricePerMillion:3,outputPricePerMillion:4,modalities:["text"]},{id:"mancer/weaver",name:"Mancer: Weaver (alpha)",created:1690934400,contextLength:8e3,maxOutputTokens:2e3,inputPricePerMillion:.75,outputPricePerMillion:1,modalities:["text"]},{id:"undi95/remm-slerp-l2-13b",name:"ReMM SLERP 13B",created:1689984e3,contextLength:6144,maxOutputTokens:4096,inputPricePerMillion:.44999999999999996,outputPricePerMillion:.65,modalities:["text"]},{id:"gryphe/mythomax-l2-13b",name:"MythoMax 13B",created:1688256e3,contextLength:4096,maxOutputTokens:4096,inputPricePerMillion:.06,outputPricePerMillion:.06,modalities:["text"]},{id:"openai/gpt-4",name:"OpenAI: GPT-4",created:1685232e3,contextLength:8191,maxOutputTokens:4096,inputPricePerMillion:30,outputPricePerMillion:60,modalities:["text"]},{id:"openai/gpt-4-0314",name:"OpenAI: GPT-4 (older v0314)",created:1685232e3,contextLength:8191,maxOutputTokens:4096,inputPricePerMillion:30,outputPricePerMillion:60,modalities:["text"]},{id:"openai/gpt-3.5-turbo",name:"OpenAI: GPT-3.5 Turbo",created:1685232e3,contextLength:16385,maxOutputTokens:4096,inputPricePerMillion:.5,outputPricePerMillion:1.5,modalities:["text"]}]};var c=a,r=null;function i(){return r??c}a$1(i,"loadSnapshot");function s(t){r=t;}a$1(s,"setOpenRouterSnapshot");function x(){return i()}a$1(x,"getOpenRouterSnapshot");function M(){return i().models}a$1(M,"getOpenRouterModels");function g(t){return i().models.find(n=>n.id===t)}a$1(g,"findOpenRouterModel");function h(t){let n=`${t.toLowerCase()}/`;return i().models.filter(l=>l.id.toLowerCase().startsWith(n))}a$1(h,"listOpenRouterModelsByVendor");
2
+ export{s as a,x as b,M as c,g as d,h as e};
@@ -0,0 +1 @@
1
+ import {h,a}from'./chunk-3QP5BQ3L.js';h();var r=null;async function c(){return r||(r=import('gpt-tokenizer').then(n=>n.encode)),r}a(c,"getEncoder");var o=null;c().then(n=>{o=n;});function u(n){return n?o?o(n).length:Math.ceil(n.length/4):0}a(u,"countTokens");export{u as a};
@@ -0,0 +1 @@
1
+ import {h as h$1,a}from'./chunk-3QP5BQ3L.js';import {existsSync,readFileSync,mkdirSync,writeFileSync}from'fs';import {homedir}from'os';import {join}from'path';h$1();var h=168*3600*1e3;function S(e,r){let t=join(e,`${r}.json`);if(existsSync(t))try{let i=readFileSync(t,"utf-8"),o=JSON.parse(i);return !o||!Array.isArray(o.models)?void 0:o}catch{return}}a(S,"readCache");function x(e,r,t){existsSync(e)||mkdirSync(e,{recursive:true});let i={fetchedAt:new Date().toISOString(),providerKey:r,models:t};return writeFileSync(join(e,`${r}.json`),JSON.stringify(i,null,2),"utf-8"),i}a(x,"writeCache");function y(e,r=Date.now()){let t=Date.parse(e.fetchedAt);return Number.isFinite(t)?r-t>h:true}a(y,"isStale");function F(){return join(homedir(),".code-shell","cache","models")}a(F,"defaultCacheDir");export{S as a,x as b,y as c,F as d};
@@ -0,0 +1,3 @@
1
+ import {a as a$2}from'./chunk-O5HFCH2U.js';import {a}from'./chunk-HIJ2XXGX.js';import {b as b$1,c,d}from'./chunk-FU7AHZNN.js';import {b}from'./chunk-B7K2OWKC.js';import {h,a as a$1}from'./chunk-3QP5BQ3L.js';import O from'openai';h();var R=class extends a{static{a$1(this,"OpenAIClient");}_client=null;constructor(e){super(e);}initClient(){}get client(){return this._client||(this._client=new O({apiKey:this.config.apiKey??process.env.OPENAI_API_KEY,...this.config.baseUrl?{baseURL:this.config.baseUrl}:{},timeout:this.timeout})),this._client}async createMessage(e){return this.withRetry(async()=>{let n=this.buildMessages(e.systemPrompt,e.messages),r=e.tools?.length?this.convertTools(e.tools):void 0,o=b.span("llm.request",{cat:"llm",provider:this.provider,model:this.model,stream:!!(e.stream&&e.onChunk),messageCount:n.length,toolCount:r?.length??0});try{let t=e.stream&&e.onChunk?await this.streamMessage(e,n,r):await this.nonStreamMessage(e,n,r);return o.end({stopReason:t.stopReason,promptTokens:t.usage?.promptTokens,completionTokens:t.usage?.completionTokens,cacheReadTokens:t.usage?.cacheReadTokens,cacheCreationTokens:t.usage?.cacheCreationTokens}),t}catch(t){throw o.fail(t),t}})}async nonStreamMessage(e,n,r){try{let o=await this.client.chat.completions.create({model:this.model,max_tokens:e.maxTokens??this.maxTokens,messages:n,...r?{tools:r}:{},...e.temperature!==void 0?{temperature:e.temperature}:{temperature:this.temperature}},{signal:e.signal}),t=o.choices[0];if(!t)throw new b$1("No response from OpenAI","openai");let s={promptTokens:o.usage?.prompt_tokens??0,completionTokens:o.usage?.completion_tokens??0,totalTokens:o.usage?.total_tokens??0};return this.recordUsage(s,e),this.processChoice(t,s)}catch(o){throw this.handleApiError(o),o}}async streamMessage(e,n,r){try{let o=await this.client.chat.completions.create({model:this.model,max_tokens:e.maxTokens??this.maxTokens,messages:n,stream:!0,stream_options:{include_usage:!0},...r?{tools:r}:{},...e.temperature!==void 0?{temperature:e.temperature}:{temperature:this.temperature}},{signal:e.signal}),t="",s="",i=new Map,a,d=Date.now(),l=!1;for await(let m of o){m.usage&&(a=m.usage);let c=m.choices[0]?.delta;if(!c)continue;let k=c.reasoning_content;if(typeof k=="string"&&k.length>0&&(s+=k),c.content&&(l||(l=!0,b.debug("llm.first_byte",{cat:"llm",provider:this.provider,model:this.model,ttft_ms:Date.now()-d})),t+=c.content,e.onChunk?.({type:"text",text:c.content,tokens:a$2(c.content)})),c.tool_calls)for(let p of c.tool_calls){let C=p.index;i.has(C)||(i.set(C,{id:p.id??"",name:p.function?.name??"",args:""}),e.onChunk?.({type:"tool_use_start",toolCall:{id:p.id,toolName:p.function?.name}}));let u=i.get(C);if(p.id&&(u.id=p.id),p.function?.name&&(u.name=p.function.name),p.function?.arguments&&(u.args+=p.function.arguments,u.id))try{let v=JSON.parse(u.args||"{}");e.onChunk?.({type:"tool_use_delta",toolCall:{id:u.id,toolName:u.name,args:v}});}catch{}}m.choices[0]?.finish_reason&&e.onChunk?.({type:"stop",stopReason:m.choices[0].finish_reason});}let y=[];for(let[,m]of i){let c={};try{c=JSON.parse(m.args||"{}");}catch{}y.push({id:m.id,toolName:m.name,args:c});}let T={promptTokens:a?.prompt_tokens??0,completionTokens:a?.completion_tokens??0,totalTokens:a?.total_tokens??0};return this.recordUsage(T,e),{text:t,toolCalls:y,usage:T,stopReason:"stop",...s?{reasoningContent:s}:{}}}catch(o){throw this.handleApiError(o),o}}processChoice(e,n){let r=e.message.content??"",o=[];if(e.message.tool_calls)for(let s of e.message.tool_calls){let i={};try{i=JSON.parse(s.function.arguments||"{}");}catch{}o.push({id:s.id,toolName:s.function.name,args:i});}let t=I(e.message);return {text:r,toolCalls:o,usage:n,stopReason:e.finish_reason??void 0,...t?{reasoningContent:t}:{}}}buildMessages(e,n){let r=[{role:"system",content:e}],o=P(this.model);for(let t of n)if(t.role!=="system")if(t.role==="assistant"){let s={role:"assistant"},i;if(typeof t.content=="string")s.content=t.content;else {let a=[],d=[];for(let l of t.content)l.type==="text"&&l.text?a.push(l.text):l.type==="tool_use"&&l.id&&l.name?d.push({id:l.id,type:"function",function:{name:l.name,arguments:JSON.stringify(l.input??{})}}):l.type==="reasoning"&&l.reasoningContent&&(i=l.reasoningContent),!i&&l.reasoningContent&&(i=l.reasoningContent);a.length&&(s.content=a.join(`
2
+ `)),d.length&&(s.tool_calls=d);}!i&&o&&(i=""),i!==void 0&&(s.reasoning_content=i),r.push(s);}else if(t.role==="tool")r.push({role:"tool",tool_call_id:t.tool_call_id??"",content:typeof t.content=="string"?t.content:""});else if(typeof t.content=="string")r.push({role:"user",content:t.content});else {let s=[],i=[];for(let a of t.content)a.type==="tool_result"&&a.tool_use_id?i.push({tool_use_id:a.tool_use_id,content:typeof a.content=="string"?a.content:""}):a.type==="text"&&a.text&&s.push(a.text);for(let a of i)r.push({role:"tool",tool_call_id:a.tool_use_id,content:a.content});s.length>0&&r.push({role:"user",content:s.join(`
3
+ `)});}return r}convertTools(e){return e.map(n=>({type:"function",function:{name:n.name,description:n.description,parameters:n.inputSchema}}))}handleApiError(e){if(e instanceof O.APIError){if(e.status===429)throw new c("openai");let n=(e.message??"").toLowerCase();throw n.includes("context_length_exceeded")||n.includes("maximum context length")||n.includes("too many tokens")||n.includes("prompt is too long")?new d("openai"):e.status===401&&n.includes("provider returned error")?new b$1(`OpenAI-compatible endpoint returned 401 "Provider returned error". Two likely causes: (1) the API key is invalid/revoked, or (2) the upstream provider rejects tool calls for this model (common on OpenRouter's gpt-4o-mini route). Verify the key, then try a tool-capable model such as openai/gpt-4.1-mini or anthropic/claude-3.5-haiku.`,"openai",{status:e.status}):new b$1(`OpenAI API error: ${e.message}`,"openai",{status:e.status})}throw e}};function I(g){let e=g.reasoning_content??g.reasoning;return typeof e=="string"&&e.length>0?e:void 0}a$1(I,"extractReasoningContent");function P(g){return /^deepseek-v4(?:-|$)/i.test(g)}a$1(P,"isDeepSeekThinkingModel");export{R as a};
@@ -0,0 +1,251 @@
1
+ import {b as b$1}from'./chunk-Y2NS6HPO.js';import {b}from'./chunk-B7K2OWKC.js';import {h,a}from'./chunk-3QP5BQ3L.js';h();h();h();h();function x(n,e){if(n===e)return 0;if(!n||!e)return 1;let t=a(c=>{let u=new Set;for(let l=0;l<c.length-2;l++)u.add(c.slice(l,l+3));return u},"trigrams"),r=t(n),i=t(e),o=0;for(let c of r)i.has(c)&&o++;let a$1=r.size+i.size-o;return a$1===0?0:1-o/a$1}a(x,"diffRatio");function C(n){let{round:e,critiques:t,draft:r,previousDraft:i}=n,o=t.filter(u=>u.severity==="blocker").length,a=t.filter(u=>u.severity==="major").length,s=t.length,c=i?x(i.content,r.content):1;return e===1?{blockerCount:o,majorCount:a,totalCritiques:s,diffFromPrevious:c,shouldStop:false,reason:"running"}:s===0?{blockerCount:o,majorCount:a,totalCritiques:s,diffFromPrevious:c,shouldStop:false,reason:"running"}:o===0&&a===0&&s>=3?{blockerCount:o,majorCount:a,totalCritiques:s,diffFromPrevious:c,shouldStop:true,reason:"all_minor_or_praise"}:o===0&&c<.05?{blockerCount:o,majorCount:a,totalCritiques:s,diffFromPrevious:c,shouldStop:true,reason:"blockers_zero_and_stable"}:{blockerCount:o,majorCount:a,totalCritiques:s,diffFromPrevious:c,shouldStop:false,reason:"running"}}a(C,"defaultConvergence");h();var q=`
2
+ Hard rules:
3
+ - Output the FULL artifact, not a sketch or outline.
4
+ - No "...", "(continued)", "see above", "TBD", or placeholders.
5
+ - Don't pad with filler. Every section must carry information.
6
+ - Length is a floor, not a target \u2014 go beyond it if the topic warrants.
7
+
8
+ Factual discipline (CRITICAL \u2014 fabrication = blocker-level defect):
9
+ - Do NOT invent specific numbers, percentages, dollar amounts, market sizes,
10
+ user-research counts, or "industry averages" you cannot verify.
11
+ - Do NOT invent URLs, report IDs, document numbers, citation references.
12
+ - Do NOT invent named people, companies, or product code-names.
13
+ - For unknowable specifics, write a placeholder with the exact form:
14
+ [\u9700\u8C03\u7814: \u5177\u4F53\u8BF4\u660E] e.g. "[\u9700\u8C03\u7814: \u5B9E\u9645\u884C\u4E1A\u6D41\u5931\u7387\u57FA\u51C6]"
15
+ [TBD: short reason] e.g. "[TBD: confirm Stripe rate limits]"
16
+ These placeholders are EXPECTED. Reviewers will not fault you for them.
17
+ - General qualitative claims are fine ("annual growth typically in the
18
+ double digits"); specific numbers without a verifiable source are NOT.
19
+ - If you have web-search tools available, USE them before stating any
20
+ specific number or citing any source.
21
+ `;function I(n){return n.map((e,t)=>`[${t+1}] id=${e.id} severity=${e.severity} category=${e.category} from=${e.critic}
22
+ anchor: "${e.anchor}"
23
+ comment: ${e.comment}`+(e.suggestion?`
24
+ suggestion: ${e.suggestion}`:"")).join(`
25
+
26
+ `)}a(I,"formatCritiquesForPrompt");var T={format:"code",draftPrompt(n,e){return `You are writing a complete code artifact for the following task.
27
+
28
+ Task: ${n.label}
29
+ Description: ${n.description}
30
+ ${n.sources?.length?`Source files for context: ${n.sources.join(", ")}`:""}
31
+
32
+ This draft will compete with drafts from other participants in a tournament round.
33
+ A merger will then read all drafts (anonymously) and pick the strongest parts.
34
+ Make your draft strong, distinct, complete, and self-contained.
35
+
36
+ Output requirements:
37
+ - Compile-ready code in the appropriate language (infer from sources / description).
38
+ - Include tests if behavior is non-trivial.
39
+ - Inline comments only where the WHY is non-obvious \u2014 names should explain WHAT.
40
+ - At least ${e} characters of substantive code (filler will be cut by the merger).
41
+ ${q}`},mergePrompt(n,e,t){let r=e.map(i=>`--- ${i.anonymousLabel} ---
42
+ ${i.content}
43
+ --- end ${i.anonymousLabel} ---`).join(`
44
+
45
+ `);return `Below are ${e.length} draft solutions for the same task, presented anonymously.
46
+ Your job: produce a single v1 by merging the strongest parts of each.
47
+
48
+ Task: ${n.label}
49
+ Description: ${n.description}
50
+
51
+ ${r}
52
+
53
+ Merging rules:
54
+ - For each section / function / module, pick the strongest version OR write a new one inspired by the best ideas.
55
+ - Inline EVERYTHING. Do not write "see Draft B for the auth helper" \u2014 copy the auth helper in.
56
+ - v1 must be COMPLETE and at least ${t} characters of substantive code.
57
+ - After the code, output a 'mergeRationale' section: one short paragraph per major decision, "From Draft X I took ____, because ____. I rejected ____ because ____."
58
+
59
+ Output format (literally \u2014 these markers will be parsed):
60
+
61
+ <v1_content>
62
+ {full code goes here}
63
+ </v1_content>
64
+
65
+ <merge_rationale>
66
+ {your rationale here}
67
+ </merge_rationale>`},argueSystem(){return `You are reviewing a code artifact. Find every meaningful issue.
68
+
69
+ You may have access to a web_search tool \u2014 USE IT to verify any specific
70
+ claim, library version, API behavior, or external reference made in the
71
+ draft before deciding whether it's a fabrication.
72
+
73
+ For each issue:
74
+ - "anchor": quote 5-15 words verbatim from the draft to locate the issue.
75
+ - "severity": "blocker" (must fix), "major" (should fix), "minor" (nice to fix), "nit" (style), or "praise" (good \u2014 don't gut this).
76
+ - "category": "correctness" | "completeness" | "clarity" | "evidence" | "structure" | "style" | "fabrication" | "other".
77
+ - "comment": what's wrong and what you'd do. If you used web_search, cite the URL.
78
+ - "suggestion": optional concrete fix.
79
+ - "evidence": optional array of {url, snippet} pairs supporting your critique.
80
+
81
+ FABRICATION DETECTION (top priority):
82
+ Any specific number, citation, URL, version string, API endpoint, library
83
+ function, or named entity that you cannot verify is a "fabrication"
84
+ critique with severity = "blocker". Be especially suspicious of:
85
+ - "Industry average is X%" / "Surveys show N=..."
86
+ - Documentation URLs with suspiciously generic paths
87
+ - Library/API names that "sound right" but you can't confirm exist
88
+
89
+ Aim for 8-20 critiques. Include PRAISE for parts that are genuinely good \u2014 this prevents the author from accidentally gutting them in the next revision.
90
+
91
+ Output strictly as JSON: {"critiques": [{...}, ...]}`},argueUser(n,e,t){return `Task: ${n.label}
92
+ ${t?`Review lens: ${t}
93
+ `:""}
94
+ Current draft (v${e.version}, by ${e.author}):
95
+
96
+ ${e.content}
97
+
98
+ Now produce your critiques as JSON.`},revisePrompt(n,e,t,r){return `You wrote v${e.version}. Critics raised ${t.length} points.
99
+ Rewrite the artifact as v${e.version+1}.
100
+
101
+ Task: ${n.label}
102
+ Description: ${n.description}
103
+
104
+ Current draft (v${e.version}):
105
+ ${e.content}
106
+
107
+ Critiques:
108
+ ${I(t)}
109
+
110
+ Rules:
111
+ - ADDRESS every blocker and major. You may disagree, but say why in changelog.
112
+ - Preserve PRAISE-tagged parts unless a later critique contradicts.
113
+ - Output the COMPLETE new artifact (at least ${r} chars), not a diff.
114
+ - After the code, output a JSON block:
115
+
116
+ <v_next_content>
117
+ {full code goes here}
118
+ </v_next_content>
119
+
120
+ <v_next_meta>
121
+ {
122
+ "acceptedCritiques": ["id1", "id2", ...],
123
+ "rejectedCritiques": [{"id": "id3", "reason": "..."}, ...],
124
+ "changelog": "what changed and why, in 1-3 short paragraphs"
125
+ }
126
+ </v_next_meta>`}},D={format:"document",draftPrompt(n,e){return `You are writing a complete long-form document for the following subject.
127
+
128
+ Subject: ${n.label}
129
+ Description: ${n.description}
130
+ ${n.sources?.length?`Reference materials: ${n.sources.join(", ")}`:""}
131
+
132
+ This draft will compete with drafts from other participants in a tournament round.
133
+ A merger will then read all drafts (anonymously) and pick the strongest parts.
134
+ Make your draft strong, distinct, complete, and self-contained.
135
+
136
+ Document requirements:
137
+ - Use clear hierarchical structure (## sections, ### subsections).
138
+ - Every section must carry concrete information: examples, comparisons, trade-offs, numbers.
139
+ - Cite sources inline with [n] footnotes when you make factual claims.
140
+ - At least ${e} characters of substantive prose (filler will be cut by the merger).
141
+ ${q}`},mergePrompt(n,e,t){let r=e.map(i=>`--- ${i.anonymousLabel} ---
142
+ ${i.content}
143
+ --- end ${i.anonymousLabel} ---`).join(`
144
+
145
+ `);return `Below are ${e.length} draft documents for the same subject, presented anonymously.
146
+ Your job: produce a single v1 markdown document by merging the strongest parts.
147
+
148
+ Subject: ${n.label}
149
+ Description: ${n.description}
150
+
151
+ ${r}
152
+
153
+ Merging rules:
154
+ - Pick the strongest section from each draft, OR write a new section that combines their best ideas.
155
+ - DO NOT write "see Draft B for ____" \u2014 inline everything.
156
+ - The final v1 must be COMPLETE and at least ${t} characters.
157
+ - Maintain coherent voice and consistent structure across sections.
158
+
159
+ Output format (literally \u2014 these markers will be parsed):
160
+
161
+ <v1_content>
162
+ {full markdown document}
163
+ </v1_content>
164
+
165
+ <merge_rationale>
166
+ {1-3 short paragraphs: from which draft you took which section, why; what you rejected, why}
167
+ </merge_rationale>`},argueSystem(){return `You are reviewing a long-form document. Find every meaningful issue.
168
+
169
+ You may have access to a web_search tool \u2014 USE IT to verify any specific
170
+ number, citation, market figure, named survey, or external reference
171
+ before deciding whether it's a fabrication.
172
+
173
+ For each issue:
174
+ - "anchor": quote 5-15 words verbatim from the document to locate the issue.
175
+ - "severity": "blocker" | "major" | "minor" | "nit" | "praise".
176
+ - "category": "correctness" | "completeness" | "clarity" | "evidence" | "structure" | "style" | "fabrication" | "other".
177
+ - "comment": what's wrong / missing / weak. If you used web_search, cite the URL.
178
+ - "suggestion": optional concrete fix or content to add.
179
+ - "evidence": optional array of {url, snippet} pairs supporting your critique.
180
+
181
+ FABRICATION DETECTION (top priority):
182
+ The document is far more likely to fail because of fabricated facts than
183
+ because of missing sections. Treat every specific number / report ID /
184
+ URL / dollar figure / "industry average" / named survey as suspect until
185
+ verified. Mark as severity = "blocker" if:
186
+ - The number cannot be found via web_search.
187
+ - The cited URL doesn't resolve to the claimed source.
188
+ - The "report ID" / "document number" appears made up.
189
+ - The named survey / interviewee count cannot be traced.
190
+ A draft full of citations that don't check out is worse than a draft
191
+ that honestly writes "[\u9700\u8C03\u7814: ...]". Reward the latter.
192
+
193
+ Aim for 8-20 critiques. Don't be polite \u2014 depth, missing sections, weak claims, and structural issues matter more than typos. Include PRAISE for genuinely strong parts so the author doesn't gut them on revision.
194
+
195
+ Output strictly as JSON: {"critiques": [{...}, ...]}`},argueUser(n,e,t){return `Subject: ${n.label}
196
+ ${t?`Review lens: ${t}
197
+ `:""}
198
+ Current document (v${e.version}, by ${e.author}):
199
+
200
+ ${e.content}
201
+
202
+ Now produce your critiques as JSON.`},revisePrompt(n,e,t,r){return `You wrote v${e.version}. Critics raised ${t.length} points.
203
+ Rewrite the document as v${e.version+1}.
204
+
205
+ Subject: ${n.label}
206
+ Description: ${n.description}
207
+
208
+ Current document (v${e.version}):
209
+ ${e.content}
210
+
211
+ Critiques:
212
+ ${I(t)}
213
+
214
+ Rules:
215
+ - ADDRESS every blocker and major. You may disagree, but say why in changelog.
216
+ - Preserve PRAISE-tagged parts.
217
+ - Expand sections that were called out as thin / missing examples / lacking evidence.
218
+ - Output the COMPLETE new document (at least ${r} chars).
219
+
220
+ Output format (literally \u2014 these markers will be parsed):
221
+
222
+ <v_next_content>
223
+ {full markdown document}
224
+ </v_next_content>
225
+
226
+ <v_next_meta>
227
+ {
228
+ "acceptedCritiques": ["id1", "id2", ...],
229
+ "rejectedCritiques": [{"id": "id3", "reason": "..."}, ...],
230
+ "changelog": "what changed and why, in 1-3 short paragraphs"
231
+ }
232
+ </v_next_meta>`}};function R(n){return n==="code"?T:D}a(R,"getFormat");h();h();function _(n,e){let t=new RegExp(`<${e}>([\\s\\S]*?)<\\/${e}>`,"i"),r=n.match(t);if(r)return r[1].trim();let o=new RegExp(`<${e}>`,"i").exec(n);if(!o)return null;let a=n.slice(o.index+o[0].length),s=a.search(/<[a-z_][\w]*>/i);return (s>=0?a.slice(0,s):a).trim()}a(_,"extractTag");function $(n){let e=_(n,"v1_content"),t=_(n,"merge_rationale");return e?{content:e,rationale:t??void 0}:{content:n.trim(),rationale:"[merge markers not found; using full response]"}}a($,"parseMergeResponse");function L(n){let e=_(n,"v_next_content"),t=_(n,"v_next_meta"),r={};if(t){let i=t.replace(/^```(?:json)?\s*/i,"").replace(/\s*```$/,"").trim();try{r=JSON.parse(i);}catch{r={changelog:`[meta JSON parse failed; raw text below]
233
+ ${t}`};}}return {content:e??n.trim(),meta:r}}a(L,"parseReviseResponse");function k(n,e,t){let r=n.replace(/^[^{[]*/,"").replace(/[^}\]]*$/,"").trim(),i;try{i=JSON.parse(r);}catch{let s=n.match(/\{[\s\S]*\}|\[[\s\S]*\]/);if(!s)return [];try{i=JSON.parse(s[0]);}catch{return []}}let o=Array.isArray(i)?i:i.critiques;if(!Array.isArray(o))return [];let a=[];for(let s=0;s<o.length;s++){let c=o[s];if(!c.anchor||!c.comment)continue;let u;Array.isArray(c.evidence)&&(u=c.evidence.filter(l=>typeof l!="object"||l===null?false:typeof l.url=="string").map(l=>({url:l.url,snippet:l.snippet})),u.length===0&&(u=void 0)),a.push({id:`${t}-${e}-${s+1}`,critic:e,anchor:String(c.anchor),severity:c.severity??"minor",category:c.category??"other",comment:String(c.comment),suggestion:c.suggestion?String(c.suggestion):void 0,evidence:u});}return a}a(k,"parseCritiquesResponse");h();h();var ye={name:"WebSearch",description:"Search the web for information. Returns a list of search results with titles, URLs, and snippets. Use this when you need up-to-date information or facts not in your training data.",inputSchema:{type:"object",properties:{query:{type:"string",description:"The search query"},num_results:{type:"number",description:"Number of results to return (default: 10, max: 20)"}},required:["query"]}};async function F(n){let e=n.query;if(!e)return "Error: query is required";let t=Math.min(n.num_results||10,20),r=process.env.SERPER_API_KEY,i=process.env.TAVILY_API_KEY,o=process.env.SEARXNG_URL;try{let a;if(r)a=await V(e,t,r);else if(i)a=await X(e,t,i);else if(o)a=await H(e,t,o);else return "Error: No search API configured. Set one of: SERPER_API_KEY, TAVILY_API_KEY, or SEARXNG_URL";return a.length===0?"No results found.":a.map((s,c)=>`${c+1}. ${s.title}
234
+ ${s.url}
235
+ ${s.snippet}`).join(`
236
+
237
+ `)}catch(a){return `Search error: ${a.message}`}}a(F,"webSearchTool");async function V(n,e,t){let r=await fetch("https://google.serper.dev/search",{method:"POST",headers:{"X-API-KEY":t,"Content-Type":"application/json"},body:JSON.stringify({q:n,num:e})});if(!r.ok)throw new Error(`Serper API error: ${r.status} ${r.statusText}`);return ((await r.json()).organic??[]).map(o=>({title:o.title??"",url:o.link??"",snippet:o.snippet??""}))}a(V,"searchSerper");async function X(n,e,t){let r=await fetch("https://api.tavily.com/search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({api_key:t,query:n,max_results:e,include_answer:false})});if(!r.ok)throw new Error(`Tavily API error: ${r.status} ${r.statusText}`);return ((await r.json()).results??[]).map(o=>({title:o.title??"",url:o.url??"",snippet:o.content??""}))}a(X,"searchTavily");async function H(n,e,t){let r=new URL("/search",t);r.searchParams.set("q",n),r.searchParams.set("format","json"),r.searchParams.set("pageno","1");let i=await fetch(r.toString(),{headers:{Accept:"application/json"}});if(!i.ok)throw new Error(`SearXNG error: ${i.status} ${i.statusText}`);return ((await i.json()).results??[]).slice(0,e).map(a=>({title:a.title??"",url:a.url??"",snippet:a.content??""}))}a(H,"searchSearXNG");h();var Se={name:"WebFetch",description:"Fetch a web page and return its text content. Strips HTML tags to return readable text. Use this to read articles, documentation, or any web page.",inputSchema:{type:"object",properties:{url:{type:"string",description:"The URL to fetch"},max_length:{type:"number",description:"Maximum characters to return (default: 50000)"},headers:{type:"object",description:"Optional HTTP headers to send"}},required:["url"]}},J=1e5,G=5e4,Q=new Set(["host","authorization","cookie","proxy-authorization","x-forwarded-for","x-real-ip","x-forwarded-host"]),Z=[/^localhost$/i,/^127\./,/^0\.0\.0\.0$/,/^10\./,/^169\.254\./,/^192\.168\./,/^172\.(1[6-9]|2[0-9]|3[01])\./,/^::1$/,/^fc00:/i,/^fd00:/i,/^fe80:/i];function ee(n){return Z.some(e=>e.test(n))}a(ee,"isBlockedHost");async function M(n){let e=n.url;if(!e)return "Error: url is required";let t;try{t=new URL(e);}catch{return `Error: invalid URL "${e}"`}if(t.protocol!=="http:"&&t.protocol!=="https:")return `Error: only http(s) URLs are allowed, got "${t.protocol}"`;if(ee(t.hostname))return `Error: refusing to fetch internal/loopback host "${t.hostname}"`;let r=Math.min(n.max_length||G,J),i=n.headers??{},o={};for(let[a,s]of Object.entries(i))Q.has(a.toLowerCase())||(o[a]=s);try{let a=await fetch(e,{headers:{"User-Agent":"Mozilla/5.0 (compatible; code-shell/0.1; +https://github.com/nicepkg/code-shell)",Accept:"text/html,application/xhtml+xml,application/xml;q=0.9,text/plain;q=0.8,*/*;q=0.7",...o},redirect:"follow",signal:AbortSignal.timeout(3e4)});if(!a.ok)return `Error: HTTP ${a.status} ${a.statusText}`;let s=a.headers.get("content-type")??"",c=await a.text(),u;return s.includes("text/html")||s.includes("application/xhtml")?u=te(c):u=c,u.length>r&&(u=u.slice(0,r)+`
238
+
239
+ ... content truncated (${u.length} chars total)`),u||"(page returned empty content)"}catch(a){let s=a.message;return s.includes("abort")||s.includes("timeout")?"Error: request timed out after 30s":`Fetch error: ${s}`}}a(M,"webFetchTool");function te(n){let e=n;e=e.replace(/<script[\s\S]*?<\/script>/gi,""),e=e.replace(/<style[\s\S]*?<\/style>/gi,""),e=e.replace(/<noscript[\s\S]*?<\/noscript>/gi,"");let t=e.match(/<title[^>]*>([\s\S]*?)<\/title>/i),r=t?O(t[1].trim()):"",i=e.match(/<main[\s\S]*?<\/main>/i)??e.match(/<article[\s\S]*?<\/article>/i)??e.match(/<div[^>]*(?:role="main"|id="content"|class="[^"]*content[^"]*")[^>]*>[\s\S]*?<\/div>/i);if(i)e=i[0];else {let o=e.match(/<body[\s\S]*?<\/body>/i);o&&(e=o[0]);}return e=e.replace(/<(nav|header|footer|aside)[\s\S]*?<\/\1>/gi,""),e=e.replace(/<(p|div|h[1-6]|li|br|tr|blockquote)[^>]*>/gi,`
240
+ `),e=e.replace(/<\/(p|div|h[1-6]|li|tr|blockquote)>/gi,`
241
+ `),e=e.replace(/<hr[^>]*>/gi,`
242
+ ---
243
+ `),e=e.replace(/<[^>]+>/g,""),e=O(e),e=e.split(`
244
+ `).map(o=>o.trim()).filter(o=>o.length>0).join(`
245
+ `),e=e.replace(/\n{3,}/g,`
246
+
247
+ `),r&&(e=`# ${r}
248
+
249
+ ${e}`),e.trim()}a(te,"extractTextFromHTML");function O(n){return n.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/&nbsp;/g," ").replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(Number(t))).replace(/&#x([0-9a-fA-F]+);/g,(e,t)=>String.fromCharCode(parseInt(t,16)))}a(O,"decodeEntities");var re={name:"web_search",description:"Search the web (Google via Serper / Tavily / SearXNG depending on env). Use this to verify any specific number, citation, URL, library version, API name, or external claim made in the draft you are reviewing. If a claim cannot be verified by web_search, mark it as a fabrication critique with severity = blocker.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Search query (English usually works best)."},num_results:{type:"number",description:"Default 5, max 20."}},required:["query"]}},ne={name:"web_fetch",description:"Fetch a URL and return its text content (HTML stripped). Use after web_search to read the actual page content of a search result and confirm a specific claim, version number, or quoted figure.",inputSchema:{type:"object",properties:{url:{type:"string",description:"Full http(s) URL to fetch."},max_length:{type:"number",description:"Default 50000 characters."}},required:["url"]}},j=[re,ne];async function N(n,e){return n==="web_search"?F(e):n==="web_fetch"?M(e):`Error: unknown tool "${n}"`}a(N,"executeIterateWebTool");function E(){return !!(process.env.SERPER_API_KEY||process.env.TAVILY_API_KEY||process.env.SEARXNG_URL)}a(E,"hasWebSearchProvider");var oe=8;async function U(n){let{subject:e,format:t,draft:r,critics:i,round:o,enableWebSearch:a,maxToolRounds:s,signal:c,onProgress:u}=n;u?.({type:"argue_start",round:o,data:{criticCount:i.length}});let l=!!a,p=l&&E();l&&!p&&b.warn("arena.iterate.argue_web_unavailable",{reason:"No SERPER_API_KEY / TAVILY_API_KEY / SEARXNG_URL configured"});let f=`r${o}`,d=i.map(async y=>{c?.throwIfAborted();try{return p?await ie({critic:y,subject:e,format:t,draft:r,idPrefix:f,maxToolRounds:s??oe,signal:c}):await ae({critic:y,subject:e,format:t,draft:r,idPrefix:f,signal:c})}catch(K){return b.warn("arena.iterate.argue_failed",{round:o,critic:y.name,error:K.message}),[]}}),h=(await Promise.all(d)).flat();return u?.({type:"argue_done",round:o,data:{critiqueCount:h.length,webEnabled:p}}),h}a(U,"runArgueRound");async function ae(n){let{critic:e,subject:t,format:r,draft:i,idPrefix:o,signal:a}=n,c=await(await b$1({...e.llm,enableStreaming:false})).createMessage({systemPrompt:r.argueSystem(r.format),messages:[{role:"user",content:r.argueUser(t,i)}],tools:[],signal:a}),u=k(c.text,e.name,o);return b.info("arena.iterate.argue_singleshot",{critic:e.name,critiqueCount:u.length}),u}a(ae,"argueSingleShot");async function ie(n){let{critic:e,subject:t,format:r,draft:i,idPrefix:o,maxToolRounds:a,signal:s}=n,c=await b$1({...e.llm,enableStreaming:false}),u=[{role:"user",content:r.argueUser(t,i)}],l=0,p="";for(;l<a;){s?.throwIfAborted();let d=await c.createMessage({systemPrompt:r.argueSystem(r.format),messages:u,tools:j,signal:s});if(d.text&&(p=d.text),!d.toolCalls||d.toolCalls.length===0)break;u.push({role:"assistant",content:[...d.text?[{type:"text",text:d.text}]:[],...d.toolCalls.map(h=>({type:"tool_use",id:h.id,name:h.toolName,input:h.args}))]});let b=await Promise.all(d.toolCalls.map(async h=>{try{let y=await N(h.toolName,h.args);return {id:h.id,content:y}}catch(y){return {id:h.id,content:`Error: ${y.message}`}}}));u.push({role:"user",content:b.map(h=>({type:"tool_result",tool_use_id:h.id,content:h.content}))}),l++;}!p&&l>=a&&(p=(await c.createMessage({systemPrompt:r.argueSystem(r.format),messages:[...u,{role:"user",content:"You have used the maximum number of tool rounds. Produce your critiques JSON now, based on what you have already gathered. Do not request any more tools."}],tools:[],signal:s})).text);let f=k(p,e.name,o);return b.info("arena.iterate.argue_toolloop",{critic:e.name,critiqueCount:f.length,toolRounds:l}),f}a(ie,"argueWithToolLoop");h();async function Y(n){let{subject:e,format:t,previous:r,critiques:i,author:o,minDraftLength:a,signal:s,onProgress:c}=n;c?.({type:"revise_start",round:r.version+1,participant:o.name});let u=await b$1({...o.llm,enableStreaming:false}),l=t.revisePrompt(e,r,i,a),p=await u.createMessage({systemPrompt:l,messages:[{role:"user",content:`Produce v${r.version+1} now.`}],tools:[],maxTokens:32e3,signal:s}),{content:f,meta:d}=L(p.text),b$2=f,h=r.content.length>0?1-b$2.length/r.content.length:0;h>.3&&b$2.length<a&&(b.warn("arena.iterate.revise_too_short",{version:r.version+1,previousLength:r.content.length,newLength:b$2.length,minDraftLength:a}),d.changelog=`[WARNING: revision is ${Math.round(h*100)}% shorter than v${r.version}; the author may have summarized instead of rewriting]
250
+
251
+ `+(d.changelog??""));let y={version:r.version+1,author:o.name,format:t.format,content:b$2,acceptedCritiques:d.acceptedCritiques,rejectedCritiques:d.rejectedCritiques,changelog:d.changelog};return c?.({type:"revise_done",round:y.version,participant:o.name,data:{length:b$2.length,accepted:d.acceptedCritiques?.length??0}}),b.info("arena.iterate.revise",{version:y.version,author:o.name,length:b$2.length,accepted:d.acceptedCritiques?.length??0,rejected:d.rejectedCritiques?.length??0}),y}a(Y,"runRevise");h();async function W(n){let{subject:e,format:t,participants:r,minDraftLength:i,signal:o,onProgress:a}=n;a?.({type:"v1_tournament_start",data:{count:r.length}});let s=r.map(async(l,p)=>{o?.throwIfAborted();let f=await b$1({...l.llm,enableStreaming:false}),d=t.draftPrompt(e,i),h=(await f.createMessage({systemPrompt:d,messages:[{role:"user",content:"Write your draft now."}],tools:[],maxTokens:32e3,signal:o})).text.trim(),y={author:l.name,anonymousLabel:`Draft ${String.fromCharCode(65+p)}`,content:h};return a?.({type:"v1_candidate_done",participant:l.name,data:{length:h.length,anonymousLabel:y.anonymousLabel}}),b.info("arena.iterate.v1_candidate",{participant:l.name,anonymousLabel:y.anonymousLabel,length:h.length}),y}),c=await Promise.allSettled(s),u=[];for(let l of c)l.status==="fulfilled"?u.push(l.value):b.warn("arena.iterate.v1_candidate_failed",{error:l.reason?.message});if(u.length===0)throw new Error("All v1 tournament candidates failed");for(let l=u.length-1;l>0;l--){let p=Math.floor(Math.random()*(l+1));[u[l],u[p]]=[u[p],u[l]],u[l].anonymousLabel=`Draft ${String.fromCharCode(65+l)}`;}return u[0].anonymousLabel="Draft A",u}a(W,"runTournamentCandidates");async function B(n){let{subject:e,format:t,author:r,candidates:i,minDraftLength:o,signal:a,onProgress:s}=n;s?.({type:"v1_merge_start",participant:r.name});let c=await b$1({...r.llm,enableStreaming:false}),u=t.mergePrompt(e,i,o),l=await c.createMessage({systemPrompt:u,messages:[{role:"user",content:"Produce v1 now."}],tools:[],maxTokens:32e3,signal:a}),{content:p,rationale:f}=$(l.text),d={version:1,author:r.name,format:t.format,content:p,draftCandidates:i,mergeRationale:f};return s?.({type:"v1_merge_done",participant:r.name,data:{length:p.length}}),b.info("arena.iterate.v1_merge",{author:r.name,candidateCount:i.length,length:p.length}),d}a(B,"mergeCandidatesToV1");async function z(n){let{subject:e,format:t,author:r,minDraftLength:i,signal:o}=n,a=await b$1({...r.llm,enableStreaming:false}),s=t.draftPrompt(e,i),c=await a.createMessage({systemPrompt:s,messages:[{role:"user",content:"Write your draft now."}],tools:[],maxTokens:32e3,signal:o});return {version:1,author:r.name,format:t.format,content:c.text.trim()}}a(z,"singleAuthorV1");var se=5,A=class{static{a(this,"IterativeArena");}config;constructor(e){if(!e.author)throw new Error("IterativeArena requires an `author` participant");if(!e.critics||e.critics.length===0)throw new Error("IterativeArena requires at least 1 critic");let t=[e.author.name,...e.critics.map(r=>r.name)];if(new Set(t).size!==t.length)throw new Error("Author and critics must have unique names");this.config=e;}async run(){let e=Date.now(),{config:t}=this,r=R(t.format),i=t.maxRounds??se,o=t.minDraftLength??(t.format==="code"?200:800),a=t.signal,s=[],c;try{if((t.v1Strategy??"tournament")==="tournament"){let f=await W({subject:t.subject,format:r,participants:[t.author,...t.critics],minDraftLength:o,signal:a,onProgress:t.onProgress});c=await B({subject:t.subject,format:r,author:t.author,candidates:f,minDraftLength:o,signal:a,onProgress:t.onProgress});}else c=await z({subject:t.subject,format:r,author:t.author,minDraftLength:o,signal:a});}catch(f){throw b.error("arena.iterate.v1_failed",{error:f.message}),f}let u=t.author,l=[t.author,...t.critics],p;for(let f=1;f<=i;f++){a?.throwIfAborted();let d=await U({subject:t.subject,format:r,draft:c,critics:this.criticsForRound(f),round:f,enableWebSearch:t.enableWebSearch,maxToolRounds:t.maxArgueToolRounds,signal:a,onProgress:t.onProgress}),b=this.checkConvergence({round:f,critiques:d,draft:c,previousDraft:p}),h={round:f,draft:c,critiques:d,convergence:b},y;if(t.humanCheckpoint&&(t.onProgress?.({type:"checkpoint_pause",round:f}),y=await t.humanCheckpoint({round:f,draft:c,critiques:d,convergence:b})),s.push(h),t.onProgress?.({type:"round_done",round:f,data:{critiques:d.length,shouldStop:b.shouldStop,userAction:y}}),y==="stop")return this.finalize(s,"user_stop",e);if(y!=="force-continue"&&b.shouldStop)return this.finalize(s,"converged",e);if(f===i)return this.finalize(s,"max_rounds",e);p=c,u=this.pickNextAuthor(u,d,l,f),c=await Y({subject:t.subject,format:r,previous:p,critiques:d,author:u,minDraftLength:o,signal:a,onProgress:t.onProgress});}return this.finalize(s,"max_rounds",e)}criticsForRound(e){return this.config.critics}checkConvergence(e){if(this.config.convergenceStrategy&&this.config.convergenceStrategy!=="default"){let t=this.config.convergenceStrategy(e),r=e.critiques.filter(a=>a.severity==="blocker").length,i=e.critiques.filter(a=>a.severity==="major").length,o=e.previousDraft?x(e.previousDraft.content,e.draft.content):1;return {blockerCount:r,majorCount:i,totalCritiques:e.critiques.length,diffFromPrevious:o,shouldStop:t,reason:t?"all_minor_or_praise":"running"}}return C(e)}pickNextAuthor(e,t,r,i){let o=this.config.authorRotation??"fixed";if(o==="fixed")return this.config.author;if(o==="round-robin"){let a=i%r.length;return r[a]}if(o==="best-critic"){let a={blocker:5,major:3,minor:1,nit:.5,praise:0},s=new Map;for(let p of t)s.set(p.critic,(s.get(p.critic)??0)+(a[p.severity]??0));let c=e.name,u=-1;for(let[p,f]of s)f>u&&(u=f,c=p);return r.find(p=>p.name===c)??e}return e}finalize(e,t,r){let i=e.at(-1).draft,o={subject:this.config.subject,format:this.config.format,rounds:e,finalDraft:i,stoppedAt:t,durationMs:Date.now()-r};return this.config.onProgress?.({type:"iterate_complete",data:{stoppedAt:t,rounds:e.length,finalLength:i.content.length}}),b.info("arena.iterate.complete",{stoppedAt:t,rounds:e.length,finalVersion:i.version,finalLength:i.content.length}),o}};export{ye as a,F as b,Se as c,M as d,x as e,C as f,T as g,D as h,R as i,A as j};
@@ -0,0 +1,5 @@
1
+ import {j}from'./chunk-FU7AHZNN.js';import {h,a}from'./chunk-3QP5BQ3L.js';import {mkdirSync,existsSync,writeFileSync,appendFileSync,readFileSync,renameSync,readdirSync,statSync}from'fs';import {dirname,join}from'path';import {homedir}from'os';import {nanoid}from'nanoid';h();h();var l=class c{static{a(this,"Transcript");}events=[];filePath;currentTurn=0;getFilePath(){return this.filePath}constructor(t){this.filePath=t,mkdirSync(dirname(t),{recursive:true}),existsSync(t)||writeFileSync(t,"","utf-8");}append(t,s){let e={id:nanoid(12),type:t,timestamp:Date.now(),turnNumber:this.currentTurn,data:s};return this.events.push(e),this.flush(e),e}appendMessage(t,s){return this.append("message",{role:t,content:s})}appendToolUse(t,s,e){return this.append("tool_use",{toolName:t,toolCallId:s,args:e})}appendToolResult(t,s,e,n){return this.append("tool_result",{toolCallId:t,toolName:s,result:e,error:n})}appendTurnBoundary(){return this.currentTurn++,this.append("turn_boundary",{turnNumber:this.currentTurn})}appendSummary(t,s){return this.append("summary",{summary:t,trigger:"auto",compactedRange:s,preservedSegment:{headEventId:this.events[0]?.id,tailEventId:this.events[this.events.length-1]?.id}})}appendError(t,s){return this.append("error",{error:t,...s})}toMessages(){let t=[];for(let s of this.events)switch(s.type){case "message":{let{role:e,content:n}=s.data;t.push({role:e,content:n});break}case "tool_use":break;case "tool_result":{let{toolCallId:e,result:n,error:i}=s.data,r=t[t.length-1],o={type:"tool_result",tool_use_id:e,content:i?`Error: ${i}`:n??"(no output)"};r?.role==="user"&&Array.isArray(r.content)?r.content.push(o):t.push({role:"user",content:[o]});break}case "summary":{let{summary:e}=s.data;t.push({role:"user",content:`<system-reminder>Previous conversation was summarized:
2
+ ${e}</system-reminder>`});break}}return t}getEvents(t){return t?this.events.filter(s=>s.type===t):[...this.events]}get turnNumber(){return this.currentTurn}get eventCount(){return this.events.length}flush(t){try{appendFileSync(this.filePath,JSON.stringify(t)+`
3
+ `,"utf-8");}catch{}}repairToolResultPairs(){let t=new Set,s=new Set;for(let e of this.events)e.type==="tool_use"?t.add(e.data.toolCallId):e.type==="tool_result"&&s.add(e.data.toolCallId);for(let e of t)s.has(e)||this.append("tool_result",{toolCallId:e,toolName:"unknown",error:"[Tool result missing due to interrupted session]"});this.events=this.events.filter(e=>{if(e.type==="tool_result"){let n=e.data.toolCallId;return t.has(n)}return true});}static loadFromFile(t){let s=new c(t);if(!existsSync(t))return s;let n=readFileSync(t,"utf-8").split(`
4
+ `).filter(i=>i.trim());for(let i of n)try{let r=JSON.parse(i);s.events.push(r),r.type==="turn_boundary"&&(s.currentTurn=r.data.turnNumber??s.currentTurn+1);}catch{}return s.repairToolResultPairs(),s}};var S=class{static{a(this,"SessionManager");}sessionsDir;constructor(t){this.sessionsDir=t??join(homedir(),".code-shell","sessions"),mkdirSync(this.sessionsDir,{recursive:true});}create(t,s,e){let n=nanoid(16),i=join(this.sessionsDir,n);mkdirSync(i,{recursive:true});let r={sessionId:n,cwd:t,startedAt:Date.now(),model:s,provider:e,tokenUsage:{promptTokens:0,completionTokens:0,totalTokens:0},turnCount:0,invokedSkills:[],status:"active"};writeFileSync(join(i,"state.json"),JSON.stringify(r,null,2),"utf-8");let o=new l(join(i,"transcript.jsonl"));return o.append("session_meta",{sessionId:n,cwd:t,model:s,provider:e,startedAt:r.startedAt}),{state:r,transcript:o}}resume(t){let s=join(this.sessionsDir,t);if(!existsSync(s))throw new j(`Session not found: ${t}`);let e=join(s,"state.json");if(!existsSync(e))throw new j(`Session state file not found: ${t}`);let n=JSON.parse(readFileSync(e,"utf-8")),i=join(s,"transcript.jsonl"),r=l.loadFromFile(i);return n.status="active",{state:n,transcript:r}}saveState(t){let s=join(this.sessionsDir,t.sessionId);mkdirSync(s,{recursive:true});let e=join(s,"state.json"),n=`${e}.${process.pid}.${Date.now()}.tmp`;writeFileSync(n,JSON.stringify(t,null,2),"utf-8"),renameSync(n,e);}fork(t,s){let e=this.resume(t),n=e.transcript.getEvents(),i=s??e.state.turnCount,r=this.create(e.state.cwd,e.state.model,e.state.provider);r.state.parentSessionId=t;for(let o of n){if(o.type==="turn_boundary"&&o.data.turnNumber>i)break;r.transcript.append(o.type,o.data);}return this.saveState(r.state),r}list(t=20){if(!existsSync(this.sessionsDir))return [];let s=readdirSync(this.sessionsDir,{withFileTypes:true}).filter(n=>n.isDirectory()).map(n=>n.name),e=[];for(let n of s){let i=join(this.sessionsDir,n,"state.json");if(existsSync(i))try{let r=JSON.parse(readFileSync(i,"utf-8")),o=join(this.sessionsDir,n,"transcript.jsonl"),m=I(o),T=existsSync(o)?statSync(o).mtimeMs:r.startedAt;e.push({...r,preview:m,lastActiveAt:T});}catch{}}return e.sort((n,i)=>i.lastActiveAt-n.lastActiveAt).slice(0,t)}};function I(c){if(!existsSync(c))return;let s=readFileSync(c,"utf-8").split(`
5
+ `);for(let e=s.length-1;e>=0;e--){let n=s[e];if(!n)continue;let i;try{i=JSON.parse(n);}catch{continue}if(i.type!=="message"||i.data?.role!=="user")continue;let r=i.data.content,o=typeof r=="string"?r:Array.isArray(r)?r.find(m=>m.type==="text")?.text??"":"";if(o.trim())return o.replace(/\s+/g," ").trim()}}a(I,"readLastUserMessage");export{l as a,S as b};
@@ -0,0 +1 @@
1
+ import {V,ea}from'./chunk-NMBYBGC7.js';import {h,a}from'./chunk-3QP5BQ3L.js';import {join}from'path';import {homedir}from'os';h();h();function l(e){let o=e.runsDir??join(homedir(),".code-shell","runs"),u=new V(o);return new ea({store:u,executor:{llm:e.llm,maxTurns:e.maxTurns??30,maxContextTokens:e.maxContextTokens??2e5,permissionMode:e.permissionMode??"acceptEdits",sessionStorageDir:e.sessionStorageDir,mcpServers:e.mcpServers,enabledBuiltinTools:e.enabledBuiltinTools,disabledBuiltinTools:e.disabledBuiltinTools,customSystemPrompt:e.customSystemPrompt,appendSystemPrompt:e.appendSystemPrompt,hooks:e.hooks},concurrency:e.concurrency??1,runsDir:o,evaluator:e.evaluator,defaultTags:e.defaultTags,defaultMetadata:e.defaultMetadata})}a(l,"createRunManager");export{l as a};
@@ -0,0 +1 @@
1
+ import {h,a}from'./chunk-3QP5BQ3L.js';h();function t(){return {name:"off",wrap(r,a){return {file:a.shell,args:["-c",r]}}}}a(t,"createOffBackend");export{t as a};
@@ -0,0 +1,18 @@
1
+ import {h,a}from'./chunk-3QP5BQ3L.js';import {mkdirSync,writeFileSync,existsSync,readdirSync,readFileSync,unlinkSync}from'fs';import {join}from'path';import {homedir}from'os';h();function v(o){if(o)return o;let e=process.env.CODE_SHELL_HOME;return e&&e.length>0?e:join(homedir(),".code-shell")}a(v,"resolveMemoryBaseDir");var p=class{static{a(this,"MemoryManager");}baseDir;memoryDir;indexPath;indexCache=null;constructor(e){let t=typeof e=="string"?{projectDir:e}:e??{};if(this.baseDir=v(t.baseDir),t.projectDir){let r=t.projectDir.replace(/[/\\:]/g,"-").replace(/^-/,"");this.memoryDir=join(this.baseDir,"projects",r,"memory");}else this.memoryDir=join(this.baseDir,"memory");this.indexPath=join(this.memoryDir,"MEMORY.md"),mkdirSync(this.memoryDir,{recursive:true});}getMemoryDir(){return this.memoryDir}save(e){let t=this.slugify(e.name)+".md",r=join(this.memoryDir,t),n=`---
2
+ name: ${e.name}
3
+ description: ${e.description}
4
+ type: ${e.type}
5
+ ---
6
+
7
+ ${e.content}
8
+ `;writeFileSync(r,n,"utf-8");let i=this.ensureIndexCache();return i.set(t,{name:e.name,description:e.description}),this.writeIndex(i),t}loadAll(){if(!existsSync(this.memoryDir))return [];let e=readdirSync(this.memoryDir).filter(r=>r.endsWith(".md")&&r!=="MEMORY.md"),t=[];for(let r of e){let n=this.loadFile(r);n&&t.push(n);}return t}loadFile(e){let t=join(this.memoryDir,e);if(!existsSync(t))return null;try{let n=readFileSync(t,"utf-8").match(/^---\n([\s\S]*?)\n---\n\n?([\s\S]*)$/);if(!n)return null;let i=n[1],d=n[2].trim(),y=i.match(/name:\s*(.+)/)?.[1]?.trim()??e,f=i.match(/description:\s*(.+)/)?.[1]?.trim()??"",u=i.match(/type:\s*(.+)/)?.[1]?.trim()??"project";return {name:y,description:f,type:u,content:d,fileName:e}}catch{return null}}delete(e){let r=this.loadAll().find(n=>n.name===e||n.fileName===e);if(!r)return false;try{unlinkSync(join(this.memoryDir,r.fileName));let n=this.ensureIndexCache();return n.delete(r.fileName),this.writeIndex(n),!0}catch{return false}}getIndex(){return existsSync(this.indexPath)?readFileSync(this.indexPath,"utf-8"):""}buildMemoryContext(){let e=this.loadAll();return e.length===0?"":`# Persistent Memory
9
+
10
+ The following memories from previous sessions may be relevant:
11
+
12
+ `+e.map(r=>`- [${r.type}] ${r.name}: ${r.description}`).join(`
13
+ `)+`
14
+
15
+ To read a specific memory, check ${this.memoryDir}/`}ensureIndexCache(){if(this.indexCache!==null)return this.indexCache;let e=new Map;for(let t of this.loadAll())e.set(t.fileName,{name:t.name,description:t.description});return this.indexCache=e,e}writeIndex(e){let t=[];for(let[n,i]of e)t.push(`- [${i.name}](${n}) \u2014 ${i.description}`);let r=t.length>0?t.join(`
16
+ `)+`
17
+ `:`(no memories stored)
18
+ `;writeFileSync(this.indexPath,r,"utf-8");}slugify(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"").slice(0,60)}};export{v as a,p as b};
@@ -0,0 +1,3 @@
1
+ import {h,a,f,g,b as b$1}from'./chunk-3QP5BQ3L.js';import {execFile,spawn}from'child_process';import {readFileSync,constants}from'fs';import {access,stat,unlink,writeFile,mkdir,readFile}from'fs/promises';import {createRequire}from'module';import {homedir}from'os';import {dirname,resolve,join}from'path';import {fileURLToPath}from'url';import {promisify}from'util';import {gt}from'semver';h();h();function E(t,e){return gt(t,e)}a(E,"gt");var T=promisify(execFile),w="@cjhyy/code-shell",H=".update.lock",P=300*1e3,B=5e3,u,b=false,x=null;function kt(t=w){X(t);}a(kt,"checkForUpdate");function Et(){return u}a(Et,"getUpdateAvailable");function vt(){return x}a(vt,"getAutoUpdateDisabledReason");function St(){if(b)return;b=true;let t=a(()=>{let e=u;if(!(!e||!e.canAutoInstall))try{et(e.latestVersion);}catch{}},"fire");process.once("exit",t);}a(St,"scheduleAutoInstallOnExit");var y;function J(){if(y)return y;let t=W();return y=t,t}a(J,"getCurrentVersion");function W(){try{let e=typeof import.meta<"u"&&import.meta.url?dirname(fileURLToPath(import.meta.url)):f;for(let r=0;r<6;r++){try{let i=JSON.parse(readFileSync(resolve(e,"package.json"),"utf-8"));if(i&&typeof i.version=="string")return i.version}catch{}let o=dirname(e);if(o===e)break;e=o;}}catch{}try{let e=createRequire(import.meta.url??g)("../../package.json");if(e?.version)return e.version}catch{}return "0.0.0"}a(W,"resolveVersion");async function X(t){let e=nt();if(e){x=e;return}x=null;try{let r=J(),o=await z(t);if(!o)return;let i=!1;try{i=E(o,r);}catch{i=o!==r;}if(!i){u=void 0;return}let{hasPermissions:s,npmPrefix:a}=await Q();u={latestVersion:o,canAutoInstall:s,npmPrefix:a};}catch{}}a(X,"runCheck");async function z(t){try{let{stdout:e}=await T("npm",["view",`${t}@latest`,"version","--prefer-online"],{cwd:homedir(),timeout:B}),r=e.trim();return r.length>0?r:null}catch{return null}}a(z,"getLatestVersion");async function Q(){let t=null;try{let{stdout:e}=await T("npm",["-g","config","get","prefix"],{cwd:homedir(),timeout:5e3});t=e.trim();}catch{return {hasPermissions:false,npmPrefix:null}}if(!t)return {hasPermissions:false,npmPrefix:null};try{return await access(t,constants.W_OK),{hasPermissions:!0,npmPrefix:t}}catch{return {hasPermissions:false,npmPrefix:t}}}a(Q,"checkGlobalInstallPermissions");function D(){return process.env.HOME??homedir()}a(D,"userHome");function d(){return join(D(),".code-shell")}a(d,"configDir");function p(){return join(d(),H)}a(p,"getLockFilePath");function Y(){return join(d(),"update.log")}a(Y,"getUpdateLogPath");async function Z(){let t=p();try{let e=await stat(t);if(Date.now()-e.mtimeMs<P)return !1;try{let r=await stat(t);if(Date.now()-r.mtimeMs<P)return !1;await unlink(t);}catch(r){if(!U(r))return !1}}catch(e){if(!U(e))return false}try{return await writeFile(t,String(process.pid),{encoding:"utf8",flag:"wx"}),!0}catch(e){let r=k(e);if(r==="EEXIST")return false;if(r==="ENOENT")try{return await mkdir(d(),{recursive:!0}),await writeFile(t,String(process.pid),{encoding:"utf8",flag:"wx"}),!0}catch{return false}return false}}a(Z,"acquireLock");async function tt(){let t=p();try{await readFile(t,"utf8")===String(process.pid)&&await unlink(t);}catch{}}a(tt,"releaseLock");function et(t){let e=p();try{try{let s=b$1("fs");s.mkdirSync(d(),{recursive:!0}),s.writeFileSync(e,String(process.pid),{encoding:"utf8",flag:"wx"});}catch(s){if(k(s)==="EEXIST")try{let a=b$1("fs"),F=a.statSync(e);if(Date.now()-F.mtimeMs<P)return;a.unlinkSync(e),a.writeFileSync(e,String(process.pid),{encoding:"utf8",flag:"wx"});}catch{return}else return}}catch{return}let r=b$1("fs"),o=r.openSync(Y(),"a");try{r.writeSync(o,`
2
+ [${new Date().toISOString()}] code-shell auto-update: installing ${w}@${t} (pid=${process.pid})
3
+ `);}catch{}let i=[`npm install -g ${w}@${_(t)}`,`; rm -f ${_(e)}`].join(" ");try{spawn("sh",["-c",i],{detached:!0,stdio:["ignore",o,o],cwd:homedir()}).unref();}catch{try{r.unlinkSync(e);}catch{}}}a(et,"launchDetachedInstall");function nt(){return process.env.NODE_ENV==="development"?"development build":ot(process.env.DISABLE_AUTOUPDATER)?"DISABLE_AUTOUPDATER set":rt()===false?"settings.autoUpdates = false":null}a(nt,"isAutoUpdaterDisabled");function rt(){let t=join(D(),".code-shell","settings.json");try{let e=readFileSync(t,"utf8"),r=JSON.parse(e);if(typeof r.autoUpdates=="boolean")return r.autoUpdates}catch{}}a(rt,"readAutoUpdatesFlagFromDisk");function ot(t){if(!t)return false;let e=t.toLowerCase();return e==="1"||e==="true"||e==="yes"||e==="on"}a(ot,"isEnvTruthy");function k(t){return typeof t=="object"&&t!==null&&"code"in t?String(t.code):void 0}a(k,"errnoCode");function U(t){return k(t)==="ENOENT"}a(U,"isENOENT");function _(t){return `'${t.replace(/'/g,"'\\''")}'`}a(_,"shellEscape");var It={acquireLock:Z,releaseLock:tt,getLockFilePath:p};export{kt as a,Et as b,vt as c,St as d,J as e,It as f};