@cjhyy/code-shell 0.1.6 → 0.2.0
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.
- package/dist/anthropic-OVRWAZRD.js +1 -0
- package/dist/arena/index.js +1 -104
- package/dist/arena-64T2EQD4.js +3 -0
- package/dist/bwrap-PVZMLHZR.js +2 -0
- package/dist/chunk-2EUIMKJA.js +1 -0
- package/dist/chunk-2GJ7H5NC.js +641 -0
- package/dist/chunk-2OD6VR4N.js +2 -0
- package/dist/chunk-3QP5BQ3L.js +1 -0
- package/dist/chunk-A4M2Y42L.js +2 -0
- package/dist/chunk-DEYFK6FP.js +1 -0
- package/dist/chunk-DTPABBSV.js +2 -0
- package/dist/chunk-EU3J7TBP.js +1 -0
- package/dist/chunk-FU7AHZNN.js +1 -0
- package/dist/chunk-L7B2ORID.js +4 -0
- package/dist/chunk-M7VU4YVY.js +49 -0
- package/dist/chunk-MGP35GKD.js +254 -0
- package/dist/chunk-MLCTC53I.js +1 -0
- package/dist/chunk-O5HFCH2U.js +1 -0
- package/dist/chunk-P6JSTIFM.js +1 -0
- package/dist/chunk-Q3RSX66I.js +1 -0
- package/dist/chunk-QTWU7UNA.js +5 -0
- package/dist/chunk-RERBX75D.js +251 -0
- package/dist/chunk-SNFAPSLA.js +1 -0
- package/dist/chunk-T222K6IV.js +18 -0
- package/dist/chunk-TKJA6W36.js +3 -0
- package/dist/chunk-VKKU4LOM.js +3 -0
- package/dist/chunk-WI6FSWGU.js +1 -0
- package/dist/chunk-XXCZE2U2.js +2 -0
- package/dist/chunk-ZSAONDT6.js +2 -0
- package/dist/cli/main.js +303 -22060
- package/dist/cli/onboarding.d.ts +7 -2
- package/dist/client-base-F5FCRSB3.js +1 -0
- package/dist/compaction-L3Y6NG4N.js +1 -0
- package/dist/context/compaction.d.ts +2 -1
- package/dist/data/static-catalogs.d.ts +25 -0
- package/dist/devtools-SGDUOOM4.js +1 -0
- package/dist/engine/engine.d.ts +24 -0
- package/dist/engine/turn-loop.d.ts +20 -0
- package/dist/export-md-U72T7NW7.js +22 -0
- package/dist/file-history-7FQFEQOL.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -347
- package/dist/llm/capabilities/index.d.ts +20 -0
- package/dist/llm/capabilities/rules.d.ts +26 -0
- package/dist/llm/capabilities/types.d.ts +108 -0
- package/dist/llm/model-pool.d.ts +7 -0
- package/dist/llm/provider-catalog.d.ts +2 -0
- package/dist/llm/provider-kinds.d.ts +1 -1
- package/dist/llm/providers/openai.d.ts +22 -0
- package/dist/llm/token-counter.d.ts +17 -0
- package/dist/llm/types.d.ts +8 -0
- package/dist/logging/logger.d.ts +10 -2
- package/dist/logging/session-recorder.d.ts +16 -3
- package/dist/manager-J6FXEUEK.js +1 -0
- package/dist/mcp-manager-27EVBKRT.js +1 -0
- package/dist/memory-BNI4WEWL.js +1 -0
- package/dist/model-cache-HEDXI7UJ.js +1 -0
- package/dist/model-fetcher-X5W5EASG.js +1 -0
- package/dist/off-7SDVMMXW.js +1 -0
- package/dist/openai-3QEADSYL.js +1 -0
- package/dist/openrouter-models-GZVCRWD2.js +1 -0
- package/dist/openrouter-sync-WG4AG5NC.js +1 -0
- package/dist/product/index.js +1 -21
- package/dist/protocol/client.d.ts +1 -1
- package/dist/run/index.js +1 -48
- package/dist/seatbelt-L54CNI2Y.js +37 -0
- package/dist/session/session-manager.d.ts +2 -0
- package/dist/session-manager-AGWS5SMJ.js +1 -0
- package/dist/settings/schema.d.ts +147 -21
- package/dist/tool-summary-V2B3MD5N.js +2 -0
- package/dist/tool-system/builtin/bash.d.ts +7 -1
- package/dist/tool-system/context.d.ts +7 -0
- package/dist/tool-system/executor.d.ts +4 -0
- package/dist/tool-system/sandbox/bwrap.d.ts +13 -0
- package/dist/tool-system/sandbox/index.d.ts +78 -0
- package/dist/tool-system/sandbox/off.d.ts +2 -0
- package/dist/tool-system/sandbox/seatbelt.d.ts +18 -0
- package/dist/tool-system/task-guard.d.ts +30 -0
- package/dist/types.d.ts +17 -0
- package/dist/ui/components/SessionPicker.d.ts +2 -0
- package/dist/ui/components/SpinnerWithVerb.d.ts +7 -2
- package/dist/ui/components/StatusLine.d.ts +7 -3
- package/dist/updater-OCNU2K2Z.js +1 -0
- package/package.json +7 -10
- package/dist/anthropic-IBTI4WL2.cjs +0 -10
- package/dist/anthropic-PRZZKHEZ.js +0 -10
- package/dist/arena/index.cjs +0 -104
- package/dist/arena-2LTLIXOL.js +0 -261
- package/dist/arena-ADB7DRFI.cjs +0 -261
- package/dist/chunk-2YW4FPFG.cjs +0 -101
- package/dist/chunk-3OA5G4TM.js +0 -47
- package/dist/chunk-3QO25N6E.js +0 -4711
- package/dist/chunk-3SBSUOWZ.js +0 -447
- package/dist/chunk-52LGZKT3.cjs +0 -47
- package/dist/chunk-55XGPMAP.cjs +0 -146
- package/dist/chunk-6QVAYW7C.cjs +0 -438
- package/dist/chunk-6S4BJ65N.js +0 -113
- package/dist/chunk-76HYEPDM.js +0 -307
- package/dist/chunk-7BI3V74Y.cjs +0 -447
- package/dist/chunk-7EG3V4JY.cjs +0 -113
- package/dist/chunk-7JVTYEEC.js +0 -340
- package/dist/chunk-7QIM3BKD.js +0 -44
- package/dist/chunk-7Y6S3OCX.js +0 -438
- package/dist/chunk-ABRRONJ7.js +0 -107
- package/dist/chunk-BSW22MPA.js +0 -146
- package/dist/chunk-BXCY2FSE.js +0 -203
- package/dist/chunk-BZ5TNE7L.js +0 -5128
- package/dist/chunk-DDB6QOKJ.cjs +0 -1252
- package/dist/chunk-HEKQCI7B.cjs +0 -224
- package/dist/chunk-IK4EWJBP.cjs +0 -203
- package/dist/chunk-ILHE7XLT.cjs +0 -107
- package/dist/chunk-JMR33QVF.cjs +0 -169
- package/dist/chunk-KAQHULYN.js +0 -54
- package/dist/chunk-KE4EQOWA.js +0 -294
- package/dist/chunk-KOVYSDHZ.cjs +0 -340
- package/dist/chunk-KS3RYAYL.cjs +0 -45
- package/dist/chunk-MD32R22I.js +0 -50
- package/dist/chunk-MV7YI4WO.cjs +0 -293
- package/dist/chunk-MY5XHADU.cjs +0 -216
- package/dist/chunk-NUNC3VFB.cjs +0 -307
- package/dist/chunk-PKGRTCCY.js +0 -9092
- package/dist/chunk-QARL3IDQ.js +0 -1252
- package/dist/chunk-S754JHLR.cjs +0 -54
- package/dist/chunk-SFXHZSRF.js +0 -101
- package/dist/chunk-SIHHIQLO.js +0 -224
- package/dist/chunk-T6VYG46N.js +0 -105
- package/dist/chunk-TNLGBJYS.cjs +0 -44
- package/dist/chunk-TUY2T5KP.cjs +0 -105
- package/dist/chunk-UXOCVJJ6.cjs +0 -9092
- package/dist/chunk-VIAGTYYW.js +0 -169
- package/dist/chunk-WASS5YWB.js +0 -215
- package/dist/chunk-WZJV6DJC.cjs +0 -5128
- package/dist/chunk-YIQBXAYU.cjs +0 -264
- package/dist/chunk-YKIAELDZ.cjs +0 -4711
- package/dist/chunk-ZBPSQCPU.js +0 -264
- package/dist/cli/main.cjs +0 -22156
- package/dist/client-base-HTF236ZD.cjs +0 -9
- package/dist/client-base-QKRKCOWB.js +0 -9
- package/dist/compaction-6VU2T643.js +0 -33
- package/dist/compaction-OKUNTCA7.cjs +0 -33
- package/dist/devtools-T2NIZBJK.cjs +0 -6
- package/dist/devtools-YXWHOVKR.js +0 -6
- package/dist/export-md-RXDW6F5W.cjs +0 -135
- package/dist/export-md-XXKZANW5.js +0 -135
- package/dist/file-history-KYPE3ECT.cjs +0 -7
- package/dist/file-history-LF4F7X26.js +0 -7
- package/dist/index.cjs +0 -347
- package/dist/manager-D65VFAPX.js +0 -7
- package/dist/manager-TTF5VHJC.cjs +0 -7
- package/dist/mcp-manager-QMKWPBZ4.js +0 -8
- package/dist/mcp-manager-Z3OKI74O.cjs +0 -8
- package/dist/memory-5LWZ6FI2.cjs +0 -9
- package/dist/memory-VIJLBAMQ.js +0 -9
- package/dist/model-cache-5KIYL5SL.js +0 -13
- package/dist/model-cache-OED3IM4R.cjs +0 -13
- package/dist/model-fetcher-HKGICACL.js +0 -8
- package/dist/model-fetcher-UR6WJOQP.cjs +0 -8
- package/dist/openai-JR2WEKOF.js +0 -10
- package/dist/openai-YBTOET4O.cjs +0 -10
- package/dist/openrouter-models-H56GHBHN.js +0 -15
- package/dist/openrouter-models-TWUFWZ5T.cjs +0 -15
- package/dist/openrouter-sync-5VMGN6C2.cjs +0 -11
- package/dist/openrouter-sync-ALEMF5IU.js +0 -11
- package/dist/product/index.cjs +0 -21
- package/dist/run/index.cjs +0 -48
- package/dist/session-manager-Q22BBMD3.js +0 -8
- package/dist/session-manager-XODQVL3C.cjs +0 -8
- package/dist/tool-summary-63DPIS7G.cjs +0 -31
- package/dist/tool-summary-NP5CDBKG.js +0 -31
- package/dist/updater-I7QBW4DP.cjs +0 -17
- package/dist/updater-NVME5S3Z.js +0 -17
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a as a$1,c,b as b$1}from'./chunk-P6JSTIFM.js';import {h,a}from'./chunk-3QP5BQ3L.js';import {existsSync,readFileSync}from'fs';import {fileURLToPath}from'url';import {dirname,join}from'path';h();h();var _=/(?:^|[-_/])(?:embed(?:ding)?|whisper|tts|audio|image|dall-?e|moderation|rerank|guard|vision-only|realtime|transcribe|search-preview|search-api|sora|computer-use|deep-research|codex|chat-latest)(?:$|[-_/])/i,N=a(e=>e.startsWith("ft:"),"isFineTunedId"),K=a(e=>/-\d{4}-\d{2}-\d{2}$/.test(e),"isDatedSnapshotId"),l=a(e=>!_.test(e)&&!N(e)&&!K(e),"isChatLike"),u=a(e=>e?{Authorization:`Bearer ${e}`}:{},"bearer"),f={openai:{label:"OpenAI",defaultBaseUrl:"https://api.openai.com/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},anthropic:{label:"Anthropic",defaultBaseUrl:"https://api.anthropic.com/v1",modelsPath:"/models",protocol:"anthropic-style",authHeader:a(e=>e?{"x-api-key":e,"anthropic-version":"2023-06-01"}:{"anthropic-version":"2023-06-01"},"authHeader"),chatFilter:l},deepseek:{label:"DeepSeek",defaultBaseUrl:"https://api.deepseek.com/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},zai:{label:"Z.AI (GLM)",defaultBaseUrl:"https://api.z.ai/api/paas/v4",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},xai:{label:"xAI (Grok)",defaultBaseUrl:"https://api.x.ai/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},mistral:{label:"Mistral",defaultBaseUrl:"https://api.mistral.ai/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},groq:{label:"Groq",defaultBaseUrl:"https://api.groq.com/openai/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},google:{label:"Google Gemini",defaultBaseUrl:"https://generativelanguage.googleapis.com/v1beta/openai",modelsPath:"https://generativelanguage.googleapis.com/v1beta/models",protocol:"gemini",authHeader:u,authQuery:a(e=>e?{key:e}:{},"authQuery"),chatFilter:a(e=>l(e)&&/gemini/i.test(e),"chatFilter")},openrouter:{label:"OpenRouter",defaultBaseUrl:"https://openrouter.ai/api/v1",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l},ollama:{label:"Ollama (local)",defaultBaseUrl:"http://localhost:11434",modelsPath:"/api/tags",protocol:"ollama",authHeader:a(()=>({}),"authHeader"),chatFilter:l},custom:{label:"Custom",defaultBaseUrl:"",modelsPath:"/models",protocol:"openai-compat",authHeader:u,chatFilter:l}};function O(e){return f[e]??f.custom}a(O,"getKindMeta");h();var L={fetchedAt:"2026-05-14",source:"https://api-docs.deepseek.com/quick_start/pricing",count:4,models:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",contextLength:1e6,maxOutputTokens:384e3,inputPricePerMillion:1.74,outputPricePerMillion:3.48,modalities:["text"],thinking:true},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",contextLength:1e6,maxOutputTokens:384e3,inputPricePerMillion:.14,outputPricePerMillion:.28,modalities:["text"],thinking:true},{id:"deepseek-chat",name:"DeepSeek Chat (legacy, deprecating)",contextLength:128e3,maxOutputTokens:8192,inputPricePerMillion:.14,outputPricePerMillion:.28,modalities:["text"]},{id:"deepseek-reasoner",name:"DeepSeek Reasoner (legacy, deprecating)",contextLength:128e3,maxOutputTokens:8192,inputPricePerMillion:.14,outputPricePerMillion:.28,modalities:["text"],thinking:true}]};var S={fetchedAt:"2026-05-14",source:"https://docs.z.ai/guides/llm/glm-5.1 + https://docs.z.ai/guides/overview/pricing",count:5,models:[{id:"glm-5.1",name:"GLM-5.1",contextLength:2e5,maxOutputTokens:128e3,inputPricePerMillion:1.4,outputPricePerMillion:4.4,modalities:["text"],thinking:true},{id:"glm-4.6",name:"GLM-4.6",contextLength:2e5,maxOutputTokens:128e3,inputPricePerMillion:.6,outputPricePerMillion:2.2,modalities:["text"],thinking:true},{id:"glm-4.5",name:"GLM-4.5",contextLength:128e3,maxOutputTokens:96e3,inputPricePerMillion:.6,outputPricePerMillion:2.2,modalities:["text"],thinking:true},{id:"glm-4.5-air",name:"GLM-4.5 Air",contextLength:128e3,maxOutputTokens:96e3,inputPricePerMillion:.2,outputPricePerMillion:1.1,modalities:["text"],thinking:true},{id:"glm-4.5-flash",name:"GLM-4.5 Flash (free tier)",contextLength:128e3,maxOutputTokens:96e3,inputPricePerMillion:0,outputPricePerMillion:0,modalities:["text"]}]};var v={fetchedAt:"2026-05-15",source:"OpenRouter model pages (openrouter.ai/openai/*) + developers.openai.com docs. OpenRouter mirrors OpenAI's published context/output limits per variant.",count:18,models:[{id:"gpt-5.5",name:"GPT-5.5",contextLength:922e3,maxOutputTokens:128e3,inputPricePerMillion:5,outputPricePerMillion:30,modalities:["text","image"],thinking:true},{id:"gpt-5.5-pro",name:"GPT-5.5 Pro",contextLength:922e3,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:180,modalities:["text","image"],thinking:true},{id:"gpt-5.4",name:"GPT-5.4",contextLength:922e3,maxOutputTokens:128e3,inputPricePerMillion:2.5,outputPricePerMillion:15,modalities:["text","image"],thinking:true},{id:"gpt-5.4-pro",name:"GPT-5.4 Pro",contextLength:922e3,maxOutputTokens:128e3,inputPricePerMillion:30,outputPricePerMillion:180,modalities:["text","image"],thinking:true},{id:"gpt-5.4-mini",name:"GPT-5.4 Mini",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.75,outputPricePerMillion:4.5,modalities:["text","image"],thinking:true},{id:"gpt-5.4-nano",name:"GPT-5.4 Nano",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.2,outputPricePerMillion:1.25,modalities:["text","image"],thinking:true},{id:"gpt-5.2",name:"GPT-5.2",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.75,outputPricePerMillion:14,modalities:["text","image"],thinking:true},{id:"gpt-5.2-pro",name:"GPT-5.2 Pro",contextLength:4e5,maxOutputTokens:128e3,modalities:["text","image"],thinking:true},{id:"gpt-5.1",name:"GPT-5.1",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image"],thinking:true},{id:"gpt-5",name:"GPT-5",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image"],thinking:true},{id:"gpt-5-pro",name:"GPT-5 Pro",contextLength:4e5,maxOutputTokens:128e3,modalities:["text","image"],thinking:true},{id:"gpt-5-mini",name:"GPT-5 Mini",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.25,outputPricePerMillion:2,modalities:["text","image"],thinking:true},{id:"gpt-5-nano",name:"GPT-5 Nano",contextLength:4e5,maxOutputTokens:128e3,inputPricePerMillion:.05,outputPricePerMillion:.4,modalities:["text","image"],thinking:true},{id:"gpt-4.1",name:"GPT-4.1",contextLength:1e6,maxOutputTokens:32768,modalities:["text","image"]},{id:"gpt-4.1-mini",name:"GPT-4.1 Mini",contextLength:1e6,maxOutputTokens:32768,modalities:["text","image"]},{id:"o3",name:"o3",contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:2,outputPricePerMillion:8,modalities:["text","image"],thinking:true},{id:"o3-pro",name:"o3-pro",contextLength:2e5,maxOutputTokens:1e5,modalities:["text","image"],thinking:true},{id:"o4-mini",name:"o4-mini",contextLength:2e5,maxOutputTokens:1e5,inputPricePerMillion:1.1,outputPricePerMillion:4.4,modalities:["text","image"],thinking:true}]};var b={fetchedAt:"2026-05-15",source:"https://ai.google.dev/gemini-api/docs/models + https://ai.google.dev/gemini-api/docs/gemini-3",count:6,models:[{id:"gemini-3.1-pro-preview",name:"Gemini 3.1 Pro (preview)",contextLength:1048576,maxOutputTokens:65536,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-3-pro-preview",name:"Gemini 3 Pro (preview)",contextLength:1048576,maxOutputTokens:65536,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-3.1-flash-lite",name:"Gemini 3.1 Flash-Lite",contextLength:1048576,maxOutputTokens:65536,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-3-flash-preview",name:"Gemini 3 Flash (preview)",contextLength:1048576,maxOutputTokens:65536,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-2.5-pro",name:"Gemini 2.5 Pro",contextLength:1048576,maxOutputTokens:65536,inputPricePerMillion:1.25,outputPricePerMillion:10,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-2.5-flash",name:"Gemini 2.5 Flash",contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.3,outputPricePerMillion:2.5,modalities:["text","image","audio","video"],thinking:true},{id:"gemini-2.5-flash-lite",name:"Gemini 2.5 Flash-Lite",contextLength:1e6,maxOutputTokens:65536,modalities:["text","image","audio","video"],thinking:true}]};var w={deepseek:L,zai:S,openai:v,google:b};function P(e){return w[e]?.models??[]}a(P,"listStaticModels");function x(e){return w[e]!==void 0}a(x,"hasStaticCatalog");var q=dirname(fileURLToPath(import.meta.url)),y=join(q,"..","data","openrouter-models.json");async function Me(e,i){let a=O(e.kind);if(!i.refresh){let n=a$1(i.cacheDir,e.key);if(n&&!c(n))return {...n,fromCache:true}}if(e.kind==="openrouter")return W(e.key,i.cacheDir);try{let n=e.modelsPath??a.modelsPath,t=new URL(Z(e.baseUrl,n)),s=a.authHeader(e.apiKey??"");if(a.authQuery){let p=a.authQuery(e.apiKey??"");for(let[A,C]of Object.entries(p))t.searchParams.set(A,C);}let o=await fetch(t.toString(),{headers:{Accept:"application/json",...s},signal:AbortSignal.timeout(i.timeoutMs??2e4)});if(!o.ok){let p=o.status===401||o.status===403;return d(e.key,i.cacheDir,`HTTP ${o.status}`,p?void 0:e.kind)}let m=await o.json(),R=V(m,a.protocol).filter(p=>a.chatFilter(p.id)),G=Q(R),F=J(e.kind,G);return b$1(i.cacheDir,e.key,F)}catch(n){let t=n.message||String(n);return d(e.key,i.cacheDir,t,e.kind)}}a(Me,"fetchModelList");function J(e,i){if(!x(e))return i;let a=P(e),n=new Map(a.map(o=>[o.id,o])),t=new Set(i.map(o=>o.id)),s=i.map(o=>{let m=n.get(o.id);return m?{id:o.id,contextLength:o.contextLength>0?o.contextLength:m.contextLength,maxOutputTokens:o.maxOutputTokens>0?o.maxOutputTokens:m.maxOutputTokens}:o});for(let o of a)t.has(o.id)||s.push({id:o.id,contextLength:o.contextLength,maxOutputTokens:o.maxOutputTokens});return s}a(J,"enrichFromStaticCatalog");function Q(e){let i=a(a=>{let n=a.match(/(?:^|[^\d])(\d+\.\d+)(?!\d)/);if(n)return Number(n[1]);let t=a.match(/(?:^|[^\d])(\d{1,2})-(\d{1,2})(?!\d)/);if(t)return +`${t[1]}.${t[2]}`;let s=a.match(/(?:^|[^\d])(\d{1,2})(?!\d)/);return s?Number(s[1]):-1},"versionOf");return [...e].sort((a,n)=>{let t=i(a.id),s=i(n.id);return t!==s?s-t:a.id.length!==n.id.length?a.id.length-n.id.length:a.id.localeCompare(n.id)})}a(Q,"sortByRecency");function V(e,i){switch(i){case "ollama":return (e.models??[]).map(t=>({id:t.name,contextLength:0,maxOutputTokens:0}));case "anthropic-style":return (e.data??[]).map(t=>({id:t.id,contextLength:t.context_window??2e5,maxOutputTokens:t.max_output_tokens??0}));case "gemini":return (e.models??[]).map(t=>({id:t.name.replace(/^models\//,""),contextLength:t.inputTokenLimit??0,maxOutputTokens:t.outputTokenLimit??0}));case "openai-compat":return (e.data??[]).map(t=>({id:t.id,contextLength:t.context_window??t.context_length??0,maxOutputTokens:t.max_completion_tokens??0}))}return i}a(V,"normalize");function W(e,i){if(!existsSync(y))return d(e,i,"openrouter snapshot missing");try{let n=(JSON.parse(readFileSync(y,"utf-8")).models??[]).map(t=>({id:t.id,contextLength:t.contextLength??0,maxOutputTokens:t.maxOutputTokens??0}));return b$1(i,e,n)}catch(a){return d(e,i,a.message)}}a(W,"loadOpenRouterSnapshot");function d(e,i,a,n){let t=a$1(i,e);if(t)return {...t,error:a,fromCache:true};if(n&&x(n)){let s=P(n).map(o=>({id:o.id,contextLength:o.contextLength,maxOutputTokens:o.maxOutputTokens}));return {fetchedAt:new Date().toISOString(),providerKey:e,models:s,error:a}}return {fetchedAt:new Date().toISOString(),providerKey:e,models:[],error:a}}a(d,"errorResult");function Z(e,i){return !e||/^https?:\/\//i.test(i)?i:`${e.replace(/\/$/,"")}${i.startsWith("/")?"":"/"}${i}`}a(Z,"joinUrl");
|
|
2
|
+
export{f as a,Me as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import _ from'path';import {fileURLToPath}from'url';var r=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var i=(t,e)=>r(t,"name",{value:e,configurable:true}),x=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var l=(t,e)=>()=>(t&&(e=t(t=0)),e);var u=(t,e)=>{for(var o in e)r(t,o,{get:e[o],enumerable:true});},s=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!f.call(t,m)&&m!==o&&r(t,m,{get:()=>e[m],enumerable:!(n=p(e,m))||n.enumerable});return t};var D=t=>s(r({},"__esModule",{value:true}),t);var a,g,R,T,h=l(()=>{a=i(()=>fileURLToPath(import.meta.url),"getFilename"),g=i(()=>_.dirname(a()),"getDirname"),R=g(),T=a();});export{i as a,x as b,l as c,u as d,D as e,R as f,T as g,h};
|
|
@@ -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-15T07:55:00.832Z",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","file"]},{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:.73,outputPricePerMillion:3.49,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:.3,outputPricePerMillion:1.7999999999999998,modalities:["text","image","video"]},{id:"qwen/qwen3.6-flash",name:"Qwen: Qwen3.6 Flash",created:1777261362,contextLength:1e6,maxOutputTokens:65536,inputPricePerMillion:.1875,outputPricePerMillion:1.125,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:1048576,maxOutputTokens:384e3,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:.01,outputPricePerMillion:.03,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",name:"Baidu: Qianfan-OCR-Fast",created:1776707472,contextLength:65536,maxOutputTokens:28672,inputPricePerMillion:.6799999999999999,outputPricePerMillion:2.81,modalities:["image","text"]},{id:"moonshotai/kimi-k2.6",name:"MoonshotAI: Kimi K2.6",created:1776699402,contextLength:262142,maxOutputTokens:262142,inputPricePerMillion:.73,outputPricePerMillion:3.49,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:0,inputPricePerMillion:.98,outputPricePerMillion:3.08,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","file"]},{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","file"]},{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","file"]},{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","file"]},{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","file"]},{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","file"]},{id:"mistralai/devstral-small",name:"Mistral: Devstral Small 1.1",created:1752160751,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.09999999999999999,outputPricePerMillion:.3,modalities:["text","file"]},{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","file"]},{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:.09999999999999999,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","file"]},{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","file"]},{id:"mistralai/mistral-large-2407",name:"Mistral Large 2407",created:1731978415,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text","file"]},{id:"mistralai/pixtral-large-2411",name:"Mistral: Pixtral Large 2411",created:1731977388,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:2,outputPricePerMillion:6,modalities:["text","image","file"]},{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-productivity",name:"Inflection: Inflection 3 Productivity",created:1728604800,contextLength:8e3,maxOutputTokens:1024,inputPricePerMillion:2.5,outputPricePerMillion:10,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:"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-70b-instruct",name:"Meta: Llama 3.1 70B Instruct",created:1721692800,contextLength:131072,maxOutputTokens:16384,inputPricePerMillion:.39999999999999997,outputPricePerMillion:.39999999999999997,modalities:["text"]},{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:"mistralai/mistral-nemo",name:"Mistral: Mistral Nemo",created:1721347200,contextLength:131072,maxOutputTokens:0,inputPricePerMillion:.02,outputPricePerMillion:.03,modalities:["text"]},{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:"openai/gpt-4o-mini",name:"OpenAI: GPT-4o-mini",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","file"]},{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","file"]},{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-0314",name:"OpenAI: GPT-4 (older v0314)",created:1685232e3,contextLength:8191,maxOutputTokens:4096,inputPricePerMillion:30,outputPricePerMillion:60,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-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 {a as a$2}from'./chunk-O5HFCH2U.js';import {a}from'./chunk-2EUIMKJA.js';import {c,d,b as b$1}from'./chunk-FU7AHZNN.js';import {b}from'./chunk-ZSAONDT6.js';import {h,a as a$1}from'./chunk-3QP5BQ3L.js';import M from'@anthropic-ai/sdk';h();var C=class extends a{static{a$1(this,"AnthropicClient");}_client=null;constructor(e){super(e);}initClient(){}get client(){return this._client||(this._client=new M({apiKey:this.config.apiKey??process.env.ANTHROPIC_API_KEY,...this.config.baseUrl?{baseURL:this.config.baseUrl}:{},timeout:this.timeout})),this._client}async createMessage(e){return this.withRetry(async()=>{let a=this.buildMessages(e.messages),n=e.tools?this.convertTools(e.tools):void 0,s=b.span("llm.request",{cat:"llm",provider:this.provider,model:this.model,stream:!!(e.stream&&e.onChunk),messageCount:a.length,toolCount:n?.length??0});try{let t=e.stream&&e.onChunk?await this.streamMessage(e,a,n):await this.nonStreamMessage(e,a,n);return s.end({stopReason:t.stopReason,promptTokens:t.usage?.promptTokens,completionTokens:t.usage?.completionTokens,cacheReadTokens:t.usage?.cacheReadTokens,cacheCreationTokens:t.usage?.cacheCreationTokens}),t}catch(t){throw s.fail(t),t}})}async nonStreamMessage(e,a,n){try{let s=await this.client.messages.create({model:this.model,max_tokens:e.maxTokens??this.maxTokens,system:[{type:"text",text:e.systemPrompt,cache_control:{type:"ephemeral"}}],messages:a,...n?.length?{tools:n}:{},...e.temperature!==void 0?{temperature:e.temperature}:{temperature:this.temperature}},{signal:e.signal}),t={promptTokens:s.usage.input_tokens,completionTokens:s.usage.output_tokens,totalTokens:s.usage.input_tokens+s.usage.output_tokens,cacheReadTokens:s.usage.cache_read_input_tokens,cacheCreationTokens:s.usage.cache_creation_input_tokens};return this.recordUsage(t,e),this.processResponse(s,t)}catch(s){throw this.handleApiError(s),s}}async streamMessage(e,a,n){try{let s=this.client.messages.stream({model:this.model,max_tokens:e.maxTokens??this.maxTokens,system:[{type:"text",text:e.systemPrompt,cache_control:{type:"ephemeral"}}],messages:a,...n?.length?{tools:n}:{},...e.temperature!==void 0?{temperature:e.temperature}:{temperature:this.temperature}},{signal:e.signal}),t="",o="",c="",l="",x=Date.now(),u=!1;s.on("text",r=>{u||(u=!0,b.debug("llm.first_byte",{cat:"llm",provider:this.provider,model:this.model,ttft_ms:Date.now()-x})),t+=r,e.onChunk?.({type:"text",text:r,tokens:a$2(r)});}),s.on("contentBlock",r=>{r.type==="tool_use"&&(o=r.name,c=r.id,l="",e.onChunk?.({type:"tool_use_start",toolCall:{id:r.id,toolName:r.name,args:{}}}));}),s.on("inputJson",(r,h)=>{l=JSON.stringify(h),c&&e.onChunk?.({type:"tool_use_delta",toolCall:{id:c,toolName:o,args:h??{}}});});let i=await s.finalMessage(),m={promptTokens:i.usage.input_tokens,completionTokens:i.usage.output_tokens,totalTokens:i.usage.input_tokens+i.usage.output_tokens,cacheReadTokens:i.usage.cache_read_input_tokens,cacheCreationTokens:i.usage.cache_creation_input_tokens};return this.recordUsage(m,e),e.onChunk?.({type:"stop",stopReason:i.stop_reason??void 0}),this.processResponse(i,m)}catch(s){throw this.handleApiError(s),s}}processResponse(e,a){let n="",s=[];for(let t of e.content)t.type==="text"?n+=t.text:t.type==="tool_use"&&s.push({id:t.id,toolName:t.name,args:t.input??{}});return {text:n,toolCalls:s,usage:a,stopReason:e.stop_reason??void 0}}buildMessages(e){let a=[];for(let n of e){if(n.role==="system")continue;let s=n.role==="tool"?"user":n.role;if(typeof n.content=="string")a.push({role:s,content:n.content});else {let t=[];for(let o of n.content)o.type==="text"&&o.text?t.push({type:"text",text:o.text}):o.type==="tool_use"&&o.id&&o.name&&o.input?t.push({type:"tool_use",id:o.id,name:o.name,input:o.input}):o.type==="tool_result"&&o.tool_use_id?t.push({type:"tool_result",tool_use_id:o.tool_use_id,content:typeof o.content=="string"?o.content:""}):o.type==="image"&&o.source&&t.push({type:"image",source:{type:"base64",media_type:o.source.media_type,data:o.source.data}});t.length>0&&a.push({role:s,content:t});}}return a}convertTools(e){return e.map(a=>({name:a.name,description:a.description,input_schema:a.inputSchema}))}handleApiError(e){throw e instanceof M.APIError?e.status===429?new c("anthropic"):e.message?.includes("prompt is too long")||e.message?.includes("context_length_exceeded")?new d("anthropic"):new b$1(`Anthropic API error: ${e.message}`,"anthropic",{status:e.status}):e}};export{C as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {h,a}from'./chunk-3QP5BQ3L.js';import {existsSync,readFileSync,copyFileSync,writeFileSync,mkdirSync,renameSync}from'fs';import {join,dirname}from'path';import {homedir}from'os';import {z}from'zod';h();h();var C=z.object({agent:z.object({preset:z.string().default("terminal-coding"),enabledBuiltinTools:z.array(z.string()).default([]),disabledBuiltinTools:z.array(z.string()).default([]),customSystemPrompt:z.string().optional(),appendSystemPrompt:z.string().optional()}).default({}),activeKey:z.string().optional(),autoUpdates:z.boolean().default(true),model:z.object({provider:z.string().default("openai"),name:z.string().default("anthropic/claude-opus-4-6"),apiKey:z.string().optional(),baseUrl:z.string().default("https://openrouter.ai/api/v1"),temperature:z.number().min(0).max(2).default(.3),maxTokens:z.number().default(8192)}).default({}),providers:z.array(z.object({key:z.string(),label:z.string().optional(),kind:z.enum(["openai","anthropic","deepseek","zai","xai","mistral","groq","google","openrouter","ollama","custom"]),baseUrl:z.string(),apiKey:z.string().optional(),protocol:z.enum(["openai-compat","anthropic-style"]).optional(),modelsPath:z.string().optional(),thinking:z.enum(["enabled","disabled"]).optional()})).default([]),models:z.array(z.object({key:z.string(),label:z.string().optional(),providerKey:z.string().optional(),model:z.string(),maxOutputTokens:z.number().optional(),maxContextTokens:z.number().optional(),protocol:z.string().optional(),provider:z.string().optional(),baseUrl:z.string().optional(),apiKey:z.string().optional(),thinking:z.enum(["enabled","disabled"]).optional()}).transform(r=>{let o=r.protocol??r.provider;return {...r,protocol:o,provider:o}})).default([]),permissions:z.object({defaultMode:z.enum(["default","acceptEdits","dontAsk","bypassPermissions","auto","plan"]).default("default"),rules:z.array(z.object({tool:z.string(),argsPattern:z.record(z.string()).optional(),decision:z.enum(["allow","deny","ask"]),reason:z.string().optional()})).default([])}).default({}),context:z.object({maxTokens:z.number().default(2e5),compactAtRatio:z.number().default(.6),summarizeAtRatio:z.number().default(.8)}).default({}),session:z.object({storageDir:z.string().optional(),maxHistory:z.number().default(100)}).default({}),mcpServers:z.record(z.object({name:z.string(),command:z.string().optional(),args:z.array(z.string()).optional(),env:z.record(z.string()).optional(),url:z.string().optional(),transport:z.enum(["stdio","sse","streamable-http","inprocess"]).optional(),headers:z.record(z.string()).optional()})).default({}),instructions:z.object({fileName:z.string().default("CODESHELL.md"),scanDirs:z.array(z.string()).default([]),compatFileNames:z.array(z.string()).default(["CLAUDE.md","AGENTS.md"]),ignoreGitBoundary:z.boolean().default(false)}).default({}),arena:z.object({participants:z.array(z.union([z.string(),z.object({name:z.string(),model:z.string(),provider:z.string().optional(),apiKey:z.string().optional(),baseUrl:z.string().optional()})])).default([])}).default({}),search:z.object({provider:z.enum(["serper","tavily","searxng"]).default("serper"),apiKey:z.string().optional(),baseUrl:z.string().optional()}).default({}),output:z.object({format:z.enum(["text","json","jsonl","stream-json"]).default("text")}).default({}),sandbox:z.object({mode:z.enum(["off","auto","seatbelt","bwrap"]).optional(),writableRoots:z.array(z.string()).optional(),deniedReads:z.array(z.string()).optional(),network:z.enum(["allow","deny"]).optional()}).optional()}).passthrough();function x(r){return C.parse(r)}a(x,"validateSettings");h();var N=[[/deepseek\.com/i,"deepseek"],[/z\.ai/i,"zai"],[/anthropic\.com/i,"anthropic"],[/openai\.com/i,"openai"],[/x\.ai/i,"xai"],[/mistral\.ai/i,"mistral"],[/groq\.com/i,"groq"],[/generativelanguage\.googleapis/i,"google"],[/openrouter\.ai/i,"openrouter"],[/localhost:11434|127\.0\.0\.1:11434/i,"ollama"]];function S(r){if(!r)return "custom";for(let[o,n]of N)if(o.test(r))return n;return "custom"}a(S,"inferKind");function M(r){return `${r.provider??""}|${r.baseUrl??""}|${r.apiKey??""}`}a(M,"makeFingerprint");function L(r,o){if(!o.has(r))return r;for(let n=2;;n++){let s=`${r}-${n}`;if(!o.has(s))return s}}a(L,"deriveKey");function T(r,o,n){let s=o.lastIndexOf("/"),i=s>=0?o.slice(s+1):o,a=r.toLowerCase(),l=i.toLowerCase().startsWith(`${a}-`)?i:`${a}-${i}`;if(!n.has(l))return l;for(let d=2;;d++){let c=`${l}-${d}`;if(!n.has(c))return c}}a(T,"deriveProviderModelKey");function R(r){if(r.models.length===0)return {providers:r.providers,models:[],changed:false};let o=r.providers.length>0,n=new Map;for(let t of r.models)n.set(t.key,(n.get(t.key)??0)+1);if(!r.models.some(t=>!t.providerKey||(n.get(t.key)??0)>1))return {providers:r.providers,models:r.models.map(t=>({key:t.key,label:t.label,providerKey:t.providerKey??"",model:t.model,maxOutputTokens:t.maxOutputTokens,maxContextTokens:t.maxContextTokens,provider:t.provider,baseUrl:t.baseUrl,apiKey:t.apiKey})),changed:false};let i=new Map,a=[],l=new Set(r.providers.map(t=>t.key));for(let t of r.providers){let g=`|${t.baseUrl}|${t.apiKey??""}`;i.set(g,t.key);}for(let t of r.models){let g=M(t),h=r.providers.find(O=>O.baseUrl===(t.baseUrl??""));if(h){i.set(g,h.key);continue}if(i.has(g))continue;let m=S(t.baseUrl),f=L(m,l);l.add(f),i.set(g,f),a.push({key:f,kind:m,baseUrl:t.baseUrl??"",apiKey:t.apiKey});}let d=new Set,c=r.models.map(t=>{let g=i.get(M(t)),h=(n.get(t.key)??0)>1,m=t.key;if(h){let f=S(t.baseUrl);m=T(f,t.model,d);}if(d.has(m)){let f=S(t.baseUrl);m=T(f,t.model,d);}return d.add(m),{key:m,label:t.label,providerKey:g,provider:t.provider,model:t.model,baseUrl:t.baseUrl,apiKey:t.apiKey,maxOutputTokens:t.maxOutputTokens,maxContextTokens:t.maxContextTokens}}),p=new Set,v=c.filter(t=>{let g=`${t.key}|${t.model}`;return p.has(g)?false:(p.add(g),true)});return {providers:o?[...r.providers,...a]:a,models:v,changed:true}}a(R,"migrateModels");function k(){return process.env.HOME??homedir()}a(k,"userHome");var P=class{constructor(o=process.cwd()){this.cwd=o;}static{a(this,"SettingsManager");}sources=[];merged=null;load(o){this.sources=[],this.loadJsonFile(join(k(),".code-shell","settings.managed.json"),"managed",0),this.loadJsonFile(join(k(),".code-shell","settings.json"),"user",1),this.loadJsonFile(join(this.cwd,".code-shell","settings.json"),"project",2),this.loadJsonFile(join(this.cwd,".code-shell","settings.local.json"),"local",3),o&&Object.keys(o).length>0&&this.sources.push({name:"flag",priority:4,data:o}),this.sources.sort((i,a)=>i.priority-a.priority);let n=this.deepMerge(),s=join(k(),".code-shell","settings.json");if(existsSync(s))try{let i=JSON.parse(readFileSync(s,"utf-8")),a=R({providers:i.providers??[],models:i.models??[]});if(a.changed){copyFileSync(s,`${s}.bak`);let l={...i,providers:a.providers,models:a.models};writeFileSync(s,JSON.stringify(l,null,2),"utf-8");let d=this.sources.find(p=>p.name==="user");d&&(d.data=l);let c=this.deepMerge();return this.merged=x(c),this.merged}}catch{}return this.merged=x(n),this.merged}get(){return this.merged?this.merged:this.load()}invalidate(){this.merged=null;}saveUserSetting(o,n){let s=join(k(),".code-shell","settings.json"),i={};if(existsSync(s))try{let c=readFileSync(s,"utf-8"),p=JSON.parse(c);p&&typeof p=="object"&&!Array.isArray(p)&&(i=p);}catch{}let a=o.split("."),l=i;for(let c=0;c<a.length-1;c++){let p=a[c],v=l[p];(!v||typeof v!="object"||Array.isArray(v))&&(l[p]={}),l=l[p];}l[a[a.length-1]]=n,mkdirSync(dirname(s),{recursive:true});let d=`${s}.${process.pid}.${Date.now()}.tmp`;writeFileSync(d,JSON.stringify(i,null,2),"utf-8"),renameSync(d,s),this.invalidate();}loadJsonFile(o,n,s){if(existsSync(o))try{let i=readFileSync(o,"utf-8"),a=JSON.parse(i);typeof a=="object"&&a!==null&&this.sources.push({name:n,priority:s,data:a});}catch{}}deepMerge(){let o={};for(let n of this.sources)o=A(o,n.data);return o}};function A(r,o){let n={...r};for(let[s,i]of Object.entries(o))i===null?delete n[s]:typeof i=="object"&&!Array.isArray(i)&&typeof n[s]=="object"&&!Array.isArray(n[s])&&n[s]!==null?n[s]=A(n[s],i):n[s]=i;return n}a(A,"merge");
|
|
2
|
+
export{C as a,x as b,P as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {W,fa}from'./chunk-MGP35GKD.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 W(o);return new fa({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 as h$1,a as a$1}from'./chunk-3QP5BQ3L.js';h$1();var e=class extends Error{constructor(s,o){super(s);this.details=o;this.name="FrameworkError";}static{a$1(this,"FrameworkError");}},i=class extends e{constructor(s,o,u){super(s,u);this.provider=o;this.name="LLMError";}static{a$1(this,"LLMError");}},p=class extends i{constructor(s,o){super(`Rate limit exceeded for ${s}`,s,{retryAfter:o});this.retryAfter=o;this.name="LLMRateLimitError";}static{a$1(this,"LLMRateLimitError");}},x=class extends i{static{a$1(this,"ContextLimitError");}constructor(t){super("Context limit exceeded",t),this.name="ContextLimitError";}},c=class extends e{constructor(s,o,u){super(s,u);this.toolName=o;this.name="ToolError";}static{a$1(this,"ToolError");}},a=class extends c{static{a$1(this,"ToolNotFoundError");}constructor(t){super(`Tool not found: ${t}`,t),this.name="ToolNotFoundError";}},l=class extends c{static{a$1(this,"ToolExecutionError");}constructor(t,s){super(`Tool execution failed: ${t} - ${s}`,t,{cause:s}),this.name="ToolExecutionError";}},g=class extends c{constructor(s,o){super(`Tool timed out after ${o}ms: ${s}`,s,{timeoutMs:o});this.timeoutMs=o;this.name="ToolTimeoutError";}static{a$1(this,"ToolTimeoutError");}},m=class extends e{static{a$1(this,"PermissionDeniedError");}constructor(t,s){super(`Permission denied for tool: ${t}${s?` - ${s}`:""}`,{toolName:t,reason:s}),this.name="PermissionDeniedError";}},h=class extends e{static{a$1(this,"SessionError");}constructor(t,s){super(t,s),this.name="SessionError";}},$=class extends e{static{a$1(this,"TranscriptError");}constructor(t,s){super(t,s),this.name="TranscriptError";}},b=class extends e{static{a$1(this,"ConfigError");}constructor(t,s){super(t,s),this.name="ConfigError";}};export{e as a,i as b,p as c,x as d,c as e,a as f,l as g,g as h,m as i,h as j,$ as k,b as l};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {b}from'./chunk-ZSAONDT6.js';import {h,a}from'./chunk-3QP5BQ3L.js';import {Client}from'@modelcontextprotocol/sdk/client/index.js';import {StdioClientTransport}from'@modelcontextprotocol/sdk/client/stdio.js';import {StreamableHTTPClientTransport}from'@modelcontextprotocol/sdk/client/streamableHttp.js';h();var m=class p{constructor(t){this.toolRegistry=t;p.instance=this;}static{a(this,"MCPManager");}static instance=null;connections=new Map;static getInstance(){if(!p.instance)throw new Error("MCPManager not initialized. Connect to servers first.");return p.instance}async connectAll(t){let e=Object.entries(t);if(e.length===0)return;let s=await Promise.allSettled(e.map(([r,n])=>this.connect(r,n)));for(let r=0;r<s.length;r++){let n=s[r];n.status==="rejected"&&b.warn("mcp.connect_failed",{server:e[r][0],error:n.reason.message});}}async connect(t,e){if(this.connections.has(t)){b.info("mcp.already_connected",{server:t});return}b.info("mcp.connecting",{server:t,transport:e.transport??"stdio"});let s=new Client({name:"code-shell",version:"0.1.0"},{capabilities:{}}),r,n=e.transport??"stdio";if(n==="stdio"){if(!e.command)throw new Error(`MCP server "${t}": command is required for stdio transport`);r=new StdioClientTransport({command:e.command,args:e.args,env:e.env?{...process.env,...e.env}:void 0});}else if(n==="streamable-http"||n==="sse"){if(!e.url)throw new Error(`MCP server "${t}": url is required for ${n} transport`);r=new StreamableHTTPClientTransport(new URL(e.url),{requestInit:e.headers?{headers:e.headers}:void 0});}else throw new Error(`MCP server "${t}": unsupported transport "${n}"`);let i=15e3,o;try{await new Promise((l,c)=>{o=setTimeout(()=>{c(new Error(`MCP server "${t}" connect timed out after ${i}ms`));},i),s.connect(r).then(()=>l(),f=>c(f));});}catch(l){try{await r.close?.();}catch{}throw l}finally{o&&clearTimeout(o);}this.connections.set(t,{client:s,serverName:t,transport:r}),await this.discoverTools(t,s),b.info("mcp.connected",{server:t});}async discoverTools(t,e){let s=await e.listTools();for(let r of s.tools){let n={name:`mcp_${t}_${r.name}`,description:`[${t}] ${r.description??r.name}`,inputSchema:r.inputSchema??{type:"object",properties:{}},source:"mcp",serverName:t,permissionDefault:"ask",isConcurrencySafe:true,isReadOnly:false};this.toolRegistry.registerTool(n,async i=>{let o=await e.callTool({name:r.name,arguments:i}),l=[];if(Array.isArray(o.content))for(let c of o.content)typeof c=="object"&&c!==null&&"text"in c?l.push(String(c.text)):typeof c=="string"&&l.push(c);return l.join(`
|
|
2
|
+
`)||"(no output)"}),b.info("mcp.tool_registered",{server:t,tool:n.name});}}async disconnectAll(){for(let[t,e]of this.connections)try{await e.client.close(),b.info("mcp.disconnected",{server:t});}catch(s){b.warn("mcp.disconnect_error",{server:t,error:s.message});}this.connections.clear();}listServers(){return [...this.connections.keys()]}async callTool(t,e,s){let r=this.connections.get(t);if(!r)throw new Error(`MCP server "${t}" is not connected.`);let n=await r.client.callTool({name:e,arguments:s}),i=[];if(Array.isArray(n.content))for(let o of n.content)typeof o=="object"&&o!==null&&"text"in o?i.push(String(o.text)):typeof o=="string"&&i.push(o);return i.join(`
|
|
3
|
+
`)||"(no output)"}async listResources(t){let e=[],s=t?[t]:[...this.connections.keys()];for(let r of s){let n=this.connections.get(r);if(n)try{let i=await n.client.listResources();for(let o of i.resources)e.push({uri:o.uri,name:o.name??o.uri,description:o.description});}catch{}}return e}async readResource(t,e){let s=this.connections.get(t);if(!s)throw new Error(`MCP server "${t}" is not connected.`);let r=await s.client.readResource({uri:e}),n=[];if(Array.isArray(r.contents))for(let i of r.contents)typeof i=="object"&&i!==null&&"text"in i&&n.push(String(i.text));return n.join(`
|
|
4
|
+
`)||"(no content)"}};export{m as a};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import {c,h,a,d}from'./chunk-3QP5BQ3L.js';function M(e){if(!e)return 0;let n=(e.match(/[\u4e00-\u9fff\u3040-\u309f\u30a0-\u30ff\uac00-\ud7af]/g)??[]).length;if(n/e.length>.3){let s=n/y.cjk,h=(e.length-n)/y.english;return Math.ceil(s+h)}return ["{","}","(",")",";","=>","import ","function ","class ","const "].reduce((s,i)=>s+(e.includes(i)?1:0),0)>=3?Math.ceil(e.length/y.code):e.startsWith("{")||e.startsWith("[")?Math.ceil(e.length/y.json):Math.ceil(e.length/y.english)}function S(e){let n=0;for(let t of e)if(n+=4,typeof t.content=="string")n+=M(t.content);else if(Array.isArray(t.content))for(let o of t.content)n+=j(o);return n}function j(e){let n=2;return e.text&&(n+=M(e.text)),e.content&&typeof e.content=="string"&&(n+=M(e.content)),e.input&&(n+=M(JSON.stringify(e.input))),e.name&&(n+=M(e.name)),n}var y,T=c(()=>{h();y={english:4,code:3.2,json:3.5,mixed:3.6,cjk:1.5};a(M,"estimateStringTokens");a(S,"estimateMessagesTokens");a(j,"estimateBlockTokens");});var K={};d(K,{COMPACTABLE_TOOL_NAMES:()=>R,adjustIndexToPreserveAPIInvariants:()=>w,applySummaryCompaction:()=>D,applyToolResultBudget:()=>L,buildSummarizationPrompt:()=>G,dropOldestRounds:()=>J,estimateTokens:()=>N,extractAnchoredSummary:()=>q,extractReferencedFilePaths:()=>C,groupMessagesByApiRound:()=>k,microcompact:()=>U,snipCompact:()=>z,truncateToolResult:()=>F,windowCompact:()=>I});function N(e){return Math.ceil(S(e)*(4/3))}function w(e,n){let t=n,o=new Set;for(let r=t;r<e.length;r++){let s=e[r];if(Array.isArray(s.content))for(let i of s.content)i.type==="tool_result"&&i.tool_use_id&&o.add(i.tool_use_id);}for(let r=t;r<e.length;r++){let s=e[r];if(Array.isArray(s.content))for(let i of s.content)i.type==="tool_use"&&i.id&&o.delete(i.id);}if(o.size===0)return t;for(let r=t-1;r>=0&&o.size>0;r--){let s=e[r];if(!(s.role!=="assistant"||!Array.isArray(s.content)))for(let i of s.content)i.type==="tool_use"&&i.id&&o.has(i.id)&&(o.delete(i.id),r<t&&(t=r));}return t}function z(e,n=3,t=8){if(e.length<=n+t+1)return e;let o=e.length-t;if(o=w(e,o),o<=n)return e;let s={role:"user",content:`<system-reminder>[${o-n} messages snipped to save context. Use the transcript file to review details if needed.]</system-reminder>`};return [...e.slice(0,n),s,...e.slice(o)]}function I(e,n){if(e.length<=n+1)return e;let t=e.length-n;return t=w(e,t),t<=1?e:[e[0],...e.slice(t)]}function W(e){let n=new Map;for(let t of e)if(Array.isArray(t.content))for(let o of t.content)o.type==="tool_use"&&o.id&&o.name&&n.set(o.id,o.name);return n}function B(e,n){if(!n||typeof n!="object")return "";let t=a(o=>{let r=[];for(let s of o){let i=n[s];typeof i=="string"&&i.length>0&&r.push(`${s}=${i.length>80?i.slice(0,77)+"...":i}`);}return r.join(" ")},"pick");switch(e){case "Read":case "Write":case "Edit":case "NotebookEdit":return t(["file_path","path","notebook_path"]);case "Glob":case "Grep":return t(["pattern","path","glob"]);case "Bash":case "PowerShell":case "REPL":return t(["command"]);case "WebFetch":case "WebSearch":return t(["url","query"]);default:{let o=JSON.stringify(n);return o.length>100?o.slice(0,97)+"...":o}}}function U(e,n={}){let t=n.keepRecentN??5,o=n.compactableTools??R,r=W(e),s=new Map;for(let l of e)if(Array.isArray(l.content))for(let g of l.content)g.type==="tool_use"&&g.id&&s.set(g.id,g.input);let i=0,h=[];for(let l=e.length-1;l>=0;l--){let g=e[l];!Array.isArray(g.content)||!g.content.some(d=>d.type==="tool_result"&&d.tool_use_id!=null&&o.has(r.get(d.tool_use_id)??"")&&typeof d.content=="string"&&!d.content.startsWith("[Old tool result cleared"))||(i++,i>t&&h.push(l));}if(h.length===0)return e;let a=new Set(h),u=new Set,p=0,m=e.map((l,g)=>!a.has(g)||!Array.isArray(l.content)?l:{...l,content:l.content.map(f=>{if(f.type!=="tool_result"||!f.tool_use_id)return f;let d=r.get(f.tool_use_id);if(!d||!o.has(d)||typeof f.content!="string"||f.content.startsWith("[Old tool result cleared"))return f;let A=B(d,s.get(f.tool_use_id)),O=A?`[Old tool result cleared \u2014 ${d} ${A}]`:`[Old tool result cleared \u2014 ${d}]`;return u.add(d),p++,{...f,content:O}})});return p>0&&n.onClear?.({clearedRounds:h.length,toolNames:[...u].sort()}),m}function L(e,n=1e5){return e.map(t=>{if(!Array.isArray(t.content))return t;let o=[],r=0;for(let a=0;a<t.content.length;a++){let u=t.content[a];if(u.type==="tool_result"&&typeof u.content=="string"){let p=u.content.length;o.push({index:a,size:p}),r+=p;}}if(r<=n||o.length===0)return t;o.sort((a,u)=>u.size-a.size);let s=r,i=new Set;for(let a of o){if(s<=n)break;i.add(a.index),s-=a.size,s+=200;}if(i.size===0)return t;let h=t.content.map((a,u)=>{if(!i.has(u))return a;let p=typeof a.content=="string"?a.content.slice(0,500):"",m=(a.content.length/1e3).toFixed(0);return {...a,content:`Output too large (${m}KB) \u2014 truncated to fit the per-message budget. Re-run the originating tool if you need the full output.
|
|
2
|
+
|
|
3
|
+
Preview (first 500 chars):
|
|
4
|
+
${p}`}});return {...t,content:h}})}function F(e,n=3e4){if(e.length<=n)return e;let t=Math.floor(n*.7),o=Math.floor(n*.2),r=e.slice(0,t),s=e.slice(-o);return r+`
|
|
5
|
+
|
|
6
|
+
... [${e.length-t-o} characters truncated] ...
|
|
7
|
+
|
|
8
|
+
`+s}function G(e,n){let t=[];for(let r of e)if(typeof r.content=="string")t.push(`[${r.role}]: ${r.content.slice(0,3e3)}`);else for(let s of r.content)if(s.type==="text"&&s.text)t.push(`[${r.role}]: ${s.text.slice(0,3e3)}`);else if(s.type==="tool_use"){let i=JSON.stringify(s.input).slice(0,500);t.push(`[tool_use]: ${s.name}(${i})`);}else if(s.type==="tool_result"){let i=typeof s.content=="string"?s.content:"";t.push(`[tool_result]: ${i.slice(0,1500)}`);}let o=`1. **Primary Request**: What the user originally asked for
|
|
9
|
+
2. **Key Concepts**: Important technical terms, patterns, file paths
|
|
10
|
+
3. **Files Referenced**: List of files read/edited with key content
|
|
11
|
+
4. **Errors & Fixes**: Any errors encountered and how they were resolved
|
|
12
|
+
5. **Actions Taken**: Tools used and their outcomes
|
|
13
|
+
6. **User Messages**: All distinct user requests (verbatim if short)
|
|
14
|
+
7. **Pending Tasks**: Anything started but not finished
|
|
15
|
+
8. **Current State**: Where things stand right now
|
|
16
|
+
9. **Next Steps**: What should happen next
|
|
17
|
+
`;return n?`You are updating an anchored conversation summary. A prior summary is shown first, followed by NEW conversation that occurred after that summary was produced. Produce an UPDATED summary that:
|
|
18
|
+
- Preserves every critical fact from the prior summary (file paths, decisions, the user's original intent, errors that were fixed)
|
|
19
|
+
- Merges in new facts from the new conversation
|
|
20
|
+
- Resolves contradictions in favor of the newer information
|
|
21
|
+
- Stays in the same 9-section structure below
|
|
22
|
+
- Is factual; preserves file paths, function names, and error messages exactly
|
|
23
|
+
|
|
24
|
+
`+o+`
|
|
25
|
+
=== Prior summary ===
|
|
26
|
+
`+n+`
|
|
27
|
+
|
|
28
|
+
=== New conversation ===
|
|
29
|
+
|
|
30
|
+
`+t.join(`
|
|
31
|
+
`):`Summarize the following conversation into these sections. Be factual. Preserve file paths, function names, and error messages exactly.
|
|
32
|
+
|
|
33
|
+
`+o+`
|
|
34
|
+
Conversation:
|
|
35
|
+
|
|
36
|
+
`+t.join(`
|
|
37
|
+
`)}function q(e){for(let n=e.length-1;n>=0;n--){let t=e[n],o=typeof t.content=="string"?t.content:"";if(!o)continue;let r=o.indexOf(x);if(r<0)continue;let s=o.indexOf(v,r+x.length);if(!(s<=r))return o.slice(r+x.length,s).trim()}}function D(e,n,t,o){if(e.length<=t+2)return e;let r=e.length-t;if(r=w(e,r),r<=1)return e;let s=e[0],i=e.slice(1,r),h=e.slice(r),a=C(i),u=`This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier portion of the conversation.
|
|
38
|
+
|
|
39
|
+
${x}
|
|
40
|
+
${n}
|
|
41
|
+
${v}`;o&&(u+=`
|
|
42
|
+
|
|
43
|
+
If you need specific details from before compaction (like exact code snippets, error messages, or content you generated), read the full transcript at: ${o}`),a.length>0&&(u+=`
|
|
44
|
+
|
|
45
|
+
Files referenced before compaction (use Read tool if you need their current content):
|
|
46
|
+
`+a.map(m=>`- ${m}`).join(`
|
|
47
|
+
`)),u+=`
|
|
48
|
+
|
|
49
|
+
Recent messages are preserved verbatim below. Continue from where you left off.`;let p={role:"user",content:`<system-reminder>${u}</system-reminder>`};return [s,p,...h]}function k(e){let n=[],t=[];for(let o of e)o.role==="assistant"&&t.length>0?(n.push(t),t=[o]):t.push(o);return t.length>0&&n.push(t),n}function J(e,n){let t=k(e);if(t.length<=n+1)return t[t.length-1];let o=t.slice(n).flat(),r=w(o,0),s=o.slice(r);return s.length>0&&s[0].role==="assistant"&&s.unshift({role:"user",content:"<system-reminder>Earlier conversation context was removed to fit within the context window. Continue from the assistant's response below.</system-reminder>"}),s}function C(e){let n=new Set,t=new Set(["Read","Edit","Write","Glob","Grep"]);for(let o of e)if(Array.isArray(o.content)){for(let r of o.content)if(r.type==="tool_use"&&r.name&&t.has(r.name)&&r.input){let s=r.input,i=s.file_path??s.path;i&&n.add(i);}}return [...n]}var R,x,v,H=c(()=>{h();T();a(N,"estimateTokens");a(w,"adjustIndexToPreserveAPIInvariants");a(z,"snipCompact");a(I,"windowCompact");R=new Set(["Read","Glob","Grep","Bash","PowerShell","NotebookEdit","WebFetch","WebSearch","REPL"]);a(W,"buildToolUseIdToNameMap");a(B,"summarizeToolCallArgs");a(U,"microcompact");a(L,"applyToolResultBudget");a(F,"truncateToolResult");a(G,"buildSummarizationPrompt");x="<anchored-summary>",v="</anchored-summary>";a(q,"extractAnchoredSummary");a(D,"applySummaryCompaction");a(k,"groupMessagesByApiRound");a(J,"dropOldestRounds");a(C,"extractReferencedFilePaths");});export{N as a,w as b,z as c,I as d,R as e,U as f,L as g,F as h,G as i,q as j,D as k,k as l,J as m,C as n,K as o,H as p};
|