omnigateway 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/bin/omni.js +19582 -0
- package/gateway.js +39286 -0
- package/package.json +39 -0
- package/public/assets/Chip-D0YiqYkz.js +32 -0
- package/public/assets/CopyValue-BwjFnqW2.js +27 -0
- package/public/assets/Field-DdscQ9OO.js +65 -0
- package/public/assets/Lamp-CSv_5d5k.js +15 -0
- package/public/assets/Meter-Bm1oQE2U.js +14 -0
- package/public/assets/Modal-1tHwlj0o.js +82 -0
- package/public/assets/Rack-DANVhi_U.js +147 -0
- package/public/assets/Readout-CYg6UOop.js +27 -0
- package/public/assets/States-DPTTYUHL.js +54 -0
- package/public/assets/Table-LkPaHBsj.js +38 -0
- package/public/assets/Toggle-pWcL2A-N.js +42 -0
- package/public/assets/_app-C5mYmzgk.js +1 -0
- package/public/assets/_app.accounts-e7Mbaxdc.js +47 -0
- package/public/assets/_app.index-CxunMQ_m.js +57 -0
- package/public/assets/_app.keys-DTREQf0P.js +39 -0
- package/public/assets/_app.logs-Co3QPpc1.js +18 -0
- package/public/assets/_app.models-DPSKIyeq.js +144 -0
- package/public/assets/_app.settings-15ZMiM5O.js +16 -0
- package/public/assets/_app.usage-BBffCDCD.js +163 -0
- package/public/assets/archivo-latin-ext-standard-normal-7khWdh9v.woff2 +0 -0
- package/public/assets/archivo-latin-standard-normal-DY7AcnAa.woff2 +0 -0
- package/public/assets/archivo-vietnamese-standard-normal-rJmnGBSt.woff2 +0 -0
- package/public/assets/catalog-DmrbfYQe.js +1 -0
- package/public/assets/index-Co2s5xMk.css +1 -0
- package/public/assets/index-DnNTc35a.js +170 -0
- package/public/assets/login-DNvWG7Nv.js +33 -0
- package/public/assets/queries-vY5lJqBe.js +144 -0
- package/public/assets/spline-sans-mono-latin-ext-wght-normal-Dh0aNLWd.woff2 +0 -0
- package/public/assets/spline-sans-mono-latin-wght-normal-DlaB5ohX.woff2 +0 -0
- package/public/index.html +26 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import{B as e}from"./queries-vY5lJqBe.js";var t=e.table`
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-collapse: collapse;
|
|
4
|
+
font-size: 12.5px;
|
|
5
|
+
`,n=e.th`
|
|
6
|
+
position: sticky;
|
|
7
|
+
top: 0;
|
|
8
|
+
z-index: 1;
|
|
9
|
+
padding: ${({theme:e})=>`${e.space(1.5)} ${e.space(2)}`};
|
|
10
|
+
text-align: ${({$align:e})=>e??`left`};
|
|
11
|
+
${({$width:e})=>e===void 0?``:`width: ${e};`}
|
|
12
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
13
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
14
|
+
font-size: 10px;
|
|
15
|
+
font-weight: 600;
|
|
16
|
+
font-stretch: 74%;
|
|
17
|
+
letter-spacing: 0.16em;
|
|
18
|
+
text-transform: uppercase;
|
|
19
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
20
|
+
white-space: nowrap;
|
|
21
|
+
`,r=e.td`
|
|
22
|
+
padding: ${({theme:e})=>`${e.space(1.5)} ${e.space(2)}`};
|
|
23
|
+
text-align: ${({$align:e})=>e??`left`};
|
|
24
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
${({theme:e,$mono:t})=>t===!0?`font-family: ${e.font.mono}; font-variant-numeric: tabular-nums; font-size: 12px;`:``}
|
|
27
|
+
`,i=e.tr`
|
|
28
|
+
background: ${({theme:e,$selected:t})=>t===!0?e.color.accentWash:`transparent`};
|
|
29
|
+
${({$selectable:e})=>e===!0?`cursor: pointer;`:``}
|
|
30
|
+
|
|
31
|
+
&:hover {
|
|
32
|
+
background: ${({theme:e,$selected:t})=>t===!0?e.color.accentWash:e.color.panelSunk};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&:last-child td {
|
|
36
|
+
border-bottom: 0;
|
|
37
|
+
}
|
|
38
|
+
`;export{i,r as n,n as r,t};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import{B as e,Dt as t,F as n,Kt as r,Ot as i}from"./queries-vY5lJqBe.js";import{m as a}from"./Rack-DANVhi_U.js";import{a as o,i as s,n as c,o as l,r as u,s as d,t as f}from"./Modal-1tHwlj0o.js";var p=a(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),m=r(i(),1),h=Object.defineProperty,g=(e,t)=>h(e,`name`,{value:t,configurable:!0});function _(e){let[t,n]=m.useState(void 0);return u(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}g(_,`useSize`);var v=t(),y=Object.defineProperty,b=(e,t)=>y(e,`name`,{value:t,configurable:!0}),x=`Switch`,[S,C]=o(x),[w,T]=S(x);function E(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:l,required:u,value:d=`on`,internal_do_not_use_render:f}=e,[p,h]=c({prop:n,defaultProp:i??!1,onChange:l,caller:x}),[g,_]=m.useState(null),[y,b]=m.useState(null),S=m.useRef(!1),[C,T]=m.useReducer(e=>e+1,0),E={checked:p,setChecked:h,disabled:a,control:g,setControl:_,name:s,form:o,value:d,hasConsumerStoppedPropagationRef:S,userInteractionCount:C,onUserInteraction:T,required:u,defaultChecked:i,isFormControl:!g||!!o||!!g.closest(`form`),bubbleInput:y,setBubbleInput:b};return(0,v.jsx)(w,{scope:t,...E,children:P(f)?f(E):r})}b(E,`SwitchProvider`);var D=`SwitchTrigger`,O=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:c,checked:u,required:f,setControl:p,setChecked:h,hasConsumerStoppedPropagationRef:g,onUserInteraction:_,isFormControl:y,bubbleInput:x}=T(D,e),S=d(r,p),C=m.useRef(u);return m.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=b(()=>h(C.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,h]),(0,v.jsx)(l.button,{type:`button`,role:`switch`,"aria-checked":u,"aria-required":f,"data-state":F(u),"data-disabled":c?``:void 0,disabled:c,value:o,...n,ref:S,onClick:s(t,e=>{_(),h(e=>!e),x&&y&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})})},`SwitchTrigger`)),k=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,v.jsx)(E,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(O,{...d,ref:t,__scopeSwitch:n}),e&&(0,v.jsx)(N,{__scopeSwitch:n})]})})},`Switch`)),A=`SwitchThumb`,j=m.forwardRef(b(function(e,t){let{__scopeSwitch:n,...r}=e,i=T(A,n);return(0,v.jsx)(l.span,{"data-state":F(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),M=`SwitchBubbleInput`,N=m.forwardRef(b(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:c,defaultChecked:u,required:f,disabled:p,name:h,value:g,form:y,bubbleInput:b,setBubbleInput:x}=T(M,e),S=d(r,x),C=_(i),w=m.useRef(!1),E=m.useRef(c),D=m.useRef(o);m.useEffect(()=>{let e=b;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==D.current;D.current=o;let i=E.current!==c;E.current=c;let s=!(r&&a.current);if(i&&n){w.current=!r;let t=new Event(`click`,{bubbles:s});n.call(e,c),e.dispatchEvent(t),w.current=!1}},[b,c,a,o]);let O=m.useRef(c);return(0,v.jsx)(l.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:u??O.current,required:f,disabled:p,name:h,value:g,form:y,...n,tabIndex:-1,ref:S,onClick:s(t,e=>{w.current&&e.stopPropagation()}),style:{...n.style,...C,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function P(e){return typeof e==`function`}b(P,`isFunction`);function F(e){return e?`checked`:`unchecked`}b(F,`getState`);var I=e.p`
|
|
2
|
+
font-size: 13px;
|
|
3
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
4
|
+
`;function L({open:e,onOpenChange:t,title:r,body:i,confirmLabel:a,busy:o,onConfirm:s}){return(0,v.jsx)(f,{open:e,onOpenChange:t,title:r,width:`420px`,footer:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(n,{type:`button`,onClick:()=>t(!1),children:`Cancel`}),(0,v.jsx)(n,{type:`button`,$variant:`danger`,disabled:o===!0,onClick:s,children:a})]}),children:(0,v.jsx)(I,{children:i})})}var R=e(k)`
|
|
5
|
+
all: unset;
|
|
6
|
+
width: 30px;
|
|
7
|
+
height: 16px;
|
|
8
|
+
padding: 2px;
|
|
9
|
+
border-radius: 9px;
|
|
10
|
+
background: ${({theme:e})=>e.color.ruleStrong};
|
|
11
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
transition: background 140ms ease;
|
|
14
|
+
flex: none;
|
|
15
|
+
|
|
16
|
+
&[data-state="checked"] {
|
|
17
|
+
background: ${({theme:e})=>e.color.ok};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:disabled {
|
|
21
|
+
opacity: 0.5;
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&:focus-visible {
|
|
26
|
+
outline: 2px solid ${({theme:e})=>e.color.accent};
|
|
27
|
+
outline-offset: 2px;
|
|
28
|
+
}
|
|
29
|
+
`,z=e(j)`
|
|
30
|
+
display: block;
|
|
31
|
+
width: 12px;
|
|
32
|
+
height: 12px;
|
|
33
|
+
border-radius: 50%;
|
|
34
|
+
background: ${({theme:e})=>e.color.panel};
|
|
35
|
+
transition: transform 140ms ease;
|
|
36
|
+
transform: translateX(0);
|
|
37
|
+
will-change: transform;
|
|
38
|
+
|
|
39
|
+
&[data-state="checked"] {
|
|
40
|
+
transform: translateX(14px);
|
|
41
|
+
}
|
|
42
|
+
`;function B({checked:e,onCheckedChange:t,label:n,disabled:r,id:i}){return(0,v.jsx)(R,{checked:e,onCheckedChange:t,"aria-label":n,...r===void 0?{}:{disabled:r},...i===void 0?{}:{id:i},children:(0,v.jsx)(z,{})})}export{L as n,p as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dt as e}from"./queries-vY5lJqBe.js";import{o as t}from"./index-DnNTc35a.js";import{i as n,n as r}from"./Rack-DANVhi_U.js";var i=e(),a=()=>(0,i.jsx)(n,{children:(0,i.jsx)(r,{children:(0,i.jsx)(t,{})})});export{a as component};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import{A as e,B as t,D as n,Dt as r,F as i,I as a,Kt as o,M as s,Ot as c,S as l,c as u,i as d,k as f,o as p,r as m,s as h,t as g,y as _}from"./queries-vY5lJqBe.js";import{a as v,d as y,l as b,m as x,t as S}from"./Rack-DANVhi_U.js";import{t as C}from"./CopyValue-BwjFnqW2.js";import{n as w,r as T,t as ee}from"./Toggle-pWcL2A-N.js";import{r as te,t as E}from"./catalog-DmrbfYQe.js";import{t as D}from"./Modal-1tHwlj0o.js";import{a as O,i as ne,l as re,n as k,s as A,t as j}from"./Lamp-CSv_5d5k.js";import{t as M}from"./Chip-D0YiqYkz.js";import{i as N,n as P,r as F,t as I}from"./Field-DdscQ9OO.js";import{t as ie}from"./Meter-Bm1oQE2U.js";import{a as L,i as R,n as z,r as B,t as V}from"./States-DPTTYUHL.js";import{i as H,n as U,r as W,t as G}from"./Table-LkPaHBsj.js";var K=x(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),q=o(c(),1),J=r(),ae=Object.keys(E),Y={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},X={anthropic:`Authorize in the browser, then paste the code Anthropic shows you.`,openai:`Authorize in the browser. When it redirects to localhost, paste the whole URL.`,kimi:`Enter the code on Kimi's device page. This dialog finishes on its own.`},oe=t.ol`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
5
|
+
`,se=t.div`
|
|
6
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
7
|
+
font-size: 26px;
|
|
8
|
+
letter-spacing: 0.22em;
|
|
9
|
+
text-align: center;
|
|
10
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
11
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
12
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
13
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
14
|
+
`,ce=t.p`
|
|
15
|
+
font-size: 12px;
|
|
16
|
+
color: ${({theme:e})=>e.color.down};
|
|
17
|
+
`,le=t.p`
|
|
18
|
+
font-size: 12px;
|
|
19
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
20
|
+
`;function ue({open:e,onOpenChange:t,onConnected:r}){let[a,o]=(0,q.useState)(`anthropic`),[c,l]=(0,q.useState)(``),[u,p]=(0,q.useState)(null),[h,_]=(0,q.useState)(``),[v,y]=(0,q.useState)(null),b=d(),x=m(),S=(0,q.useCallback)(()=>{p(null),_(``),y(null),l(``),b.reset(),x.reset()},[b,x]),w=(0,q.useCallback)(e=>{e||S(),t(e)},[t,S]);return(0,q.useEffect)(()=>{if(u===null||u.kind!==`device`)return;let e=!1,n=async()=>{try{let n=await g(u.flowId);if(e)return;if(n.status===`complete`){S(),t(!1),r();return}}catch(t){if(e)return;y(R(t)),p(null);return}e||(i=setTimeout(()=>void n(),u.pollIntervalMs))},i=setTimeout(()=>void n(),u.pollIntervalMs);return()=>{e=!0,clearTimeout(i)}},[u,r,t,S]),(0,J.jsx)(D,{open:e,onOpenChange:w,title:`Connect an account`,description:`The gateway stores the resulting token encrypted. It is never shown again after this dialog.`,footer:u===null?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(i,{type:`button`,$variant:`primary`,disabled:b.isPending,onClick:()=>{y(null),b.mutate({provider:a,label:c.trim().length===0?Y[a]:c.trim()},{onSuccess:e=>p(e),onError:e=>y(R(e))})},children:b.isPending?`Starting…`:`Start authorization`})]}):u.kind===`device`?(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(i,{type:`button`,onClick:()=>w(!1),children:`Cancel`}),(0,J.jsx)(i,{type:`button`,$variant:`primary`,disabled:x.isPending||h.trim().length===0,onClick:()=>{u!==null&&(y(null),x.mutate({flowId:u.flowId,code:h.trim()},{onSuccess:()=>{S(),t(!1),r()},onError:e=>y(R(e))}))},children:x.isPending?`Finishing…`:`Finish connecting`})]}),children:(0,J.jsxs)(oe,{children:[u===null?(0,J.jsxs)(s,{$gap:3,children:[(0,J.jsx)(I,{label:`Provider`,children:e=>(0,J.jsx)(N,{...e,value:a,onChange:e=>o(e.target.value),children:ae.map(e=>(0,J.jsx)(`option`,{value:e,children:Y[e]},e))})}),(0,J.jsx)(I,{label:`Label`,hint:`How this account is named in the rack. Defaults to the provider.`,children:e=>(0,J.jsx)(P,{...e,value:c,placeholder:Y[a],onChange:e=>l(e.target.value)})})]}):(0,J.jsxs)(s,{$gap:3,children:[(0,J.jsxs)(s,{$gap:1,children:[(0,J.jsx)(n,{children:`Step 1 — authorize`}),(0,J.jsx)(f,{$gap:2,children:(0,J.jsxs)(i,{as:`a`,href:u.authorizeUrl,target:`_blank`,rel:`noreferrer noopener`,$variant:`primary`,$size:`sm`,children:[(0,J.jsx)(K,{}),`Open `,Y[a]]})}),(0,J.jsx)(C,{value:u.authorizeUrl,label:`Copy authorization link`})]}),u.userCode===null?null:(0,J.jsxs)(s,{$gap:1,children:[(0,J.jsx)(n,{children:`Step 2 — enter this code`}),(0,J.jsx)(se,{children:u.userCode})]}),u.kind===`device`?(0,J.jsxs)(le,{children:[X[a],` Waiting for authorization…`]}):(0,J.jsx)(I,{label:`Authorization code`,hint:X[a],...v===null?{}:{problem:v},children:e=>(0,J.jsx)(P,{...e,value:h,autoFocus:!0,placeholder:a===`openai`?`http://localhost:1455/auth/callback?code=…`:`code#state`,onChange:e=>_(e.target.value)})})]}),v===null||u?.kind===`pkce`?null:(0,J.jsx)(ce,{children:v})]})})}var de=[`anthropic`,`openai`,`kimi`],Z={anthropic:`Anthropic`,openai:`OpenAI`,kimi:`Kimi`},fe=t(L)`
|
|
21
|
+
border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
|
|
22
|
+
`,Q=t(P)`
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 140px;
|
|
25
|
+
height: 26px;
|
|
26
|
+
font-family: ${({theme:e})=>e.font.sans};
|
|
27
|
+
font-size: 12.5px;
|
|
28
|
+
background: transparent;
|
|
29
|
+
border-color: transparent;
|
|
30
|
+
|
|
31
|
+
&:hover:not(:disabled),
|
|
32
|
+
&:focus {
|
|
33
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
34
|
+
border-color: ${({theme:e})=>e.color.ruleStrong};
|
|
35
|
+
}
|
|
36
|
+
`,$=t(F)`
|
|
37
|
+
width: 62px;
|
|
38
|
+
height: 26px;
|
|
39
|
+
`,pe=t.span`
|
|
40
|
+
display: block;
|
|
41
|
+
padding-left: 9px;
|
|
42
|
+
font-size: 11px;
|
|
43
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
44
|
+
`,me=t(f)`
|
|
45
|
+
min-width: 130px;
|
|
46
|
+
gap: 6px;
|
|
47
|
+
`;function he(){let e=l();return{pending:e.isPending,commit:(t,n)=>{e.mutate({id:t,patch:n})}}}function ge(){let{cadence:t}=v(),r=h(),o=p(t(1e4)),c=_(),l=u(),{commit:d}=he(),[m,g]=(0,q.useState)(!1),[x,C]=(0,q.useState)(null),E=Date.now(),D=r.data??[],N=O(o.data?.health??[],e=>e.credentialId),P=O(o.data?.quota??[],e=>e.credentialId),F=c.data?.quotaPollIntervalMs??3e5,I=D.filter(e=>e.enabled).length,R=r.isLoading?`Reading connected accounts…`:D.length===0?`No provider credentials are connected, so every request fails at the router.`:`${I} of ${D.length} accounts are enabled and eligible for routing.`;return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(S,{legend:`Accounts`,title:`Provider accounts`,summary:R,actions:(0,J.jsxs)(i,{type:`button`,$variant:`primary`,onClick:()=>g(!0),children:[(0,J.jsx)(T,{}),`Connect an account`]})}),r.isError?(0,J.jsx)(L,{legend:`Accounts`,children:(0,J.jsx)(z,{error:r.error,onRetry:()=>void r.refetch()})}):r.isLoading?(0,J.jsx)(L,{legend:`Accounts`,children:(0,J.jsx)(B,{rows:5})}):D.length===0?(0,J.jsx)(L,{legend:`Accounts`,children:(0,J.jsx)(V,{legend:`Nothing connected`,message:`Connect a provider account to give the router something to dispatch to. Tokens are encrypted at rest and never shown again.`,action:(0,J.jsx)(i,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>g(!0),children:`Connect an account`})})}):(0,J.jsx)(s,{$gap:4,children:de.filter(e=>D.some(t=>t.provider===e)).map(t=>{let r=D.filter(e=>e.provider===t);return(0,J.jsx)(fe,{$provider:t,legend:Z[t],meta:`${r.length} account${r.length===1?``:`s`}`,flush:!0,children:(0,J.jsx)(e,{children:(0,J.jsxs)(G,{children:[(0,J.jsx)(`thead`,{children:(0,J.jsxs)(`tr`,{children:[(0,J.jsx)(W,{$width:`24%`,children:`Account`}),(0,J.jsx)(W,{$width:`20%`,children:`Sign-in`}),(0,J.jsx)(W,{$align:`right`,$width:`86px`,children:`Tier`}),(0,J.jsx)(W,{$align:`right`,$width:`94px`,children:`Weight`}),(0,J.jsx)(W,{$align:`center`,$width:`86px`,children:`Enabled`}),(0,J.jsx)(W,{$width:`160px`,children:`Quota`}),(0,J.jsx)(W,{$align:`right`,$width:`88px`,children:`TTFT`}),(0,J.jsx)(W,{$align:`right`,$width:`130px`,children:`Token expires`}),(0,J.jsx)(W,{$width:`48px`})]})}),(0,J.jsx)(`tbody`,{children:r.map(e=>{let t=ne(N.get(e.id)??[],E,e.enabled,e.disabledReason),r=re(P.get(e.id)??[]);return(0,J.jsxs)(H,{children:[(0,J.jsxs)(U,{children:[(0,J.jsxs)(f,{$gap:2,children:[(0,J.jsx)(j,{state:t.state,label:t.note===``?`healthy`:t.note}),(0,J.jsx)(Q,{defaultValue:e.label,"aria-label":`Label for ${e.label}`,onBlur:t=>{let n=t.target.value.trim();if(n.length===0||n===e.label){t.target.value=e.label;return}d(e.id,{label:n})}})]}),t.note===``?null:(0,J.jsx)(pe,{children:t.note})]}),(0,J.jsx)(U,{children:(0,J.jsxs)(f,{$gap:1,children:[(0,J.jsx)(M,{children:e.authType===`oauth`?`oauth`:`api key`}),e.accountEmail===null?null:(0,J.jsx)(n,{children:e.accountEmail})]})}),(0,J.jsx)(U,{$align:`right`,children:(0,J.jsx)($,{min:1,step:1,defaultValue:e.tier,"aria-label":`Tier for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isInteger(n)||n<1||n===e.tier){t.target.value=String(e.tier);return}d(e.id,{tier:n})}})}),(0,J.jsx)(U,{$align:`right`,children:(0,J.jsx)($,{min:.1,step:.1,defaultValue:e.weight,"aria-label":`Weight for ${e.label}`,onBlur:t=>{let n=Number(t.target.value);if(!Number.isFinite(n)||n<=0||n===e.weight){t.target.value=String(e.weight);return}d(e.id,{weight:n})}})}),(0,J.jsx)(U,{$align:`center`,children:(0,J.jsx)(ee,{checked:e.enabled,label:`Route to ${e.label}`,onCheckedChange:t=>d(e.id,{enabled:t})})}),(0,J.jsx)(U,{children:r===null?(0,J.jsx)(n,{children:`unknown`}):(0,J.jsxs)(me,{children:[(0,J.jsx)(ie,{fraction:r.fraction,label:`${k[r.window.windowType]} window, ${Math.round(r.fraction*100)}% used`}),(0,J.jsx)(n,{children:A(r.window,E,F,y)})]})}),(0,J.jsx)(U,{$align:`right`,$mono:!0,children:b(t.ttftMs)}),(0,J.jsx)(U,{$align:`right`,$mono:!0,children:e.expiresAt===null?`never`:y(e.expiresAt,E)}),(0,J.jsx)(U,{$align:`right`,children:(0,J.jsx)(a,{type:`button`,$variant:`ghost`,$size:`sm`,"aria-label":`Remove ${e.label}`,title:`Remove ${e.label}`,onClick:()=>C(e),children:(0,J.jsx)(te,{})})})]},e.id)})})]})})},t)})}),(0,J.jsx)(ue,{open:m,onOpenChange:g,onConnected:()=>void r.refetch()}),(0,J.jsx)(w,{open:x!==null,onOpenChange:e=>{e||C(null)},title:`Remove account`,body:x===null?``:`Removing "${x.label}" deletes its stored token. Any model target pointing at ${Z[x.provider]} loses this account, and reconnecting means authorizing again.`,confirmLabel:`Remove account`,busy:l.isPending,onConfirm:()=>{x!==null&&l.mutate(x.id,{onSettled:()=>C(null)})}})]})}var _e=ge;export{_e as component};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import{A as e,B as t,C as n,D as r,Dt as i,E as a,F as o,H as s,M as c,N as l,O as u,h as d,j as f,k as p,m,o as h,s as g,y as _}from"./queries-vY5lJqBe.js";import{a as v,d as y,f as b,l as x,o as S,r as C,s as w,t as T,u as E}from"./Rack-DANVhi_U.js";import{a as D,c as O,i as k,l as ee,n as A,o as j,r as M,s as N,t as P}from"./Lamp-CSv_5d5k.js";import{n as F,t as I}from"./Chip-D0YiqYkz.js";import{t as L}from"./Meter-Bm1oQE2U.js";import{a as R,n as z,t as B}from"./States-DPTTYUHL.js";import{i as V,n as H,r as U,t as W}from"./Table-LkPaHBsj.js";import{t as G}from"./Readout-CYg6UOop.js";var K=i(),q=t(l)`
|
|
2
|
+
font-weight: 500;
|
|
3
|
+
display: block;
|
|
4
|
+
max-width: 24ch;
|
|
5
|
+
`,J=t.span`
|
|
6
|
+
font-size: 11px;
|
|
7
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
8
|
+
`,Y=t.div`
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
width: 118px;
|
|
13
|
+
`;function te({credentials:t,health:n,quota:i,usage:a,quotaPollIntervalMs:c,now:l}){let u=D(n,e=>e.credentialId),d=D(i,e=>e.credentialId),f=new Map(a.map(e=>[e.key,e])),m={down:0,warn:1,ok:2,idle:3},h=t.map(e=>({credential:e,status:k(u.get(e.id)??[],l,e.enabled,e.disabledReason),quota:ee(d.get(e.id)??[]),usage:f.get(e.id)})).sort((e,t)=>m[e.status.state]-m[t.status.state]||e.credential.tier-t.credential.tier);return(0,K.jsx)(R,{legend:`Accounts`,meta:`${t.length} connected`,flush:!0,actions:(0,K.jsx)(o,{as:s,to:`/accounts`,$size:`sm`,children:`Manage accounts`}),children:t.length===0?(0,K.jsx)(B,{legend:`No accounts`,message:`The gateway has no provider credentials, so every request will fail. Connect one to start routing.`,action:(0,K.jsx)(o,{as:s,to:`/accounts`,$variant:`primary`,$size:`sm`,children:`Connect an account`})}):(0,K.jsx)(e,{children:(0,K.jsxs)(W,{children:[(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(U,{children:`Account`}),(0,K.jsx)(U,{children:`Provider`}),(0,K.jsx)(U,{$align:`right`,children:`Tier`}),(0,K.jsx)(U,{children:`Quota`}),(0,K.jsx)(U,{$align:`right`,children:`TTFT`}),(0,K.jsx)(U,{$align:`right`,children:`Requests`}),(0,K.jsx)(U,{$align:`right`,children:`Last used`})]})}),(0,K.jsx)(`tbody`,{children:h.map(({credential:e,status:t,quota:n,usage:i})=>(0,K.jsxs)(V,{children:[(0,K.jsx)(H,{children:(0,K.jsxs)(p,{$gap:2,children:[(0,K.jsx)(P,{state:t.state,label:t.note===``?`healthy`:t.note}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(q,{children:e.label}),t.note===``?null:(0,K.jsx)(J,{children:t.note})]})]})}),(0,K.jsx)(H,{children:(0,K.jsx)(F,{provider:e.provider})}),(0,K.jsx)(H,{$align:`right`,$mono:!0,children:e.tier}),(0,K.jsx)(H,{children:n===null?(0,K.jsx)(J,{children:`unknown`}):(0,K.jsxs)(Y,{children:[(0,K.jsx)(L,{fraction:n.fraction,label:`${A[n.window.windowType]} window, ${Math.round(n.fraction*100)}% used`}),(0,K.jsx)(r,{children:N(n.window,l,c,y)})]})}),(0,K.jsx)(H,{$align:`right`,$mono:!0,children:x(t.ttftMs)}),(0,K.jsx)(H,{$align:`right`,$mono:!0,children:i===void 0?`—`:w(i.requests)}),(0,K.jsx)(H,{$align:`right`,$mono:!0,children:y(t.lastUsedAt,l)})]},e.id))})]})})})}var X=t.ul`
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
`,Z=t.li`
|
|
17
|
+
display: flex;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
20
|
+
padding: 6px ${({theme:e})=>e.space(3)};
|
|
21
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
22
|
+
|
|
23
|
+
&:last-child {
|
|
24
|
+
border-bottom: 0;
|
|
25
|
+
}
|
|
26
|
+
`,Q=t(l)`
|
|
27
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
max-width: 30ch;
|
|
30
|
+
`,ne=t(u)`
|
|
31
|
+
color: ${({theme:e})=>e.color.down};
|
|
32
|
+
font-size: 11px;
|
|
33
|
+
`;function re({logs:e}){let t=e.slice(0,12);return(0,K.jsx)(R,{legend:`Activity`,meta:`most recent first`,flush:!0,actions:(0,K.jsx)(o,{as:s,to:`/logs`,$size:`sm`,children:`Open logs`}),children:t.length===0?(0,K.jsx)(B,{legend:`No traffic yet`,message:`Point a client at this gateway with an API key and the requests will appear here.`}):(0,K.jsx)(X,{children:t.map(e=>(0,K.jsxs)(Z,{children:[(0,K.jsx)(P,{state:j(e)?`down`:`ok`,label:j(e)?`failed with ${e.status}`:`succeeded`}),(0,K.jsx)(u,{$dim:!0,children:S(e.at)}),(0,K.jsx)(Q,{title:e.requestedModel,children:e.requestedModel||`—`}),e.resolvedProvider===null?null:(0,K.jsx)(u,{$dim:!0,style:{color:`var(--p-${e.resolvedProvider})`},children:e.resolvedProvider}),(0,K.jsx)(f,{}),e.errorCode===null?null:(0,K.jsx)(ne,{children:e.errorCode}),e.attempts>1?(0,K.jsxs)(u,{$dim:!0,children:[e.attempts,`×`]}):null,(0,K.jsx)(u,{$dim:!0,children:x(e.durationMs)}),(0,K.jsx)(u,{$dim:!0,children:b(e.costUsd)})]},e.id))})})}var ie=t.ul`
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
37
|
+
`,ae=t(l)`
|
|
38
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
39
|
+
font-size: 12.5px;
|
|
40
|
+
`,oe=t.div`
|
|
41
|
+
display: flex;
|
|
42
|
+
height: 5px;
|
|
43
|
+
border-radius: 2px;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
46
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
47
|
+
`,se=t.div`
|
|
48
|
+
flex: ${({$grow:e})=>e} 0 0;
|
|
49
|
+
background: ${({$color:e})=>e};
|
|
50
|
+
opacity: 0.8;
|
|
51
|
+
`,ce=t.div`
|
|
52
|
+
flex: ${({$grow:e})=>e} 0 0;
|
|
53
|
+
`;function le({models:e,logs:t}){let n=new Map;for(let e of t){let t=n.get(e.requestedModel)??{requests:0,costUsd:0};t.requests+=1,t.costUsd+=e.costUsd,n.set(e.requestedModel,t)}let i=Math.max(1,...[...n.values()].map(e=>e.requests)),a=[...e].map(e=>({model:e,used:n.get(e.id)})).sort((e,t)=>(t.used?.requests??0)-(e.used?.requests??0)).slice(0,8);return(0,K.jsx)(R,{legend:`Models`,meta:`${e.length} configured`,actions:(0,K.jsx)(o,{as:s,to:`/models`,$size:`sm`,children:`Edit routing`}),children:e.length===0?(0,K.jsx)(B,{legend:`No models`,message:`Nothing is routable yet. Create a virtual model and point it at one or more provider targets.`,action:(0,K.jsx)(o,{as:s,to:`/models`,$variant:`primary`,$size:`sm`,children:`Create a model`})}):(0,K.jsx)(ie,{children:a.map(({model:e,used:t})=>{let n=(t?.requests??0)/i,a=[...new Set(e.targets.map(e=>e.provider))];return(0,K.jsxs)(`li`,{children:[(0,K.jsxs)(p,{$gap:2,children:[(0,K.jsx)(ae,{title:e.id,children:e.id}),e.isAlias?(0,K.jsx)(I,{children:`alias`}):null,(0,K.jsx)(I,{$tone:`accent`,children:e.strategy}),(0,K.jsx)(f,{}),(0,K.jsx)(u,{$dim:!0,children:w(t?.requests??0)}),(0,K.jsx)(r,{children:`req`}),(0,K.jsx)(u,{$dim:!0,children:b(t?.costUsd??0)})]}),(0,K.jsxs)(oe,{style:{marginTop:6},title:`${Math.round(n*100)}% of the busiest model`,children:[a.map(e=>(0,K.jsx)(se,{$color:`var(--p-${e})`,$grow:n/a.length},e)),(0,K.jsx)(ce,{$grow:Math.max(0,1-n)})]})]},e.id)})})})}var ue=t.div`
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
|
|
56
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
57
|
+
`;function de({logs:e,windowMs:t,now:n}){let r=e.filter(e=>n-e.at<=t),i=O(r,t),a=M(r,{now:n,spanMs:t,count:32}),o=i.errorRate>=.25?`down`:i.errorRate>=.05?`warn`:`ok`;return(0,K.jsxs)(ue,{children:[(0,K.jsx)(G,{legend:`Requests`,value:w(i.requests),unit:`${i.ratePerMin.toFixed(1)}/min`,trace:(0,K.jsx)(C,{values:a.map(e=>e.total),overlay:a.map(e=>e.errors),label:`${i.requests} requests, ${i.errors} of them failed`})}),(0,K.jsx)(G,{legend:`Error rate`,value:E(i.errorRate),unit:`${w(i.errors)} failed`,tone:i.requests===0?`ink`:o,trace:(0,K.jsx)(C,{values:a.map(e=>e.errors),scaleTo:Math.max(...a.map(e=>e.total)),color:`var(--down)`,label:`${i.errors} failed requests against ${i.requests} total`})}),(0,K.jsx)(G,{legend:`Time to first token`,value:x(i.ttftP50),unit:`p95 ${x(i.ttftP95)}`,trace:(0,K.jsx)(C,{values:a.map(e=>e.ttftMs??0),color:`var(--ok)`,label:`median first-token latency, currently ${x(i.ttftP50)}`})}),(0,K.jsx)(G,{legend:`Spend`,value:b(i.costUsd),unit:`${w(i.inputTokens+i.outputTokens)} tokens`,trace:(0,K.jsx)(C,{values:a.map(e=>e.costUsd),color:`var(--warn)`,label:`spend over the window, ${b(i.costUsd)} total`})})]})}var $=36e5;function fe(){let{cadence:e}=v(),t=g(),r=h(e(1e4)),i=d(),o=m(500,e(1e4)),s=_(),l=Date.now(),u=Math.floor((l-$)/6e4)*6e4,f=n({groupBy:`credential`,since:u},e(6e4)),p=t.data??[],y=D(r.data?.health??[],e=>e.credentialId),b=p.filter(e=>k(y.get(e.id)??[],l,e.enabled,e.disabledReason).state===`down`),x=t.isLoading||o.isLoading?`Reading the gateway…`:p.length===0?`No accounts are connected, so every request fails at the router.`:b.length>0?`${b.length} account${b.length===1?` is`:`s are`} out of rotation.`:`All ${p.length} accounts are answering. Nothing needs attention.`;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(T,{legend:`Rack`,title:`Gateway`,summary:x}),o.isError?(0,K.jsx)(R,{legend:`Traffic`,children:(0,K.jsx)(z,{legend:`The gateway did not answer`,error:o.error,onRetry:()=>void o.refetch()})}):(0,K.jsxs)(c,{$gap:4,children:[(0,K.jsx)(de,{logs:o.data??[],windowMs:$,now:l}),(0,K.jsx)(te,{credentials:p,health:r.data?.health??[],quota:r.data?.quota??[],usage:f.data??[],quotaPollIntervalMs:s.data?.quotaPollIntervalMs??3e5,now:l}),(0,K.jsxs)(a,{$min:`340px`,$gap:4,children:[(0,K.jsx)(le,{models:i.data??[],logs:o.data??[]}),(0,K.jsx)(re,{logs:o.data??[]})]})]})]})}var pe=fe;export{pe as component};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,a as u,d,g as f,h as p,k as m}from"./queries-vY5lJqBe.js";import{c as h,t as g}from"./Rack-DANVhi_U.js";import{t as _}from"./CopyValue-BwjFnqW2.js";import{n as v,r as y,t as b}from"./Toggle-pWcL2A-N.js";import{t as x}from"./Modal-1tHwlj0o.js";import{t as S}from"./Chip-D0YiqYkz.js";import{n as C,t as w}from"./Field-DdscQ9OO.js";import{a as T,i as E,n as D,r as O,t as k}from"./States-DPTTYUHL.js";import{i as A,n as j,r as M,t as N}from"./Table-LkPaHBsj.js";var P=a(l(),1),F=r(),I=t.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 2px;
|
|
5
|
+
max-height: 190px;
|
|
6
|
+
overflow-y: auto;
|
|
7
|
+
padding: ${({theme:e})=>e.space(1)};
|
|
8
|
+
border: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
9
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
10
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
11
|
+
`,L=t.label`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
15
|
+
padding: 4px 6px;
|
|
16
|
+
border-radius: 2px;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
19
|
+
font-size: 12px;
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
background: ${({theme:e})=>e.color.panelRaised};
|
|
23
|
+
}
|
|
24
|
+
`,R=t.p`
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
color: ${({theme:e})=>e.color.warn};
|
|
27
|
+
`,z=t.p`
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
color: ${({theme:e})=>e.color.down};
|
|
30
|
+
`,B=t.p`
|
|
31
|
+
font-size: 12px;
|
|
32
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
33
|
+
`;function V({open:e,onOpenChange:t}){let r=p(),a=u(),[s,l]=(0,P.useState)(``),[d,f]=(0,P.useState)(!0),[h,g]=(0,P.useState)([]),[v,y]=(0,P.useState)(``),[S,T]=(0,P.useState)(null),[D,O]=(0,P.useState)(null),k=()=>{l(``),f(!0),g([]),y(``),T(null),O(null),a.reset()},A=e=>{e||k(),t(e)};return(0,F.jsx)(x,{open:e,onOpenChange:A,title:S===null?`Create an API key`:`Key created`,description:S===null?`Clients send this key as a bearer token or as x-api-key on every /v1 request.`:void 0,footer:S===null?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(i,{type:`button`,onClick:()=>A(!1),children:`Cancel`}),(0,F.jsx)(i,{type:`button`,$variant:`primary`,disabled:a.isPending,onClick:()=>{let e=v.trim(),t=e.length===0?null:Number(e);if(t!==null&&(!Number.isInteger(t)||t<1)){O(`The rate limit must be a whole number of requests per minute, or blank for none.`);return}O(null),a.mutate({label:s.trim().length===0?`api key`:s.trim(),modelAllowlist:d?null:h,rateLimitPerMin:t},{onSuccess:e=>T(e),onError:e=>O(E(e))})},children:a.isPending?`Creating…`:`Create key`})]}):(0,F.jsx)(i,{type:`button`,$variant:`primary`,onClick:()=>A(!1),children:`I have copied the key`}),children:S===null?(0,F.jsxs)(o,{$gap:3,children:[(0,F.jsx)(w,{label:`Label`,hint:`Names the client this key belongs to, e.g. laptop or CI.`,children:e=>(0,F.jsx)(C,{...e,value:s,placeholder:`api key`,onChange:e=>l(e.target.value)})}),(0,F.jsxs)(o,{$gap:2,children:[(0,F.jsxs)(m,{$gap:2,children:[(0,F.jsx)(b,{checked:d,label:`Allow every model`,onCheckedChange:f}),(0,F.jsx)(n,{as:`span`,children:`Allow every model`})]}),d?null:(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(I,{children:(r.data??[]).map(e=>(0,F.jsxs)(L,{children:[(0,F.jsx)(`input`,{type:`checkbox`,checked:h.includes(e.id),onChange:t=>g(n=>t.target.checked?[...n,e.id]:n.filter(t=>t!==e.id))}),e.id]},e.id))}),h.length===0?(0,F.jsx)(R,{children:`With no model selected this key is allowed nothing and every request it makes will be refused.`}):null]})]}),(0,F.jsx)(w,{label:`Rate limit`,hint:`Requests per minute for this key. Leave blank for no limit. Counted per process, and reset when the gateway restarts.`,children:e=>(0,F.jsx)(C,{...e,type:`number`,min:1,step:1,value:v,placeholder:`no limit`,onChange:e=>y(e.target.value)})}),D===null?null:(0,F.jsx)(z,{role:`alert`,children:D})]}):(0,F.jsxs)(o,{$gap:3,children:[(0,F.jsx)(B,{children:`This is the only time the key is shown. The gateway keeps a hash, so a lost key has to be replaced rather than recovered.`}),(0,F.jsx)(_,{value:S.key,label:`Copy API key`}),(0,F.jsxs)(m,{$gap:2,children:[(0,F.jsx)(n,{children:`Label`}),(0,F.jsx)(c,{children:S.label}),(0,F.jsx)(n,{children:`Prefix`}),(0,F.jsx)(c,{children:S.prefix})]})]})})}var H=t(m)`
|
|
34
|
+
gap: 4px;
|
|
35
|
+
flex-wrap: wrap;
|
|
36
|
+
max-width: 34ch;
|
|
37
|
+
`,U=t.span`
|
|
38
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
39
|
+
`;function W(){let t=d(),r=f(),[a,o]=(0,P.useState)(!1),[c,l]=(0,P.useState)(null),u=t.data??[],p=u.filter(e=>e.revokedAt===null),m=t.isLoading?`Reading issued keys…`:u.length===0?`No keys exist, so nothing can call this gateway yet.`:`${p.length} active key${p.length===1?``:`s`} of ${u.length} ever issued.`;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(g,{legend:`Keys`,title:`Gateway API keys`,summary:m,actions:(0,F.jsxs)(i,{type:`button`,$variant:`primary`,onClick:()=>o(!0),children:[(0,F.jsx)(y,{}),`Create a key`]})}),(0,F.jsx)(T,{legend:`Issued keys`,meta:`${u.length}`,flush:!0,children:t.isError?(0,F.jsx)(D,{error:t.error,onRetry:()=>void t.refetch()}):t.isLoading?(0,F.jsx)(`div`,{style:{padding:12},children:(0,F.jsx)(O,{rows:4})}):u.length===0?(0,F.jsx)(k,{legend:`No keys`,message:`Create a key and give it to a client. The key is shown once, at creation.`,action:(0,F.jsx)(i,{type:`button`,$variant:`primary`,$size:`sm`,onClick:()=>o(!0),children:`Create a key`})}):(0,F.jsx)(e,{children:(0,F.jsxs)(N,{children:[(0,F.jsx)(`thead`,{children:(0,F.jsxs)(`tr`,{children:[(0,F.jsx)(M,{children:`Label`}),(0,F.jsx)(M,{children:`Prefix`}),(0,F.jsx)(M,{children:`Allowed models`}),(0,F.jsx)(M,{$align:`right`,children:`Rate limit`}),(0,F.jsx)(M,{$align:`right`,children:`Created`}),(0,F.jsx)(M,{children:`Status`}),(0,F.jsx)(M,{})]})}),(0,F.jsx)(`tbody`,{children:u.map(e=>(0,F.jsxs)(A,{children:[(0,F.jsx)(j,{children:(0,F.jsx)(s,{style:{maxWidth:`24ch`,display:`block`},children:e.label})}),(0,F.jsxs)(j,{$mono:!0,children:[e.prefix,`…`]}),(0,F.jsx)(j,{children:e.modelAllowlist===null?(0,F.jsx)(n,{children:`every model`}):e.modelAllowlist.length===0?(0,F.jsx)(S,{$tone:`down`,children:`no models`}):(0,F.jsx)(H,{children:e.modelAllowlist.map(e=>(0,F.jsx)(S,{children:e},e))})}),(0,F.jsx)(j,{$align:`right`,$mono:!0,children:e.rateLimitPerMin===null?`—`:`${e.rateLimitPerMin}/min`}),(0,F.jsx)(j,{$align:`right`,$mono:!0,children:h(e.createdAt)}),(0,F.jsx)(j,{children:e.revokedAt===null?(0,F.jsx)(S,{$tone:`ok`,children:`active`}):(0,F.jsx)(U,{title:h(e.revokedAt),children:(0,F.jsx)(S,{children:`revoked`})})}),(0,F.jsx)(j,{$align:`right`,children:e.revokedAt===null?(0,F.jsx)(i,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>l(e),children:`Revoke`}):null})]},e.id))})]})})}),(0,F.jsx)(V,{open:a,onOpenChange:o}),(0,F.jsx)(v,{open:c!==null,onOpenChange:e=>{e||l(null)},title:`Revoke key`,body:c===null?``:`Revoking "${c.label}" refuses its next request. The key stays listed so past usage keeps its attribution, and it cannot be un-revoked.`,confirmLabel:`Revoke key`,busy:r.isPending,onConfirm:()=>{c!==null&&r.mutate(c.id,{onSettled:()=>l(null)})}})]})}var G=W;export{G as component};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{A as e,B as t,D as n,Dt as r,F as i,Kt as a,M as o,N as s,O as c,Ot as l,k as u,m as d,s as f}from"./queries-vY5lJqBe.js";import{a as p,c as m,f as h,l as g,o as _,p as v,s as y,t as b}from"./Rack-DANVhi_U.js";import{t as x}from"./Modal-1tHwlj0o.js";import{o as S,t as C}from"./Lamp-CSv_5d5k.js";import{n as w,t as T}from"./Chip-D0YiqYkz.js";import{i as E,n as D}from"./Field-DdscQ9OO.js";import{a as O,n as k,r as A,t as j}from"./States-DPTTYUHL.js";import{i as M,n as N,r as P,t as F}from"./Table-LkPaHBsj.js";var I=a(l(),1),L=r(),R=[50,100,250,500],z=t(u)`
|
|
2
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
3
|
+
flex-wrap: wrap;
|
|
4
|
+
`,B=t(D)`
|
|
5
|
+
width: 220px;
|
|
6
|
+
`,V=t(E)`
|
|
7
|
+
width: auto;
|
|
8
|
+
`,H=t.dl`
|
|
9
|
+
display: grid;
|
|
10
|
+
grid-template-columns: minmax(120px, auto) minmax(0, 1fr);
|
|
11
|
+
gap: 6px ${({theme:e})=>e.space(3)};
|
|
12
|
+
margin: 0;
|
|
13
|
+
font-size: 12.5px;
|
|
14
|
+
`,U=t.dd`
|
|
15
|
+
margin: 0;
|
|
16
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
17
|
+
word-break: break-all;
|
|
18
|
+
`;function W(){let{cadence:t}=p(),[r,a]=(0,I.useState)(100),[l,E]=(0,I.useState)(`all`),[D,W]=(0,I.useState)(``),[G,K]=(0,I.useState)(null),q=d(r,t(1e4)),J=f(),Y=(0,I.useMemo)(()=>{let e=new Map;for(let t of J.data??[])e.set(t.id,t.label);return e},[J.data]),X=D.trim().toLowerCase(),Z=(q.data??[]).filter(e=>l===`failed`&&!S(e)?!1:X.length===0||e.requestedModel.toLowerCase().includes(X)||(e.resolvedModel??``).toLowerCase().includes(X)||(e.errorCode??``).toLowerCase().includes(X)||(e.credentialId===null?``:Y.get(e.credentialId)??``).toLowerCase().includes(X)),Q=(q.data??[]).filter(S).length;return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(b,{legend:`Logs`,title:`Recent requests`,summary:q.isLoading?`Reading the request log…`:`${y(q.data?.length??0)} recent requests, ${y(Q)} of them failed. Prompt and response bodies are never recorded.`,actions:(0,L.jsxs)(z,{children:[(0,L.jsx)(B,{value:D,placeholder:`Filter by model, account, or error`,"aria-label":`Filter requests`,onChange:e=>W(e.target.value)}),(0,L.jsxs)(V,{value:l,"aria-label":`Show which requests`,onChange:e=>E(e.target.value),children:[(0,L.jsx)(`option`,{value:`all`,children:`All requests`}),(0,L.jsx)(`option`,{value:`failed`,children:`Failed only`})]}),(0,L.jsx)(V,{value:r,"aria-label":`How many requests to fetch`,onChange:e=>a(Number(e.target.value)),children:R.map(e=>(0,L.jsxs)(`option`,{value:e,children:[`last `,e]},e))})]})}),(0,L.jsx)(O,{legend:`Request log`,meta:`${Z.length} shown`,flush:!0,children:q.isError?(0,L.jsx)(k,{error:q.error,onRetry:()=>void q.refetch()}):q.isLoading?(0,L.jsx)(`div`,{style:{padding:12},children:(0,L.jsx)(A,{rows:8})}):Z.length===0?(0,L.jsx)(j,{legend:`Nothing to show`,message:(q.data?.length??0)===0?`No requests have reached the gateway yet.`:`No request in this window matches the filter. Clear it to see everything.`}):(0,L.jsx)(e,{children:(0,L.jsxs)(F,{children:[(0,L.jsx)(`thead`,{children:(0,L.jsxs)(`tr`,{children:[(0,L.jsx)(P,{}),(0,L.jsx)(P,{$align:`right`,children:`Time`}),(0,L.jsx)(P,{children:`Requested`}),(0,L.jsx)(P,{children:`Routed to`}),(0,L.jsx)(P,{children:`Account`}),(0,L.jsx)(P,{$align:`right`,children:`Try`}),(0,L.jsx)(P,{$align:`right`,children:`TTFT`}),(0,L.jsx)(P,{$align:`right`,children:`Total`}),(0,L.jsx)(P,{$align:`right`,children:`Tokens`}),(0,L.jsx)(P,{$align:`right`,children:`Cost`}),(0,L.jsx)(P,{children:`Outcome`})]})}),(0,L.jsx)(`tbody`,{children:Z.map(e=>(0,L.jsxs)(M,{$selectable:!0,onClick:()=>K(e),children:[(0,L.jsx)(N,{children:(0,L.jsx)(C,{state:S(e)?`down`:`ok`,label:S(e)?`failed with ${e.status}`:`succeeded`})}),(0,L.jsx)(N,{$align:`right`,$mono:!0,title:m(e.at),children:_(e.at)}),(0,L.jsx)(N,{$mono:!0,children:(0,L.jsx)(s,{style:{display:`block`,maxWidth:`20ch`},children:e.requestedModel||`—`})}),(0,L.jsx)(N,{children:e.resolvedProvider===null?(0,L.jsx)(n,{children:`not routed`}):(0,L.jsxs)(u,{$gap:1,children:[(0,L.jsx)(w,{provider:e.resolvedProvider}),(0,L.jsx)(c,{$dim:!0,children:e.resolvedModel??`—`})]})}),(0,L.jsx)(N,{children:(0,L.jsx)(s,{style:{display:`block`,maxWidth:`18ch`},children:e.credentialId===null?`—`:Y.get(e.credentialId)??v(e.credentialId)})}),(0,L.jsx)(N,{$align:`right`,$mono:!0,children:e.attempts}),(0,L.jsx)(N,{$align:`right`,$mono:!0,children:g(e.ttftMs)}),(0,L.jsx)(N,{$align:`right`,$mono:!0,children:g(e.durationMs)}),(0,L.jsx)(N,{$align:`right`,$mono:!0,children:y(e.inputTokens+e.outputTokens)}),(0,L.jsx)(N,{$align:`right`,$mono:!0,children:h(e.costUsd)}),(0,L.jsx)(N,{children:e.errorCode===null?(0,L.jsx)(T,{$tone:`ok`,children:e.status}):(0,L.jsx)(T,{$tone:`down`,children:e.errorCode})})]},e.id))})]})})}),(0,L.jsx)(x,{open:G!==null,onOpenChange:e=>{e||K(null)},title:`Request detail`,width:`600px`,footer:(0,L.jsx)(i,{type:`button`,onClick:()=>K(null),children:`Close`}),children:G===null?null:(0,L.jsxs)(o,{$gap:3,children:[(0,L.jsxs)(H,{children:[(0,L.jsx)(n,{as:`dt`,children:`Request id`}),(0,L.jsx)(U,{children:G.id}),(0,L.jsx)(n,{as:`dt`,children:`At`}),(0,L.jsx)(U,{children:m(G.at)}),(0,L.jsx)(n,{as:`dt`,children:`Requested model`}),(0,L.jsx)(U,{children:G.requestedModel||`—`}),(0,L.jsx)(n,{as:`dt`,children:`Routed to`}),(0,L.jsx)(U,{children:G.resolvedProvider===null?`not routed`:`${G.resolvedProvider} · ${G.resolvedModel??`—`}`}),(0,L.jsx)(n,{as:`dt`,children:`Account`}),(0,L.jsx)(U,{children:G.credentialId===null?`—`:Y.get(G.credentialId)??G.credentialId}),(0,L.jsx)(n,{as:`dt`,children:`Key`}),(0,L.jsx)(U,{children:G.apiKeyId??`—`}),(0,L.jsx)(n,{as:`dt`,children:`Attempts`}),(0,L.jsx)(U,{children:G.attempts}),(0,L.jsx)(n,{as:`dt`,children:`Status`}),(0,L.jsx)(U,{children:G.errorCode===null?G.status:`${G.status} ${G.errorCode}`}),(0,L.jsx)(n,{as:`dt`,children:`Timing`}),(0,L.jsxs)(U,{children:[`first token `,g(G.ttftMs),` · total `,g(G.durationMs)]}),(0,L.jsx)(n,{as:`dt`,children:`Tokens`}),(0,L.jsxs)(U,{children:[y(G.inputTokens),` in · `,y(G.outputTokens),` out ·`,` `,y(G.cacheReadTokens),` cache read ·`,` `,y(G.cacheWriteTokens),` cache write`]}),(0,L.jsx)(n,{as:`dt`,children:`Cost`}),(0,L.jsx)(U,{children:h(G.costUsd)})]}),G.degradations.length===0?null:(0,L.jsxs)(o,{$gap:1,children:[(0,L.jsx)(n,{children:`Capabilities dropped to fit the target`}),(0,L.jsx)(u,{$gap:1,$wrap:!0,children:G.degradations.map(e=>(0,L.jsx)(T,{$tone:`warn`,children:e},e))})]})]})})]})}var G=W;export{G as component};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import{B as e,D as t,Dt as n,F as r,I as i,Kt as a,M as o,N as s,O as c,Ot as l,_ as u,h as d,j as f,k as p,l as m,u as h,y as g}from"./queries-vY5lJqBe.js";import{m as _,t as v}from"./Rack-DANVhi_U.js";import{n as y,r as b,t as x}from"./Toggle-pWcL2A-N.js";import{n as S,r as C,t as w}from"./catalog-DmrbfYQe.js";import{n as ee,t as T}from"./Chip-D0YiqYkz.js";import{i as E,n as D,r as O,t as k}from"./Field-DdscQ9OO.js";import{t as te}from"./Meter-Bm1oQE2U.js";import{a as A,i as j,n as ne,r as M,t as N}from"./States-DPTTYUHL.js";var re=_(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),P=_(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),F=a(l(),1),I=n(),L=[`tier`,`health`,`quota`,`cost`,`latency`,`recency`],ie={tier:`How preferred this tier is`,health:`Consecutive failures and breaker state`,quota:`Headroom in the tightest window, against how much of it is left`,cost:`Price against the other candidates`,latency:`Observed time to first token`,recency:`How long this pair has been idle`},ae=e.li`
|
|
2
|
+
padding: ${({theme:e})=>e.space(2)} 0;
|
|
3
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
4
|
+
|
|
5
|
+
&:last-child {
|
|
6
|
+
border-bottom: 0;
|
|
7
|
+
}
|
|
8
|
+
`,oe=e(c)`
|
|
9
|
+
width: 22px;
|
|
10
|
+
color: ${({theme:e})=>e.color.inkFaint};
|
|
11
|
+
flex: none;
|
|
12
|
+
`,se=e(T)`
|
|
13
|
+
border-color: ${({theme:e})=>e.color.ok};
|
|
14
|
+
color: ${({theme:e})=>e.color.ok};
|
|
15
|
+
background: ${({theme:e})=>e.color.okWash};
|
|
16
|
+
`,ce=e.div`
|
|
17
|
+
display: grid;
|
|
18
|
+
grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
|
|
19
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
20
|
+
margin-top: ${({theme:e})=>e.space(2)};
|
|
21
|
+
padding-left: 30px;
|
|
22
|
+
`,le=e.div`
|
|
23
|
+
display: flex;
|
|
24
|
+
flex-direction: column;
|
|
25
|
+
gap: 3px;
|
|
26
|
+
min-width: 0;
|
|
27
|
+
`,ue=e.div`
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: baseline;
|
|
30
|
+
justify-content: space-between;
|
|
31
|
+
gap: 6px;
|
|
32
|
+
`,de=e.li`
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
36
|
+
padding: 5px 0;
|
|
37
|
+
`,fe=e(p)`
|
|
38
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
`,R=e.label`
|
|
41
|
+
display: flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 6px;
|
|
44
|
+
cursor: pointer;
|
|
45
|
+
font-size: 12.5px;
|
|
46
|
+
`,z=e.p`
|
|
47
|
+
font-size: 12px;
|
|
48
|
+
color: ${({theme:e})=>e.color.down};
|
|
49
|
+
`;function B(e,t,n){return(e[t]??0)*n[t]}function V({modelId:e}){let[n,i]=(0,F.useState)({tools:!1,images:!1,reasoning:!1}),[a,l]=(0,F.useState)(null),[u,d]=(0,F.useState)(null),m=g(),_=h(),v=m.data?.weights,y=()=>{e!==null&&(d(null),_.mutate({modelId:e,need:n},{onSuccess:e=>l(e),onError:e=>{l(null),d(j(e))}}))},b=new Map(L.map(e=>[e,Math.max(1e-4,...(a?.candidates??[]).map(t=>v===void 0?0:Math.abs(B(t.reasons,e,v))))]));return(0,I.jsx)(A,{legend:`Explain`,meta:e??`no model selected`,actions:(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`primary`,disabled:e===null||_.isPending,onClick:y,children:[(0,I.jsx)(re,{}),_.isPending?`Ranking…`:`Rank candidates`]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Pretend the request needs`}),(0,I.jsxs)(fe,{children:[(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.tools,label:`Probe request uses tools`,onCheckedChange:e=>i({...n,tools:e})}),`Tools`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.images,label:`Probe request includes an image`,onCheckedChange:e=>i({...n,images:e})}),`Images`]}),(0,I.jsxs)(R,{children:[(0,I.jsx)(x,{checked:n.reasoning,label:`Probe request asks for reasoning`,onCheckedChange:e=>i({...n,reasoning:e})}),`Reasoning`]})]})]}),u===null?null:(0,I.jsx)(z,{children:u}),a===null?(0,I.jsx)(N,{legend:`Not ranked yet`,message:e===null?`Select a model to see which account the router would pick for it.`:`Run the ranking to see which account wins, by how much, and what was filtered out.`}):(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsxs)(p,{$gap:2,$wrap:!0,children:[(0,I.jsx)(T,{$tone:`accent`,children:a.strategy}),a.deterministic?null:(0,I.jsx)(T,{$tone:`warn`,children:`order varies per request`}),(0,I.jsx)(f,{}),(0,I.jsxs)(t,{children:[a.candidates.length,` eligible · `,a.excluded.length,` filtered out`]})]}),a.candidates.length===0?(0,I.jsx)(N,{legend:`Nothing eligible`,message:`Every target was filtered out. The reasons below say which rule removed each one.`}):(0,I.jsx)(`ul`,{children:a.candidates.map((e,n)=>(0,I.jsxs)(ae,{children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(oe,{children:n+1}),(0,I.jsx)(ee,{provider:e.provider}),(0,I.jsx)(s,{style:{maxWidth:`22ch`},children:e.credentialLabel}),(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsxs)(T,{children:[`tier `,e.tier]}),(0,I.jsx)(f,{}),n===0?(0,I.jsx)(se,{children:`would be used`}):null,(0,I.jsx)(c,{children:e.score.toFixed(2)})]}),v===void 0?null:(0,I.jsx)(ce,{children:L.map(n=>{let r=B(e.reasons,n,v),i=b.get(n)??1;return(0,I.jsxs)(le,{title:ie[n],children:[(0,I.jsxs)(ue,{children:[(0,I.jsx)(t,{children:n}),(0,I.jsx)(c,{$dim:!0,$size:`10.5px`,children:r.toFixed(2)})]}),(0,I.jsx)(te,{fraction:Math.abs(r)/i,height:4,tone:`var(--accent)`,label:`${n} contributes ${r.toFixed(2)} of ${e.score.toFixed(2)}`})]},n)})})]},`${e.credentialId}:${e.model}`))}),a.excluded.length===0?null:(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Filtered out`}),(0,I.jsx)(`ul`,{children:a.excluded.map(e=>(0,I.jsxs)(de,{children:[(0,I.jsx)(c,{$dim:!0,children:e.model}),(0,I.jsx)(f,{}),(0,I.jsx)(T,{$tone:e.reason.startsWith(`capability`)?`warn`:`down`,children:e.reason})]},`${e.credentialId}:${e.model}:${e.reason}`))})]})]})]})})}var H=[{id:`score`,label:`Best score`,blurb:`Rank every eligible target by the routing weights and take the best one.`},{id:`priority`,label:`Lowest tier`,blurb:`Always prefer the lowest tier. Score only breaks ties inside a tier.`},{id:`roundRobin`,label:`Round robin`,blurb:`Take whichever eligible target has been idle longest, to spread load evenly.`},{id:`weighted`,label:`Weighted draw`,blurb:`Pick at random, biased by weight. The order differs from request to request.`}],U=0;function W(){return U+=1,`target-${U}`}function G(e,t){let n=S(e,t);return n===null?null:{costInput:String(n.input),costOutput:String(n.output),costCacheRead:String(n.cacheRead)}}function K(e=`anthropic`){let t=w[e].defaultModel,n=G(e,t);return{key:W(),provider:e,model:t,tier:`1`,weight:`1`,costInput:n?.costInput??`0`,costOutput:n?.costOutput??`0`,costCacheRead:n?.costCacheRead??``,tools:!0,images:!0,reasoning:!0}}function q(){return{id:``,strategy:`score`,isAlias:!1,targets:[K()]}}function J(e){return{id:e.id,strategy:e.strategy,isAlias:e.isAlias,targets:e.targets.map(e=>({key:W(),provider:e.provider,model:e.model,tier:String(e.tier),weight:String(e.weight),costInput:String(e.costPerMTok.input),costOutput:String(e.costPerMTok.output),costCacheRead:e.costPerMTok.cacheRead===void 0?``:String(e.costPerMTok.cacheRead),tools:e.capabilities.tools,images:e.capabilities.images,reasoning:e.capabilities.reasoning}))}}function pe(e){let t=e.id.trim();if(t.length===0)return{ok:!1,problem:`Give the model a name clients will ask for.`};if(e.targets.length===0)return{ok:!1,problem:`A model needs at least one target to route to.`};let n=[];for(let[t,r]of e.targets.entries()){let e=`Target ${t+1}`,i=r.model.trim();if(i.length===0)return{ok:!1,problem:`${e} needs a provider model name.`};let a=Number(r.tier);if(!Number.isInteger(a)||a<1)return{ok:!1,problem:`${e}: tier must be a whole number of 1 or more.`};let o=Number(r.weight);if(!Number.isFinite(o)||o<=0)return{ok:!1,problem:`${e}: weight must be greater than zero.`};let s=Number(r.costInput),c=Number(r.costOutput);if(!Number.isFinite(s)||s<0||!Number.isFinite(c)||c<0)return{ok:!1,problem:`${e}: prices cannot be negative.`};let l=r.costCacheRead.trim().length>0,u=Number(r.costCacheRead);if(l&&(!Number.isFinite(u)||u<0))return{ok:!1,problem:`${e}: the cache-read price cannot be negative.`};n.push({provider:r.provider,model:i,tier:a,weight:o,costPerMTok:{input:s,output:c,...l?{cacheRead:u}:{}},capabilities:{tools:r.tools,images:r.images,reasoning:r.reasoning}})}return{ok:!0,model:{id:t,strategy:e.strategy,isAlias:e.isAlias,targets:n}}}var me=Object.keys(w),he=e.fieldset`
|
|
50
|
+
border: 1px solid ${({theme:e})=>e.color.rule};
|
|
51
|
+
border-left: 3px solid ${({theme:e,$provider:t})=>e.provider[t]};
|
|
52
|
+
border-radius: ${({theme:e})=>e.radius.control};
|
|
53
|
+
padding: ${({theme:e})=>e.space(3)};
|
|
54
|
+
margin: 0;
|
|
55
|
+
background: ${({theme:e})=>e.color.panelSunk};
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
59
|
+
min-width: 0;
|
|
60
|
+
`,ge=e.div`
|
|
61
|
+
display: grid;
|
|
62
|
+
grid-template-columns: minmax(140px, 1.4fr) minmax(160px, 2fr) 72px 72px;
|
|
63
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
64
|
+
align-items: end;
|
|
65
|
+
|
|
66
|
+
@media (max-width: 720px) {
|
|
67
|
+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
|
68
|
+
}
|
|
69
|
+
`,_e=e.div`
|
|
70
|
+
display: grid;
|
|
71
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
72
|
+
gap: ${({theme:e})=>e.space(2)};
|
|
73
|
+
align-items: end;
|
|
74
|
+
`,Y=e.div`
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: column;
|
|
77
|
+
gap: 4px;
|
|
78
|
+
min-width: 0;
|
|
79
|
+
`,ve=e(p)`
|
|
80
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
81
|
+
flex-wrap: wrap;
|
|
82
|
+
`,X=e.label`
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
gap: 6px;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
`;function ye({target:e,index:n,onChange:a,onRemove:s,removable:c}){let l=(0,F.useId)(),u=w[e.provider],d=(t,n)=>{a({...e,[t]:n})},m=G(e.provider,e.model),h=t=>{a({...e,...t,...G(t.provider,t.model)??{}})};return(0,I.jsxs)(he,{$provider:e.provider,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsxs)(t,{as:`legend`,children:[`Target `,n+1]}),(0,I.jsx)(f,{}),(0,I.jsx)(i,{type:`button`,$variant:`ghost`,$size:`sm`,disabled:!c,"aria-label":`Remove target ${n+1}`,title:c?`Remove target ${n+1}`:`A model needs at least one target`,onClick:s,children:(0,I.jsx)(C,{})})]}),(0,I.jsxs)(ge,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-provider`,children:`Provider`}),(0,I.jsx)(E,{id:`${l}-provider`,value:e.provider,onChange:t=>{let n=t.target.value,r=w[n].models.some(t=>t.id===e.model);h({provider:n,model:r?e.model:w[n].defaultModel})},children:me.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-model`,children:`Provider model`}),(0,I.jsx)(D,{id:`${l}-model`,list:`${l}-catalog`,value:e.model,placeholder:u.defaultModel,onChange:t=>h({provider:e.provider,model:t.target.value})}),(0,I.jsx)(`datalist`,{id:`${l}-catalog`,children:u.models.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-tier`,children:`Tier`}),(0,I.jsx)(O,{id:`${l}-tier`,min:1,step:1,value:e.tier,onChange:e=>d(`tier`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-weight`,children:`Weight`}),(0,I.jsx)(O,{id:`${l}-weight`,min:0,step:.1,value:e.weight,onChange:e=>d(`weight`,e.target.value)})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsxs)(p,{$gap:2,children:[(0,I.jsx)(t,{children:`Price per million tokens`}),(0,I.jsx)(f,{}),m===null?(0,I.jsx)(t,{as:`span`,children:`not in the catalog — price it yourself`}):(0,I.jsxs)(r,{type:`button`,$size:`sm`,$variant:`ghost`,disabled:e.costInput===m.costInput&&e.costOutput===m.costOutput&&e.costCacheRead===m.costCacheRead,onClick:()=>a({...e,...m}),children:[(0,I.jsx)(P,{}),`Use list price`]})]}),(0,I.jsxs)(_e,{children:[(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-in`,children:`Input`}),(0,I.jsx)(O,{id:`${l}-in`,min:0,step:.01,value:e.costInput,onChange:e=>d(`costInput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-out`,children:`Output`}),(0,I.jsx)(O,{id:`${l}-out`,min:0,step:.01,value:e.costOutput,onChange:e=>d(`costOutput`,e.target.value)})]}),(0,I.jsxs)(Y,{children:[(0,I.jsx)(t,{as:`label`,htmlFor:`${l}-cache`,children:`Cache read`}),(0,I.jsx)(O,{id:`${l}-cache`,min:0,step:.01,placeholder:`same as input`,value:e.costCacheRead,onChange:e=>d(`costCacheRead`,e.target.value)})]})]})]}),(0,I.jsxs)(o,{$gap:1,children:[(0,I.jsx)(t,{children:`Capabilities`}),(0,I.jsxs)(ve,{children:[(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.tools,label:`Target ${n+1} supports tools`,onCheckedChange:e=>d(`tools`,e)}),`Tools`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.images,label:`Target ${n+1} supports images`,onCheckedChange:e=>d(`images`,e)}),`Images`]}),(0,I.jsxs)(X,{children:[(0,I.jsx)(x,{checked:e.reasoning,label:`Target ${n+1} supports reasoning`,onCheckedChange:e=>d(`reasoning`,e)}),`Reasoning`]})]})]})]})}var Z=e.p`
|
|
88
|
+
font-size: 11.5px;
|
|
89
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
90
|
+
`,be=e.p`
|
|
91
|
+
font-size: 12px;
|
|
92
|
+
color: ${({theme:e})=>e.color.down};
|
|
93
|
+
`,xe=e.p`
|
|
94
|
+
font-size: 12px;
|
|
95
|
+
color: ${({theme:e})=>e.color.ok};
|
|
96
|
+
`,Q=e(p)`
|
|
97
|
+
gap: 8px;
|
|
98
|
+
`;function Se({model:e,onSaved:n,onDeleted:i}){let[a,s]=(0,F.useState)(()=>e===null?q():J(e)),[c,l]=(0,F.useState)(null),[d,h]=(0,F.useState)(!1),[g,_]=(0,F.useState)(!1),v=u(),S=m(),C=e?.id??null;(0,F.useEffect)(()=>{s(e===null?q():J(e)),l(null),h(!1)},[C]);let w=H.find(e=>e.id===a.strategy);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(A,{legend:e===null?`New model`:`Edit model`,meta:e===null?void 0:e.id,actions:(0,I.jsxs)(I.Fragment,{children:[e===null?null:(0,I.jsx)(r,{type:`button`,$variant:`danger`,$size:`sm`,onClick:()=>_(!0),children:`Delete`}),(0,I.jsx)(r,{type:`button`,$variant:`primary`,$size:`sm`,disabled:v.isPending,onClick:()=>{h(!1);let e=pe(a);if(!e.ok){l(e.problem);return}l(null),v.mutate(e.model,{onSuccess:()=>{h(!0),n(e.model.id)},onError:e=>l(j(e))})},children:v.isPending?`Saving…`:e===null?`Create model`:`Save changes`})]}),children:(0,I.jsxs)(o,{$gap:3,children:[(0,I.jsx)(k,{label:`Model name`,hint:e===null?`What clients send as the model. Anything not listed here is rejected.`:`Fixed once created. To rename, create a model under the new name and delete this one.`,children:t=>(0,I.jsx)(D,{...t,value:a.id,disabled:e!==null,placeholder:`fast`,onChange:e=>s({...a,id:e.target.value})})}),(0,I.jsx)(k,{label:`Routing strategy`,children:e=>(0,I.jsx)(E,{...e,value:a.strategy,onChange:e=>s({...a,strategy:e.target.value}),children:H.map(e=>(0,I.jsx)(`option`,{value:e.id,children:e.label},e.id))})}),w===void 0?null:(0,I.jsx)(Z,{children:w.blurb}),(0,I.jsxs)(Q,{children:[(0,I.jsx)(x,{checked:a.isAlias,label:`This model is an alias for a provider model name`,onCheckedChange:e=>s({...a,isAlias:e})}),(0,I.jsxs)(o,{$gap:0,children:[(0,I.jsx)(t,{as:`span`,children:`Alias`}),(0,I.jsx)(Z,{children:`Mark this when the name mirrors a provider's own model name.`})]})]}),(0,I.jsxs)(o,{$gap:2,children:[(0,I.jsxs)(p,{children:[(0,I.jsx)(t,{children:`Targets`}),(0,I.jsx)(f,{}),(0,I.jsxs)(r,{type:`button`,$size:`sm`,onClick:()=>s({...a,targets:[...a.targets,K(a.targets.at(-1)?.provider??`anthropic`)]}),children:[(0,I.jsx)(b,{}),`Add target`]})]}),a.targets.map((e,t)=>(0,I.jsx)(ye,{target:e,index:t,removable:a.targets.length>1,onChange:t=>s({...a,targets:a.targets.map(n=>n.key===e.key?t:n)}),onRemove:()=>s({...a,targets:a.targets.filter(t=>t.key!==e.key)})},e.key))]}),c===null?null:(0,I.jsx)(be,{role:`alert`,children:c}),d&&c===null?(0,I.jsx)(xe,{role:`status`,children:`Saved.`}):null]})}),(0,I.jsx)(y,{open:g,onOpenChange:_,title:`Delete model`,body:e===null?``:`Deleting "${e.id}" makes it unroutable. Clients asking for it will get a model-unavailable error, and any key allowlisting it keeps a name that no longer resolves.`,confirmLabel:`Delete model`,busy:S.isPending,onConfirm:()=>{e!==null&&S.mutate(e.id,{onSuccess:()=>{_(!1),i()},onError:e=>{_(!1),l(j(e))}})}})]})}var Ce=e.div`
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
|
|
101
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
102
|
+
align-items: start;
|
|
103
|
+
|
|
104
|
+
@media (max-width: 980px) {
|
|
105
|
+
grid-template-columns: minmax(0, 1fr);
|
|
106
|
+
}
|
|
107
|
+
`,we=e(o)`
|
|
108
|
+
gap: ${({theme:e})=>e.space(4)};
|
|
109
|
+
min-width: 0;
|
|
110
|
+
`,Te=e.button`
|
|
111
|
+
display: flex;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 4px;
|
|
114
|
+
width: 100%;
|
|
115
|
+
padding: ${({theme:e})=>`${e.space(2)} ${e.space(3)}`};
|
|
116
|
+
text-align: left;
|
|
117
|
+
background: ${({theme:e,$selected:t})=>t?e.color.accentWash:`transparent`};
|
|
118
|
+
border: 0;
|
|
119
|
+
border-left: 2px solid
|
|
120
|
+
${({theme:e,$selected:t})=>t?e.color.accent:`transparent`};
|
|
121
|
+
border-bottom: 1px solid ${({theme:e})=>e.color.rule};
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
background: ${({theme:e,$selected:t})=>t?e.color.accentWash:e.color.panelSunk};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:last-child {
|
|
129
|
+
border-bottom: 0;
|
|
130
|
+
}
|
|
131
|
+
`,Ee=e(s)`
|
|
132
|
+
font-family: ${({theme:e})=>e.font.mono};
|
|
133
|
+
font-size: 12.5px;
|
|
134
|
+
display: block;
|
|
135
|
+
max-width: 100%;
|
|
136
|
+
`,De=e.div`
|
|
137
|
+
display: flex;
|
|
138
|
+
gap: 2px;
|
|
139
|
+
`,Oe=e.span`
|
|
140
|
+
width: 12px;
|
|
141
|
+
height: 3px;
|
|
142
|
+
border-radius: 1px;
|
|
143
|
+
background: ${({$provider:e})=>`var(--p-${e})`};
|
|
144
|
+
`,$=`\0new`;function ke(){let e=d(),[n,i]=(0,F.useState)(null),a=e.data??[],o=n===$?null:a.find(e=>e.id===n)??null,s=n===$||n===null&&!e.isLoading&&a.length===0;(0,F.useEffect)(()=>{n===null&&a.length!==0&&i(a[0]?.id??null)},[a,n]);let l=e.isLoading?`Reading configured models…`:a.length===0?`No virtual models exist yet, so no client request can resolve to an upstream.`:`${a.length} model${a.length===1?``:`s`} routing to ${a.reduce((e,t)=>e+t.targets.length,0)} targets.`;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(v,{legend:`Models`,title:`Virtual models`,summary:l,actions:(0,I.jsxs)(r,{type:`button`,$variant:`primary`,onClick:()=>i($),children:[(0,I.jsx)(b,{}),`New model`]})}),(0,I.jsxs)(Ce,{children:[(0,I.jsx)(A,{legend:`Configured`,meta:`${a.length}`,flush:!0,children:e.isError?(0,I.jsx)(ne,{error:e.error,onRetry:()=>void e.refetch()}):e.isLoading?(0,I.jsx)(`div`,{style:{padding:12},children:(0,I.jsx)(M,{rows:4})}):a.length===0?(0,I.jsx)(N,{legend:`No models`,message:`Create a model to give clients something to ask for.`,action:(0,I.jsx)(r,{type:`button`,$size:`sm`,$variant:`primary`,onClick:()=>i($),children:`New model`})}):(0,I.jsx)(`div`,{children:a.map(e=>{let r=[...new Set(e.targets.map(e=>e.provider))];return(0,I.jsxs)(Te,{type:`button`,$selected:e.id===n,"aria-pressed":e.id===n,onClick:()=>i(e.id),children:[(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(Ee,{title:e.id,children:e.id}),(0,I.jsx)(f,{}),e.isAlias?(0,I.jsx)(T,{children:`alias`}):null]}),(0,I.jsxs)(p,{$gap:2,style:{width:`100%`},children:[(0,I.jsx)(De,{children:r.map(e=>(0,I.jsx)(Oe,{$provider:e,title:e},e))}),(0,I.jsx)(t,{children:e.strategy}),(0,I.jsx)(f,{}),(0,I.jsxs)(c,{$dim:!0,$size:`11px`,children:[e.targets.length,` target`,e.targets.length===1?``:`s`]})]})]},e.id)})})}),(0,I.jsxs)(we,{children:[o===null&&!s?(0,I.jsx)(A,{legend:`Editor`,children:e.isLoading?(0,I.jsx)(M,{rows:5}):(0,I.jsx)(N,{legend:`Nothing selected`,message:`Pick a model on the left to change its targets, or create a new one.`})}):(0,I.jsx)(Se,{model:o,onSaved:t=>{i(t),e.refetch()},onDeleted:()=>{i(null),e.refetch()}}),(0,I.jsx)(V,{modelId:o?.id??null})]})]})]})}var Ae=ke;export{Ae as component};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{B as e,D as t,Dt as n,F as r,Kt as i,M as a,O as o,Ot as s,j as c,k as l,v as u,y as d}from"./queries-vY5lJqBe.js";import{t as f}from"./Rack-DANVhi_U.js";import{n as p,t as m}from"./Field-DdscQ9OO.js";import{t as h}from"./Meter-Bm1oQE2U.js";import{a as g,i as _,n as v,r as y}from"./States-DPTTYUHL.js";var b=i(s(),1),x=n(),S=[{id:`tier`,label:`Tier`,blurb:`How strongly a lower tier is preferred.`},{id:`health`,label:`Health`,blurb:`Penalty for recent failures and an open breaker.`},{id:`quota`,label:`Quota`,blurb:`Preference for accounts keeping ahead of their window's burn rate.`},{id:`cost`,label:`Cost`,blurb:`Preference for the cheaper target of the candidates.`},{id:`latency`,label:`Latency`,blurb:`Preference for the faster observed first token.`},{id:`recency`,label:`Recency`,blurb:`Preference for accounts that have been idle.`}],C=[{id:`maxAttempts`,label:`Attempts per request`,hint:`How many candidates dispatch may try before giving up. 1 disables failover.`,unit:`attempts`,step:1,min:1},{id:`requestDeadlineMs`,label:`Request deadline`,hint:`How long a single client request may take across all attempts.`,unit:`ms`,step:1e3,min:1},{id:`breakerThreshold`,label:`Breaker threshold`,hint:`Consecutive failures on one account and model before it is taken out of rotation.`,unit:`failures`,step:1,min:1},{id:`breakerCooldownMs`,label:`Breaker cooldown`,hint:`Base wait before a tripped account is probed again. Doubles per extra failure.`,unit:`ms`,step:1e3,min:1},{id:`logRetentionDays`,label:`Log retention`,hint:`How long request rows are kept before maintenance prunes them.`,unit:`days`,step:1,min:1},{id:`quotaPollIntervalMs`,label:`Quota poll interval`,hint:`How often each account's provider is asked for its remaining quota. 0 disables polling. Takes effect on restart.`,unit:`ms`,step:6e4,min:0}],w=e.div`
|
|
2
|
+
display: grid;
|
|
3
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
4
|
+
gap: ${({theme:e})=>e.space(3)};
|
|
5
|
+
`,T=e(a)`
|
|
6
|
+
gap: 6px;
|
|
7
|
+
`,E=e.p`
|
|
8
|
+
font-size: 11px;
|
|
9
|
+
color: ${({theme:e})=>e.color.inkDim};
|
|
10
|
+
`,D=e.p`
|
|
11
|
+
font-size: 12px;
|
|
12
|
+
color: ${({theme:e})=>e.color.down};
|
|
13
|
+
`,O=e.p`
|
|
14
|
+
font-size: 12px;
|
|
15
|
+
color: ${({theme:e})=>e.color.ok};
|
|
16
|
+
`;function k(e){let t={};for(let n of S)t[`w.${n.id}`]=String(e.weights[n.id]);for(let n of C)t[n.id]=String(e[n.id]);return t}function A(e){let t={};for(let n of S){let r=(e[`w.${n.id}`]??``).trim(),i=Number(r);if(r.length===0||!Number.isFinite(i))return{ok:!1,problem:`${n.label} must be a number.`};t[n.id]=i}let n={};for(let t of C){let r=(e[t.id]??``).trim(),i=Number(r);if(r.length===0||!Number.isInteger(i)||i<t.min)return{ok:!1,problem:`${t.label} must be a whole number of ${t.min} or more.`};n[t.id]=i}return n.maxAttempts>10?{ok:!1,problem:`Attempts per request cannot exceed 10.`}:{ok:!0,settings:{weights:t,...n}}}function j(){let e=d(),n=u(),[i,s]=(0,b.useState)({}),[j,M]=(0,b.useState)(null),[N,P]=(0,b.useState)(!1);(0,b.useEffect)(()=>{e.data!==void 0&&s(k(e.data))},[e.data]);let F=Math.max(1e-4,...S.map(e=>Math.abs(Number(i[`w.${e.id}`])||0)));return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(f,{legend:`Settings`,title:`Routing and retention`,summary:`These apply to every request the gateway routes. Changes take effect on the next request; nothing is restarted.`,actions:(0,x.jsx)(r,{type:`button`,$variant:`primary`,disabled:n.isPending||e.isLoading,onClick:()=>{P(!1);let e=A(i);if(!e.ok){M(e.problem);return}M(null),n.mutate(e.settings,{onSuccess:()=>P(!0),onError:e=>M(_(e))})},children:n.isPending?`Saving…`:`Save changes`})}),e.isError?(0,x.jsx)(g,{legend:`Settings`,children:(0,x.jsx)(v,{error:e.error,onRetry:()=>void e.refetch()})}):e.isLoading?(0,x.jsx)(g,{legend:`Settings`,children:(0,x.jsx)(y,{rows:6})}):(0,x.jsxs)(a,{$gap:4,children:[(0,x.jsx)(g,{legend:`Scoring weights`,meta:`relative to each other`,footer:(0,x.jsxs)(l,{children:[(0,x.jsx)(t,{children:`A candidate's score is the sum of each term times its weight, then multiplied by the account and target weights.`}),(0,x.jsx)(c,{})]}),children:(0,x.jsx)(w,{children:S.map(e=>{let t=Number(i[`w.${e.id}`])||0;return(0,x.jsxs)(T,{children:[(0,x.jsx)(m,{label:e.label,children:t=>(0,x.jsx)(p,{...t,type:`number`,step:.5,value:i[`w.${e.id}`]??``,onChange:t=>s({...i,[`w.${e.id}`]:t.target.value})})}),(0,x.jsx)(h,{fraction:Math.abs(t)/F,height:4,tone:`var(--accent)`,label:`${e.label} weight ${t}`}),(0,x.jsx)(E,{children:e.blurb})]},e.id)})})}),(0,x.jsx)(g,{legend:`Limits`,children:(0,x.jsx)(w,{children:C.map(e=>(0,x.jsx)(T,{children:(0,x.jsx)(m,{label:e.label,hint:e.hint,children:n=>(0,x.jsxs)(l,{$gap:2,children:[(0,x.jsx)(p,{...n,type:`number`,min:e.min,step:e.step,value:i[e.id]??``,onChange:t=>s({...i,[e.id]:t.target.value})}),(0,x.jsx)(t,{children:e.unit})]})})},e.id))})}),j===null?null:(0,x.jsx)(D,{role:`alert`,children:j}),N&&j===null?(0,x.jsx)(O,{role:`status`,children:`Settings saved.`}):null,(0,x.jsx)(g,{legend:`Known limits`,children:(0,x.jsxs)(a,{$gap:2,children:[(0,x.jsxs)(l,{$gap:2,children:[(0,x.jsx)(o,{$dim:!0,children:`rate limits`}),(0,x.jsx)(E,{children:`Per-key rate limits are counted inside one gateway process and reset when it restarts. They are not shared across instances.`})]}),(0,x.jsxs)(l,{$gap:2,children:[(0,x.jsx)(o,{$dim:!0,children:`logs`}),(0,x.jsx)(E,{children:`Request rows record routing and token counts only. Prompts, responses, and credentials are never written.`})]})]})})]})]})}var M=j;export{M as component};
|