1"use strict";(self.webpackChunksemantic_router_docs=self.webpackChunksemantic_router_docs||[]).push([[29215],{45436(e,t,i){i.r(t),i.d(t,{assets:()=>a,contentTitle:()=>r,default:()=>h,frontMatter:()=>o,metadata:()=>n,toc:()=>c});const n=JSON.parse('{"id":"tutorials/algorithm/selection/static","title":"Static","description":"Overview","source":"@site/versioned_docs/version-v0.3/tutorials/algorithm/selection/static.md","sourceDirName":"tutorials/algorithm/selection","slug":"/tutorials/algorithm/selection/static","permalink":"/docs/v0.3/tutorials/algorithm/selection/static","draft":false,"unlisted":false,"editUrl":"https://github.com/vllm-project/semantic-router/edit/main/website/docs/tutorials/algorithm/selection/static.md","tags":[],"version":"v0.3","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Session Aware","permalink":"/docs/v0.3/tutorials/algorithm/selection/session-aware"},"next":{"title":"SVM (Support Vector Machine)","permalink":"/docs/v0.3/tutorials/algorithm/selection/svm"}}');var s=i(74848),l=i(28453);const o={},r="Static",a={},c=[{value:"Overview",id:"overview",level:2},{value:"Key Advantages",id:"key-advantages",level:2},{value:"Algorithm Principle",id:"algorithm-principle",level:2},{value:"What Problem Does It Solve?",id:"what-problem-does-it-solve",level:2},{value:"Select Flow",id:"select-flow",level:2},{value:"When to Use",id:"when-to-use",level:2},{value:"Configuration",id:"configuration",level:2}];function d(e){const t={code:"code",h1:"h1",h2:"h2",header:"header",li:"li",mermaid:"mermaid",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.header,{children:(0,s.jsx)(t.h1,{id:"static",children:"Static"})}),"\n",(0,s.jsx)(t.h2,{id:"overview",children:"Overview"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)(t.code,{children:"static"})," is the simplest selection algorithm: the route keeps its candidate list, and the selection policy stays fixed. The first candidate in ",(0,s.jsx)(t.code,{children:"modelRefs"})," always wins."]}),"\n",(0,s.jsxs)(t.p,{children:["It aligns to ",(0,s.jsx)(t.code,{children:"config/fragments/algorithm/selection/static.yaml"}),"."]}),"\n",(0,s.jsx)(t.h2,{id:"key-advantages",children:"Key Advantages"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsxs)(t.li,{children:[(0,s.jsx)(t.strong,{children:"Zero overhead"}),": No computation, no state, no external dependencies."]}),"\n",(0,s.jsx)(t.li,{children:"Deterministic and easy to reason about."}),"\n",(0,s.jsx)(t.li,{children:"No learned selector state or runtime tuning."}),"\n",(0,s.jsx)(t.li,{children:"Good default when the candidate order is already intentional."}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"algorithm-principle",children:"Algorithm Principle"}),"\n",(0,s.jsxs)(t.p,{children:["Static selection is trivial \u2014 return the first candidate model from the ",(0,s.jsx)(t.code,{children:"modelRefs"})," list:"]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:'SelectionResult {\n SelectedModel: modelRefs[0].model,\n Score: 1.0,\n Confidence: 1.0,\n Method: "static",\n Reasoning: "Static selection: using first candidate"\n}\n'})}),"\n",(0,s.jsx)(t.h2,{id:"what-problem-does-it-solve",children:"What Problem Does It Solve?"}),"\n",(0,s.jsxs)(t.p,{children:["Some routes already have an intentional candidate order and do not need extra ranking logic, learned state, or runtime metrics. ",(0,s.jsx)(t.code,{children:"static"})," keeps selection deterministic and transparent by always taking the first configured candidate."]}),"\n",(0,s.jsx)(t.h2,{id:"select-flow",children:"Select Flow"}),"\n",(0,s.jsx)(t.mermaid,{value:"flowchart TD\n A[Request arrives] --\x3e B[Decision matched]\n B --\x3e C[algorithm.type = static]\n C --\x3e D[Return modelRefs, 0,]\n D --\x3e E[SelectionResult with score=1.0]"}),"\n",(0,s.jsx)(t.h2,{id:"when-to-use",children:"When to Use"}),"\n",(0,s.jsxs)(t.ul,{children:["\n",(0,s.jsx)(t.li,{children:"One candidate should always win after the route matches."}),"\n",(0,s.jsx)(t.li,{children:"Model ordering is already curated outside the algorithm layer."}),"\n",(0,s.jsx)(t.li,{children:"You want the simplest possible route-local selection policy."}),"\n",(0,s.jsx)(t.li,{children:"No learning or adaptation is needed."}),"\n"]}),"\n",(0,s.jsx)(t.h2,{id:"configuration",children:"Configuration"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-yaml",children:"algorithm:\n t
1ype: static\n"})}),"\n",(0,s.jsxs)(t.p,{children:["No additional parameters. The selected model is always the first entry in ",(0,s.jsx)(t.code,{children:"modelRefs"}),"."]})]})}function h(e={}){const{wrapper:t}={...(0,l.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},28453(e,t,i){i.d(t,{R:()=>o,x:()=>r});var n=i(96540);const s={},l=n.createContext(s);function o(e){const t=n.useContext(l);return n.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function r(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),n.createElement(l.Provider,{value:t},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.