mirror of
https://github.com/zenlm/zen-blog.git
synced 2026-11-02 17:28:53 +00:00
1 line
6.2 KiB
JavaScript
1 line
6.2 KiB
JavaScript
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51776,e=>{"use strict";var t=e.i(52540),s=e.i(5337);e.i(58171);var r=e.i(91846);function n({ids:e,generation:n,showParams:i=!0,showArch:d=!1,showContext:l=!0,showPricing:a=!0,linkPrefix:o="/docs/models/"}){let c,m=new Map(r.allModels.map(e=>[e.id,e]));return c=e?e.map(e=>m.get(e)).filter(e=>void 0!==e):n?r.allModels.filter(e=>e.generation===n):r.allModels,(0,t.jsx)(s.ModelTable,{models:c,linkPrefix:o,showParams:i,showArch:d,showContext:l,showPricing:a})}e.s(["ModelTable",()=>n,"default",0,n])},50153,e=>{"use strict";var t=e.i(52540),s=e.i(40854);let r="https://pricing.hanzo.ai/v1/pricing";function n(e){return null==e?"--":e>=1||e>=.01?`$${e.toFixed(2)}`:`$${e.toFixed(e>=.001?3:4)}`}function i({generation:e="all",showArch:i=!1,showContext:d=!0,showTier:l=!1,showParams:a=!1,linkPrefix:o="/docs/models/",compact:c=!1}){let[m,h]=(0,s.useState)(null),[p,u]=(0,s.useState)(!1);if((0,s.useEffect)(()=>{fetch(r).then(e=>{if(!e.ok)throw Error();return e.json()}).then(h).catch(()=>u(!0))},[]),p)return(0,t.jsxs)("p",{className:"text-sm text-fd-muted-foreground py-4",children:["Unable to load live pricing. See ",(0,t.jsx)("a",{href:"/docs/api/pricing",className:"text-fd-primary hover:underline",children:"pricing docs"})," for current rates."]});if(!m)return(0,t.jsx)("p",{className:"text-sm text-fd-muted-foreground py-4",children:"Loading pricing..."});let x=m.hanzoModels.filter(e=>e.pricing&&!1==!e.pricing.input);return("zen4"===e?x=x.filter(e=>e.name.startsWith("zen4")):"zen3"===e&&(x=x.filter(e=>e.name.startsWith("zen3"))),c)?(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-fd-border text-left",children:[(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Model"}),i&&(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Architecture"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium text-right",children:"Input $/1M"}),(0,t.jsx)("th",{className:"pb-2 font-medium text-right",children:"Output $/1M"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-fd-border",children:x.map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"py-2 pr-4 font-mono text-sm",children:e.name}),i&&(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-fd-muted-foreground",children:e.specs?.arch}),(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-right font-mono",children:n(e.pricing?.input)}),(0,t.jsx)("td",{className:"py-2 text-sm text-right font-mono",children:n(e.pricing?.output)})]},e.name))})]})}):(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-fd-border text-left",children:[(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Model"}),a&&(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Parameters"}),i&&(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Architecture"}),d&&(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Context"}),l&&(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Tier"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium text-right",children:"Input $/1M"}),(0,t.jsx)("th",{className:"pb-2 font-medium text-right",children:"Output $/1M"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-fd-border",children:x.map(e=>{var s;return(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"py-2 pr-4",children:(0,t.jsx)("a",{href:`${o}${e.name}`,className:"font-mono text-fd-primary hover:underline text-sm",children:e.name})}),a&&(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-fd-muted-foreground",children:e.specs?.params}),i&&(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-fd-muted-foreground",children:e.specs?.arch}),d&&(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-fd-muted-foreground",children:(s=e.context)?s>=1e6||s>=1e3?`${Math.round(s/1e3)}K`:`${s}`:"--"}),l&&(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-fd-muted-foreground",children:e.tier}),(0,t.jsx)("td",{className:"py-2 pr-4 text-sm text-right font-mono",children:n(e.pricing?.input)}),(0,t.jsx)("td",{className:"py-2 text-sm text-right font-mono",children:n(e.pricing?.output)})]},e.name)})})]})})}function d(){let[e,n]=(0,s.useState)(null);if((0,s.useEffect)(()=>{fetch(r).then(e=>{if(!e.ok)throw Error();return e.json()}).then(n).catch(()=>{})},[]),!e)return null;let i=t=>e.hanzoModels.find(e=>e.name===t),d=i("zen4-mini"),l=i("zen4-coder-flash"),a=i("zen3-embedding"),o=i("zen4"),c=i("zen3-vl"),m=[d&&{task:"100 chat messages",model:"zen4-mini",tokens:"50K in + 50K out",cost:(d.pricing?.input??0)*.05+(d.pricing?.output??0)*.05},l&&{task:"1,000 code completions",model:"zen4-coder-flash",tokens:"500K in + 500K out",cost:(l.pricing?.input??0)*.5+(l.pricing?.output??0)*.5},a&&{task:"10K embeddings",model:"zen3-embedding",tokens:"1M in",cost:a.pricing?.input??0},o&&{task:"Heavy daily usage",model:"zen4",tokens:"1M in + 1M out",cost:(o.pricing?.input??0)+(o.pricing?.output??0)},c&&{task:"Vision analysis (1K images)",model:"zen3-vl",tokens:"500K in + 200K out",cost:(c.pricing?.input??0)*.5+(c.pricing?.output??0)*.2}].filter(Boolean);return(0,t.jsx)("div",{className:"overflow-x-auto",children:(0,t.jsxs)("table",{className:"w-full text-sm",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{className:"border-b border-fd-border text-left",children:[(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Task"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"Model"}),(0,t.jsx)("th",{className:"pb-2 pr-4 font-medium",children:"~Tokens"}),(0,t.jsx)("th",{className:"pb-2 font-medium text-right",children:"~Cost"})]})}),(0,t.jsx)("tbody",{className:"divide-y divide-fd-border",children:m.map(e=>(0,t.jsxs)("tr",{children:[(0,t.jsx)("td",{className:"py-2 pr-4 text-fd-muted-foreground",children:e.task}),(0,t.jsx)("td",{className:"py-2 pr-4 font-mono",children:e.model}),(0,t.jsx)("td",{className:"py-2 pr-4 text-fd-muted-foreground",children:e.tokens}),(0,t.jsxs)("td",{className:"py-2 text-right font-mono",children:["$",e.cost.toFixed(2)]})]},e.task))})]})})}e.s(["DynamicCostExamples",()=>d,"DynamicModelTable",()=>i])}]); |