PageSourceSearch

https://vllm-sr.ai/assets/js/3521ff8f.fb91a6f4.js

js vllm-sr.ai collected 2026-10-04 01:32:08 UTC 8,218 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksemantic_router_docs=self.webpackChunksemantic_router_docs||[]).push([[15110],{88356(e,i,n){n.r(i),n.d(i,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>o,metadata:()=>s,toc:()=>c});const s=JSON.parse('{"id":"tutorials/decision/overview","title":"Decision Tutorials","description":"Overview","source":"@site/versioned_docs/version-v0.3/tutorials/decision/overview.md","sourceDirName":"tutorials/decision","slug":"/tutorials/decision/overview","permalink":"/docs/v0.3/tutorials/decision/overview","draft":false,"unlisted":false,"editUrl":"https://github.com/vllm-project/semantic-router/edit/main/website/docs/tutorials/decision/overview.md","tags":[],"version":"v0.3","frontMatter":{},"sidebar":"tutorialSidebar","previous":{"title":"Mappings","permalink":"/docs/v0.3/tutorials/projection/mappings"},"next":{"title":"Single Condition Decisions","permalink":"/docs/v0.3/tutorials/decision/single"}}');var t=n(74848),r=n(28453);const o={},d="Decision Tutorials",l={},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}];function a(e){const i={a:"a",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(i.header,{children:(0,t.jsx)(i.h1,{id:"decision-tutorials",children:"Decision Tutorials"})}),"\n",(0,t.jsx)(i.h2,{id:"overview",children:"Overview"}),"\n",(0,t.jsxs)(i.p,{children:["Latest decision tutorials mirror the boolean-case catalog under ",(0,t.jsx)(i.code,{children:"config/fragments/decision/"}),"."]}),"\n",(0,t.jsx)(i.p,{children:"Signals tell the router what it detected. Decisions tell the router what to do with those detections:"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"which route matched"}),"\n",(0,t.jsx)(i.li,{children:"which models are candidates"}),"\n",(0,t.jsx)(i.li,{children:"whether reasoning is enabled"}),"\n",(0,t.jsx)(i.li,{children:"which plugins run after the route is chosen"}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"key-advantages",children:"Key Advantages"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"Keeps route policy readable even when multiple signals must cooperate."}),"\n",(0,t.jsx)(i.li,{children:"Makes boolean logic explicit and reviewable."}),"\n",(0,t.jsx)(i.li,{children:"Separates route matching from deployment bindings, algorithms, and plugins."}),"\n",(0,t.jsxs)(i.li,{children:["Maps directly to reusable fragment directories under ",(0,t.jsx)(i.code,{children:"config/fragments/decision/"}),"."]}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"what-problem-does-it-solve",children:"What Problem Does It Solve?"}),"\n",(0,t.jsx)(i.p,{children:"Without a decision layer, signal outputs do not tell the router how to react. Teams end up scattering route logic across ad hoc if-statements, model defaults, and plugin wiring."}),"\n",(0,t.jsx)(i.p,{children:"Decisions solve that by turning named signals into clear route policies with stable priorities and candidate models."}),"\n",(0,t.jsx)(i.h2,{id:"when-to-use",children:"When to Use"}),"\n",(0,t.jsxs)(i.p,{children:["Use ",(0,t.jsx)(i.code,{children:"decision/"})," when:"]}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsx)(i.li,{children:"a route should activate from one or more signals"}),"\n",(0,t.jsx)(i.li,{children:"the same model policy should be reused across several signal combinations"}),"\n",(0,t.jsx)(i.li,{children:"route priority matters"}),"\n",(0,t.jsx)(i.li,{children:"plugins or algorithms should attach to a matched route instead of the whole router"}),"\n"]}),"\n",(0,t.jsx)(i.h2,{id:"configuration",children:"Configuration"}),"\n",(0,t.jsxs)(i.p,{children:["In v0.3, decisions live under ",(0,t.jsx)(i.code,{children:"routing.decisions"}),":"]}),"\n",(0,t.jsx)(i.pre,{children:(0,t.jsx)(i.code,{className:"language-yaml",children:"routing:\n  decisions:\n    - name: business_route\n      priority: 110\n      rules:\n        operator: AND\n        conditions:\n          - type: domain\n            name: business\n      modelRefs:\n        - model: qwen2.5:3b\n          use_reasoning: false\n"})}),"\n",(0,t.jsx)(i.p,{children:"Decision matching stays separate from:"}),"\n",(0,t.jsxs)(i.ul,{children:["\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.co
1de,{children:"providers.models[]"}),", which carries deployment bindings"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"decision.algorithm"}),", which chooses among multiple candidate models"]}),"\n",(0,t.jsxs)(i.li,{children:[(0,t.jsx)(i.code,{children:"decision.plugins"}),", which post-processes a matched route"]}),"\n"]}),"\n",(0,t.jsx)(i.p,{children:"Use the case-shape catalog below in the same order as the fragment tree:"}),"\n",(0,t.jsxs)(i.table,{children:[(0,t.jsx)(i.thead,{children:(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.th,{children:"Decision shape"}),(0,t.jsx)(i.th,{children:"Fragment example"}),(0,t.jsx)(i.th,{children:"Best for"}),(0,t.jsx)(i.th,{children:"Tutorial"})]})}),(0,t.jsxs)(i.tbody,{children:[(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"single"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"config/fragments/decision/single/domain-business.yaml"})}),(0,t.jsx)(i.td,{children:"one decisive signal"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./single",children:"Single Condition"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"and"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"config/fragments/decision/and/urgent-business.yaml"})}),(0,t.jsx)(i.td,{children:"multiple required signals"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./and",children:"AND Decisions"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"or"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"config/fragments/decision/or/business-or-law.yaml"})}),(0,t.jsx)(i.td,{children:"shared route across alternatives"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./or",children:"OR Decisions"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"not"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"config/fragments/decision/not/exclude-jailbreak.yaml"})}),(0,t.jsx)(i.td,{children:"explicit exclusion or safety guard"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./not",children:"NOT Decisions"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"composite"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"config/fragments/decision/composite/priority-safe-escalation.yaml"})}),(0,t.jsx)(i.td,{children:"nested real-world policies"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./composite",children:"Composite Decisions"})})]}),(0,t.jsxs)(i.tr,{children:[(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"retention"})}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.code,{children:"routing.decisions[].emits[]"})}),(0,t.jsx)(i.td,{children:"post-decision cache/session side effects"}),(0,t.jsx)(i.td,{children:(0,t.jsx)(i.a,{href:"./retention",children:"Retention Directives"})})]})]})]}),"\n",(0,t.jsxs)(i.p,{children:["Add ",(0,t.jsx)(i.a,{href:"../algorithm/overview",children:"Algorithm"})," when ",(0,t.jsx)(i.code,{children:"modelRefs"})," contains more than one candidate, and add ",(0,t.jsx)(i.a,{href:"../plugin/overview",children:"Plugin"})," when the route needs post-selection behavior."]})]})}function h(e={}){const{wrapper:i}={...(0,r.R)(),...e.components};return i?(0,t.jsx)(i,{...e,children:(0,t.jsx)(a,{...e})}):a(e)}},28453(e,i,n){n.d(i,{R:()=>o,x:()=>d});var s=n(96540);const t={},r=s.createContext(t);function o(e){const i=s.useContext(r);return s.useMemo(function(){return"function"==typeof e?e(i):{...i,...e}},[i,e])}function d(e){let i;return i=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:o(e.components),s.createElement(r.Provider,{value:i},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.