1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8329],{7918:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var n=r(45787),s=r(95339),a=r(288),l=r.n(a),o=r(61830),d=r(54163),c=r(46350),i=r(3960),m=r(2392),u=r(89845),x=r(34722),p=r(18523);let h=Date.UTC(2020,0,1)/1e3;function f(e){return e&&Number.isFinite(e)?e>1e12?Math.floor(e/1e3):e:0}function g(e){let t=[f(e.created),function(e){let t=e.match(/(20\d{2})[-_](0[1-9]|1[0-2])[-_](0[1-9]|[12]\d|3[01])/);if(!t)return null;let r=Date.parse(`${t[1]}-${t[2]}-${t[3]}T00:00:00Z`);return Number.isNaN(r)?null:Math.floor(r/1e3)}(e.id)??0].filter(e=>{let t;return e>0&&(t=Math.floor(Date.now()/1e3),e>=h&&e<=t+604800)});return 0===t.length?0:Math.min(...t)}function b(){let{currency:e}=(0,c.p)(),t="sats"===e?"sats/1M tokens":"USD/1M tokens",[r,a]=(0,s.useState)(""),[h,b]=(0,s.useState)({key:"created",direction:"desc"}),[j,v]=(0,s.useState)([]),[N,w]=(0,s.useState)({}),[k,y]=(0,s.useState)(!0),_=e=>"unknown"===e.trim().toLowerCase(),A=(e,t)=>t&&t.length>0?t[0].name:(0,d.mu)(e);(0,s.useEffect)(()=>{let e=!0;return async function(){y(!0),v([]),w({});try{await (0,d.ZC)((t,r)=>{e&&(v(e=>{let t=new Map(e.map(e=>[e.name,e]));for(let e of r){let r=g(e),n=t.get(e.name);if(!n){t.set(e.name,{...e,created:r||f(e.created)});continue}let s=f(n.created),a=f(e.created)>s?e:n,l=g(n),o=l>0&&r>0?Math.min(l,r):Math.max(l,r);t.set(e.name,{...a,created:o||f(a.created)})}return Array.from(t.values())}),w(e=>{let n={...e};for(let e of r){let r=t.name,s=e.sats_pricing?.completion??0,a=n[e.name]||[];a.some(e=>e.name===r)||(n[e.name]=[...a,{name:r,price:s}].sort((e,t)=>{let r=_(e.name),n=_(t.name);return r!==n?r?1:-1:e.price-t.price}))}return n}))})}catch(e){console.error("Failed to load models:",e)}finally{e&&y(!1)}}(),()=>{e=!1}},[]);let C=j.filter(e=>e.name.toLowerCase().includes(r.toLowerCase())||e.id.toLowerCase().includes(r.toLowerCase())).sort((t,r)=>{let n=N[t.name]||[{name:(0,d.mu)(t.name),price:0}],s=N[r.name]||[{name:(0,d.mu)(r.name),price:0}],a=_(A(t.name,n));if(a!==_(A(r.name,s)))return a?1:-1;let l=0;switch(h.key){case"name":l=(0,d.aq)(t.name).localeCompare((0,d.aq)(r.name));break;case"created":l=f(t.created)-f(r.created);break;case"context":l=t.context_length-r.context_length;break;case"input":l=("sats"===e?t.sats_pricing.prompt:t.pricing.prompt)-("sats"===e?r.sats_pricing.prompt:r.pricing.prompt);break;case"output":l=("sats"===e?t.sats_pricing.completion:t.pricing.completion)-("sats"===e?r.sats_pricing.completion:r.pricing.completion);break;default:l=0}return"asc"===h.direction?l:-l}),M=e=>{b(t=>t.key===e?{key:e,direction:"asc"===t.direction?"desc":"asc"}:{key:e,direction:"created"===e?"desc":"asc"})},S=({column:e})=>h.key!==e?(0,n.jsx)(i.A,{className:"ml-1 h-3 w-3 opacity-30"}):"asc"===h.direction?(0,n.jsx)(m.A,{className:"ml-1 h-3 w-3"}):(0,n.jsx)(u.A,{className:"ml-1 h-3 w-3"});return(0,n.jsx)(o.S,{children:(0,n.jsx)("section",{className:"py-12 md:py-20",children:(0,n.jsxs)(o.L,{children:[(0,n.jsx)("div",{className:"flex flex-col md:flex-row md:items-end md:justify-between gap-8 mb-12",children:(0,n.jsxs)("div",{className:"text-left",children:[(0,n.jsx)("h1",{className:"text-2xl md:text-3xl font-medium text-foreground mb-4 tracking-tight",children:"Models"}),(0,n.jsxs)("p",{className:"text-base md:text-lg text-muted-foreground max-w-xl font-light leading-relaxed",children:["Browse and compare ",(0,p.eX)(j.length)," AI models across the decentralized Routstr network."]})]})}),(0,n.jsx)("div",{className:"mb-12",children:(0,n.jsx)(x.p,{type:"text",placeholder:"Search models...",className:"h-10 max-w-md border-border bg-transparent font-mono text-sm text-foreground placeholder:text-muted-foreground",value:r,onChange:e=>a(e.target.value)})}),(0,n.jsxs)("div",{className:"flex flex-col",children:[(0,n.jsxs)("div",{className:"grid grid-cols-12 gap-4 py-3 border-b border-border bg-card/50 px-4 text-[10px] font-bold text-muted-foreground",children:[(0,n.jsx)("div",{className:"col-span-6 md:col-span-4 cursor-pointer hover:text-muted-foreground transition-colors",onClick:()=>M("name"),children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-1",children:["Model ",(0,n.jsx)(S,{column:"name"})]})}),(0,n.jsx)("div",{className:"hidden md:block col-span-2 text-left",children:"Providers"}),(0,n.jsx)("div",{className:"hidden lg:block col-span-2 cursor-pointer hover:text-muted-foreground transition-colors text-left",onClick:()=>M("context"),children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-1",children:["Context ",(0,n.jsx)(S,{column:"context"})]})}),(0,n.jsx)("div",{className:"hidden md:block col-span-2 cursor-pointer hover:text-muted-foreground transition-colors text-left",onClick:()=>
1M("created"),children:(0,n.jsxs)("div",{className:"inline-flex items-center gap-1",children:["Added ",(0,n.jsx)(S,{column:"created"})]})}),(0,n.jsx)("div",{className:"col-span-6 md:col-span-4 lg:col-span-2 text-right",children:"Pricing (in/out)"})]}),k&&0===j.length?[...Array(10)].map((e,t)=>(0,n.jsxs)("div",{className:"grid grid-cols-12 gap-4 py-6 border-b border-border/30 px-4 animate-pulse",children:[(0,n.jsx)("div",{className:"col-span-6 md:col-span-4 h-4 bg-border rounded w-3/4"}),(0,n.jsx)("div",{className:"hidden md:block col-span-2 h-3 bg-border rounded w-full"}),(0,n.jsx)("div",{className:"hidden lg:block col-span-2 h-3 bg-border rounded w-1/2"}),(0,n.jsx)("div",{className:"hidden md:block col-span-2 h-3 bg-border rounded w-1/2"}),(0,n.jsx)("div",{className:"col-span-6 md:col-span-2 h-3 bg-border rounded w-16 ml-auto"})]},t)):C.length>0?C.map((r,s)=>{let a=(N[r.name]||[{name:(0,d.mu)(r.name),price:0}]).sort((e,t)=>{let r=_(e.name);return r!==_(t.name)?r?1:-1:e.price-t.price}),o="";return o=a.length<=2?a.map(e=>e.name).join(", "):`${a.slice(0,2).map(e=>e.name).join(", ")}, +${a.length-2}`,(0,n.jsxs)(l(),{href:`/models/${r.id}`,className:"grid grid-cols-12 gap-4 py-5 border-b border-border/30 px-4 hover:bg-card transition-colors group items-center",children:[(0,n.jsx)("div",{className:"col-span-6 md:col-span-4",children:(0,n.jsx)("span",{className:"font-bold text-sm text-foreground group-hover:underline decoration-muted-foreground underline-offset-4 truncate block",children:r.name})}),(0,n.jsx)("div",{className:"hidden md:flex col-span-2 text-xs text-muted-foreground truncate min-w-0",children:o}),(0,n.jsx)("div",{className:"hidden lg:flex col-span-2 text-xs text-muted-foreground font-mono",children:(0,p.Eq)(r.context_length)}),(0,n.jsx)("div",{className:"hidden md:flex col-span-2 text-xs text-muted-foreground",children:r.created?new Date(1e3*f(r.created)).toLocaleDateString(void 0,{month:"short",day:"numeric"}):"â"}),(0,n.jsxs)("div",{className:"col-span-6 md:col-span-4 lg:col-span-2 text-right text-[10px] flex flex-col gap-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground font-medium",children:"in"}),(0,n.jsx)("span",{className:"text-foreground font-mono",children:"sats"===e?(0,p.rl)(1e6*r.sats_pricing.prompt):(0,p.rl)(1e6*r.pricing.prompt,{fixedSmallDecimals:!0})}),(0,n.jsx)("span",{className:"text-[9px] text-muted-foreground whitespace-nowrap",children:t})]}),(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground font-medium",children:"out"}),(0,n.jsx)("span",{className:"text-foreground font-mono",children:"sats"===e?(0,p.rl)(1e6*r.sats_pricing.completion):(0,p.rl)(1e6*r.pricing.completion,{fixedSmallDecimals:!0})}),(0,n.jsx)("span",{className:"text-[9px] text-muted-foreground whitespace-nowrap",children:t})]})]})]},`${r.id}-${s}`)}):(0,n.jsx)("div",{className:"py-20 text-center text-muted-foreground text-sm font-mono border-b border-border/30",children:"No models found matching your search."})]})]})})})}},19830:(e,t,r)=>{"use strict";r.d(t,{F:()=>l});var n=r(820);let s=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,a=n.$,l=(e,t)=>r=>{var n;if((null==t?void 0:t.variants)==null)return a(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:l,defaultVariants:o}=t,d=Object.keys(l).map(e=>{let t=null==r?void 0:r[e],n=null==o?void 0:o[e];if(null===t)return null;let a=s(t)||s(n);return l[e][a]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return a(e,d,null==t||null==(n=t.compoundVariants)?void 0:n.reduce((e,t)=>{let{class:r,className:n,...s}=t;return Object.entries(s).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...o,...c}[t]):({...o,...c})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},50311:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(65469).A)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},52468:(e,t,r)=>{Promise.resolve().then(r.bind(r,7918))},57595:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(65469).A)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])},61830:(e,t,r)=>{"use strict";r.d(t,{L:()=>d,S:()=>o});var n=r(45787),s=r(69469),a=r(85984),l=r(12241);function o({children:e,className:t,contentClassName:r,useMain:d=!0}){return(0,n.jsxs)("div",{className:(0,l.cn)("flex min-h-screen flex-col bg-background text-muted-foreground selection:bg-foreground
1/20 selection:text-foreground",t),children:[(0,n.jsx)(s.default,{}),d?(0,n.jsx)("main",{className:(0,l.cn)("flex-grow pt-[72px] sm:pt-[80px]",r),children:e}):e,(0,n.jsx)("div",{className:"mx-auto w-full max-w-[1800px]",children:(0,n.jsx)(a.A,{})})]})}function d({children:e,className:t}){return(0,n.jsx)("div",{className:(0,l.cn)("mx-auto w-full max-w-[1800px] px-[clamp(1rem,5vw,5rem)]",t),children:e})}},89845:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});let n=(0,r(65469).A)("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]])}},e=>{e.O(0,[9701,288,5560,9928,1047,7424,9469,7132,7232,1522,7358],()=>e(e.s=52468)),_N_E=e.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.