1"use strict";(self.webpackChunksemantic_router_docs=self.webpackChunksemantic_router_docs||[]).push([[25901],{50514(e,n,t){t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>o,toc:()=>c});const o=JSON.parse('{"id":"tutorials/algorithm/looper/ratings","title":"Ratings","description":"Overview","source":"@site/docs/tutorials/algorithm/looper/ratings.md","sourceDirName":"tutorials/algorithm/looper","slug":"/tutorials/algorithm/looper/ratings","permalink":"/docs/tutorials/algorithm/looper/ratings","draft":false,"unlisted":false,"editUrl":"https://github.com/vllm-project/semantic-router/edit/main/website/docs/tutorials/algorithm/looper/ratings.md","tags":[],"version":"current","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Fusion","permalink":"/docs/tutorials/algorithm/looper/fusion"},"next":{"title":"ReMoM (Reasoning for Mixture of Models)","permalink":"/docs/tutorials/algorithm/looper/remom"}}');var r=t(74848),i=t(28453);const s={},l="Ratings",a={},c=[{value:"Overview",id:"overview",level:2},{value:"Key Advantages",id:"key-advantages",level:2},{value:"What Problem Does It Solve?",id:"what-problem-does-it-solve",level:2},{value:"When to Use",id:"when-to-use",level:2},{value:"Configuration",id:"configuration",level:2},{value:"Dependencies and Limitations",id:"dependencies-and-limitations",level:2}];function d(e){const n={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"ratings",children:"Ratings"})}),"\n",(0,r.jsx)(n.h2,{id:"overview",children:"Overview"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"ratings"})," calls every candidate model and returns one OpenAI-compatible choice\nper successful model. ",(0,r.jsx)(n.code,{children:"max_concurrent"})," limits parallel work; it does not limit\nthe total number of candidates executed."]}),"\n",(0,r.jsx)(n.p,{children:"Despite its name, the current runtime does not score, vote on, or synthesize\nthe choices. The caller receives them for comparison or downstream rating."}),"\n",(0,r.jsx)(n.h2,{id:"key-advantages",children:"Key Advantages"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"Compares the same request across all declared candidates."}),"\n",(0,r.jsx)(n.li,{children:"Bounds parallel work without dropping later candidates."}),"\n",(0,r.jsx)(n.li,{children:"Preserves one identifiable response choice per successful model."}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"what-problem-does-it-solve",children:"What Problem Does It Solve?"}),"\n",(0,r.jsx)(n.p,{children:"Evaluation and comparison clients sometimes need the same prompt answered by\nseveral models through one Router request. Ratings provides bounded fan-out\nwithout introducing a judge model."}),"\n",(0,r.jsx)(n.h2,{id:"when-to-use",children:"When to Use"}),"\n",(0,r.jsxs)(n.p,{children:["Use Ratings for side-by-side evaluation or applications that understand\nmultiple ",(0,r.jsx)(n.code,{children:"choices"}),". Do not use it when the caller expects a single synthesized\nanswer; use ",(0,r.jsx)(n.code,{children:"fusion"})," or ",(0,r.jsx)(n.code,{children:"remom"})," for that."]}),"\n",(0,r.jsx)(n.h2,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-yaml",children:"algorithm:\n type: ratings\n ratings:\n max_concurrent: 3\n on_error: skip\n"})}),"\n",(0,r.jsxs)(n.p,{children:["See a complete example:\n",(0,r.jsx)(n.a,{href:"https://github.com/vllm-project/semantic-router/blob/main/config/fragments/algorithm/looper/ratings.yaml",children:(0,r.jsx)(n.code,{children:"config/fragments/algorithm/looper/ratings.yaml"})}),"."]}),"\n",(0,r.jsx)(n.h2,{id:"dependencies-and-limitations",children:"Dependencies and Limitations"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:["Requires more than one ",(0,r.jsx)(n.code,{children:"modelRef"})," and a reachable\n",(0,r.jsx)(n.code,{children:"global.integrations.looper.endpoint"}),"."]}),"\n",(0,r.jsx)(n.li,{children:"Every candidate receives the request content, so all candidate providers must\nbe allowed by the route's data policy."}),"\n",(0,r.jsx)(n.li,{children:"Cost grows with the number of candidates. Concurrency reduces wall-clock\ntime but not total model calls."}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.code,{children:"on_error: ski
1p"})," returns the successful choices; ",(0,r.jsx)(n.code,{children:"on_error: fail"})," fails the\nrun if any model call fails. The run fails if all models fail."]}),"\n",(0,r.jsx)(n.li,{children:"Tool definitions are removed from Ratings subrequests; use Router Flow for\nagent workflows that must continue tool calls."}),"\n"]})]})}function h(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(d,{...e})}):d(e)}},28453(e,n,t){t.d(n,{R:()=>s,x:()=>l});var o=t(96540);const r={},i=o.createContext(r);function s(e){const n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.Provider,{value:n},e.children)}}}]);
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.