PageSourceSearch

https://inferencelab.co/assets/PromptOptimization-B0YvTJ5m.js

js inferencelab.co collected 2026-10-09 22:55:04 UTC 15,297 bytes, 16 lines download raw bytes

vendor: 8,697 bytes, lines 1-16
1import{r as d,j as e}from"./motion-CUxKysUF.js";import{L as B}from"./react-vendor-BCVeLiQY.js";import{c as j,b as D,d as O,P as f,e as G,R as V,f as q,g as b,h as $,i as H,j as w,k as y,N as Z,m as K,n as W,Z as Q,B as U,C as Y,F as J}from"./index-CKIgnhq5.js";import{A as X}from"./arrow-left-DEz1rin7.js";import{T as ee}from"./target-BQeVT4OF.js";import{A as te}from"./activity-H7Ic_c5b.js";import{C as ae}from"./circle-check-B7Kj1lHH.js";import"./charts-Do059cgQ.js";import"./gsap-a9woYdh8.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const se=j("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const re=j("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/**
12 * @license lucide-react v0.462.0 - ISC
13 *
14 * This source code is licensed under the ISC license.
15 * See the LICENSE file in the root directory of this source tree.
16 */const ne=j("Shuffle",[["path",{d:"m18 14 4 4-4 4",key:"10pe0f"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22",key:"1ailkh"}],["path",{d:"M2 6h1.972a4 4 0 0 1 3.6 2.2",key:"km57vx"}],["path",{d:"M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45",key:"os18l9"}]]);var v="Tabs",[ie]=H(v,[w]),k=w(),[oe,N]=ie(v),T=d.forwardRef((t,a)=>{const{__scopeTabs:s,value:r,onValueChange:o,defaultValue:c,orientation:n="horizontal",dir:m,activationMode:p="automatic",...u}=t,l=D(m),[i,x]=O({prop:r,onChange:o,defaultProp:c});return e.jsx(oe,{scope:s,baseId:G(),value:i,onValueChange:x,orientation:n,dir:l,activationMode:p,children:e.jsx(f.div,{dir:l,"data-orientation":n,...u,ref:a})})});T.displayName=v;var I="TabsList",P=d.forwardRef((t,a)=>{const{__scopeTabs:s,loop:r=!0,...o}=t,c=N(I,s),n=k(s);return e.jsx(V,{asChild:!0,...n,orientation:c.orientation,dir:c.dir,loop:r,children:e.jsx(f.div,{role:"tablist","aria-orientation":c.orientation,...o,ref:a})})});P.displayName=I;var M="TabsTrigger",A=d.forwardRef((t,a)=>{const{__scopeTabs:s,value:r,disabled:o=!1,...c}=t,n=N(M,s),m=k(s),p=R(n.baseId,r),u=F(n.baseId,r),l=r===n.value;return e.jsx(q,{asChild:!0,...m,focusable:!o,active:l,children:e.jsx(f.button,{type:"button",role:"tab","aria-selected":l,"aria-controls":u,"data-state":l?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:p,...c,ref:a,onMouseDown:b(t.onMouseDown,i=>{!o&&i.button===0&&i.ctrlKey===!1?n.onValueChange(r):i.preventDefault()}),onKeyDown:b(t.onKeyDown,i=>{[" ","Enter"].includes(i.key)&&n.onValueChange(r)}),onFocus:b(t.onFocus,()=>{const i=n.activationMode!=="manual";!l&&!o&&i&&n.onValueChange(r)})})})});A.displayName=M;var C="TabsContent",z=d.forwardRef((t,a)=>{const{__scopeTabs:s,value:r,forceMount:o,children:c,...n}=t,m=N(C,s),p=R(m.baseId,r),u=F(m.baseId,r),l=r===m.value,i=d.useRef(l);return d.useEffect(()=>{const x=requestAnimationFrame(()=>i.current=!1);return()=>cancelAnimationFrame(x)},[]),e.jsx($,{present:o||l,children:({present:x})=>e.jsx(f.div,{"data-state":l?"active":"inactive","data-orientation":m.orientation,role:"tabpanel","aria-labelledby":p,hidden:!x,id:u,tabIndex:0,...n,ref:a,style:{...t.style,animationDuration:i.current?"0s":void 0},children:x&&c})})});z.displayName=C;function R(t,a){return`${t}-trigger-${a}`}function F(t,a){return`${t}-content-${a}`}var le=T,S=P,_=A,E=z;const ce=le,L=d.forwardRef(({className:t,...a},s)=>e.jsx(S,{ref:s,className:y("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",t),...a}));L.displayName=S.displayName;const h=d.forwardRef(({className:t,...a},s)=>e.jsx(_,{ref:s,className:y("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",t),...a}));h.displayName=_.displayName;const g=d.forwardRef(({className:t,...a},s)=>e.jsx(E,{ref:s,className:y("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t),...a}));g.displayName=E.displayName;const je=()=>e.jsxs("div",{className:"min-h-screen bg-white",children:[e.jsx(Z,{}),e.jsx(K,{children:e.jsxs("main",{className:"pt-32 pb-20",children:[e.jsx("div",{className:"container px-4 sm:px-6 lg:px-8 mx-auto mb-6",children:e.jsxs(B,{to:"/",className:"inline-flex items-center gap-2 text-sm font-medium text-gray-600 hover:text-primary transition-colors",children:[e.jsx(X,{size:16}),"Back to home"]})}),e.jsx("section",{className:"container px-4 sm:px-6 lg:px-8 mx-auto",children:e.jsxs("div",{className:"max-w-4xl mx-auto text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-4 mb-10",children:[e.jsx("img",{src:W,alt:"IronLabs Prompt Optimizer",className:"w-16 h-16 sm:w-20 sm:h-20 object-contain"}),e.jsx("h1",{className:"text-5xl sm:text-7xl font-display font-bold tracking-tight text-gray-900",children:"PromptForge"})]}),e.jsx("p",{className:"font-display text-2xl sm:text-3xl md:text-4xl text-gray-700 leading-tight mb-8",children:"Automatically optimize prompts for any AI system"}),e.jsxs("p",{className:"text-base sm:text-lg text-gray-600 mb-3",children:[e.jsx("a",{href:"#performance",className:"underline decoration-2 underline-offset-4 hover:text-primary",children:"Frontier Performance"}),", up to ",e.jsx("span",{className:"font-semibold",children:"90x cheaper"}),e.jsx("span",{className:"mx-3 text-gray-300",children:"|"}),e.jsx("a",{href:"#speed",className:"underline decoration-2 underline-offset-4 hover:text-primary",children:"35x faster"})," ","than RL"]}),e.jsxs("p",{className:"text-sm sm:text-base text-gray-600 mb-10",children:["Used by"," ",e.jsx("a",{href:"#",className:"underline hover:text-primary",children:"Vizuara"})," and"," ",e.jsx("a",{href:"#",className:"underline hover:text-primary",children:"IronLabs"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 mb-12",children:[e.jsxs("a",{href:"#quickstart",className:"inline-flex items-center gap-2 px-8 py-4 rounded-xl bg-gray-900 text-white font-medium shadow-elegant hover:bg-gray-800 transition-colors w-full sm:w-auto justify-center",children:[e.jsx(Q,{size:18}),"Quickstart"]}),e.jsxs("a",{href:"https://github.com",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-8 py-4 rounded-xl bg-white text-gray-900 font-medium border border-gray-200 hover:border-gray-400 transition-colors w-full sm:w-auto justify-center",children:[e.jsx(re,{size:18}),"GitHub"]}),e.jsxs("a",{href:"#paper",className:"inline-flex items-center gap-2 px-8 py-4 rounded-xl bg-white text-gray-900 font-medium border border-gray-200 hover:border-gray-400 transition-colors w-full sm:w-auto justify-center",children:[e.jsx(U,{size:18}),"Paper"]})]}),e.jsxs("div",{className:"inline-flex items-center rounded-md overflow-hidden text-xs font-mono shadow-sm mb-16",children:[e.jsx("span",{className:"bg-gray-700 text-white px-3 py-1.5",children:"⬇ DOWNLOADS/MONTH"}),e.jsx("span",{className:"bg-gray-500 text-white px-3 py-1.5",children:"RATE LIMITED BY UPSTREAM SERVICE"})]})]})}),e.jsx("section",{id:"quickstart",className:"container px-4 sm:px-6 lg:px-8 mx-auto mt-24",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsx("h2",{className:"text-3xl sm:text-4xl font-display font-bold text-gray-900 mb-4 text-center",children:"Qu
16ickstart"}),e.jsx("p",{className:"text-center text-gray-600 mb-8",children:"Drop PromptForge into any agent pipeline in minutes."}),e.jsxs(ce,{defaultValue:"basic",className:"w-full",children:[e.jsxs(L,{className:"grid w-full grid-cols-3 mb-4",children:[e.jsx(h,{value:"basic",className:"font-display",children:"Basic Example"}),e.jsx(h,{value:"dspy",className:"font-display",children:"With DSPy"}),e.jsx(h,{value:"custom",className:"font-display",children:"Custom System"})]}),e.jsx(g,{value:"basic",children:e.jsxs("div",{className:"rounded-2xl bg-gray-900 text-gray-100 p-6 sm:p-8 font-mono text-sm overflow-x-auto shadow-elegant",children:[e.jsx("div",{className:"text-gray-500 mb-2",children:"# Install"}),e.jsx("div",{className:"mb-4",children:"pip install ironlabs-promptforge"}),e.jsx("div",{className:"text-gray-500 mb-2",children:"# Optimize a prompt"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-pink-400",children:"from"})," ironlabs ",e.jsx("span",{className:"text-pink-400",children:"import"})," PromptForge",e.jsx("br",{}),e.jsx("br",{}),"forge = PromptForge(model=",e.jsx("span",{className:"text-emerald-300",children:'"auto"'}),")",e.jsx("br",{}),"optimized = forge.optimize(",e.jsx("span",{className:"text-emerald-300",children:'"Summarize this report..."'}),")",e.jsx("br",{}),e.jsx("br",{}),e.jsx("span",{className:"text-pink-400",children:"print"}),"(optimized.prompt)"]})]})}),e.jsx(g,{value:"dspy",children:e.jsxs("div",{className:"rounded-2xl bg-gray-900 text-gray-100 p-6 sm:p-8 font-mono text-sm overflow-x-auto shadow-elegant",children:[e.jsx("div",{className:"text-gray-500 mb-2",children:"# Install with DSPy adapter"}),e.jsx("div",{className:"mb-4",children:"pip install ironlabs-promptforge[dspy]"}),e.jsx("div",{className:"text-gray-500 mb-2",children:"# Optimize a DSPy module"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-pink-400",children:"import"})," dspy",e.jsx("br",{}),e.jsx("span",{className:"text-pink-400",children:"from"})," ironlabs.dspy ",e.jsx("span",{className:"text-pink-400",children:"import"})," PromptForgeOptimizer",e.jsx("br",{}),e.jsx("br",{}),"program = dspy.ChainOfThought(",e.jsx("span",{className:"text-emerald-300",children:'"question -> answer"'}),")",e.jsx("br",{}),"optimizer = PromptForgeOptimizer(metric=accuracy)",e.jsx("br",{}),"compiled = optimizer.compile(program, trainset=trainset)"]})]})}),e.jsx(g,{value:"custom",children:e.jsxs("div",{className:"rounded-2xl bg-gray-900 text-gray-100 p-6 sm:p-8 font-mono text-sm overflow-x-auto shadow-elegant",children:[e.jsx("div",{className:"text-gray-500 mb-2",children:"# Plug into any custom AI system"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-pink-400",children:"from"})," ironlabs ",e.jsx("span",{className:"text-pink-400",children:"import"})," PromptForge, Evaluator",e.jsx("br",{}),e.jsx("br",{}),e.jsx("span",{className:"text-pink-400",children:"def"})," ",e.jsx("span",{className:"text-sky-300",children:"my_system"}),"(prompt):",e.jsx("br",{}),"    ",e.jsx("span",{className:"text-pink-400",children:"return"})," my_llm.call(prompt)",e.jsx("br",{}),e.jsx("br",{}),"evaluator = Evaluator(fn=score_outputs, dataset=eval_set)",e.jsx("br",{}),"forge = PromptForge(system=my_system, evaluator=evaluator)",e.jsx("br",{}),e.jsx("br",{}),"best = forge.optimize(seed_prompt=",e.jsx("span",{className:"text-emerald-300",children:'"You are an expert..."'}),")"]})]})})]})]})}),e.jsx("section",{id:"how-it-works",className:"container px-4 sm:px-6 lg:px-8 mx-auto mt-32",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs("div",{className:"text-center mb-14",children:[e.jsx("div",{className:"pulse-chip mx-auto mb-4",children:e.jsx("span",{children:"How it works"})}),e.jsx("h2",{className:"text-3xl sm:text-4xl font-display font-bold text-gray-900 mb-3",children:"The optimization loop"}),e.jsx("p",{className:"text-gray-600",children:"PromptForge evolves prompts through reflection and mutation — converging on candidates that beat your baseline."})]}),e.jsx("ol",{className:"relative",children:[{n:"01",tag:"select_candidate",title:"Select from Pareto Front",desc:"Pick a candidate that excels on a slice of examples — diversity, not just averages.",output:"candidate prompt",Icon:ee,iconBg:"bg-orange-50 text-orange-500"},{n:"02",tag:"run_minibatch",title:"Run on Minibatch",desc:"Execute the candidate against a sampled batch and capture full execution traces.",output:"execution traces",Icon:te,iconBg:"bg-emerald-50 text-emerald-600"},{n:"03",tag:"reflect",title:"Reflect with LLM",desc:'An LLM reads the traces and diagnoses failures in natural language — the "why".',output:"failure diagnosis",Icon:se,iconBg:"bg-gray-900 text-white"},{n:"04",tag:"mutate",title:"Mutate Prompt",desc:"Apply targeted edits that inherit accumulated lessons from every ancestor in the tree.",output:"new candidate",Icon:ne,iconBg:"bg-orange-50 text-orange-500"},{n:"05",tag:"accept",title:"Accept if Improved",desc:"Score the variant. If it advances the Pareto front, add it to the pool and loop back.",output:"updated pool ↻",Icon:ae,iconBg:"bg-emerald-50 text-emerald-600"}].map((t,a,s)=>e.jsxs("li",{className:"relative pl-16 sm:pl-20 pb-10 last:pb-0",children:[a<s.length-1&&e.jsx("span",{className:"absolute left-6 sm:left-8 top-2 bottom-0 w-px bg-gray-200"}),e.jsx("span",{className:"absolute left-0 top-0 font-serif italic text-2xl text-gray-400 w-12 sm:w-16 text-right pr-2",children:t.n}),e.jsxs("div",{className:"rounded-2xl bg-white border border-gray-200/80 shadow-sm p-6 sm:p-7",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 mb-3",children:[e.jsxs("span",{className:"inline-flex items-center gap-1.5 font-mono text-xs text-gray-500",children:[e.jsx("span",{className:"inline-block w-2 h-2 rounded-sm bg-gray-300"}),t.tag]}),e.jsx("span",{className:`inline-flex items-center justify-center w-9 h-9 rounded-lg ${t.iconBg}`,children:e.jsx(t.Icon,{size:18})})]}),e.jsx("h3",{className:"font-display text-xl sm:text-2xl font-bold text-gray-900 mb-2",children:t.title}),e.jsx("p",{className:"text-gray-600 mb-5",children:t.desc}),e.jsxs("div",{className:"pt-4 border-t border-gray-100 font-mono text-xs text-gray-500 flex items-center gap-2",children:[e.jsx("span",{children:"output"}),e.jsx("span",{className:"text-gray-300",children:"•"}),e.jsx("span",{className:"text-gray-800",children:t.output})]})]}),a<s.length-1&&e.jsx("div",{className:"flex justify-center my-4",children:e.jsx(Y,{size:14,className:"text-purple-400",strokeWidth:2})})]},t.n))})]})})]})}),e.jsx(J,{})]});
16export{je as default};

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.