diff --git a/litellm/proxy/_experimental/out/404.html b/litellm/proxy/_experimental/out/404.html index ed97d67e5d6..52c9265abad 100644 --- a/litellm/proxy/_experimental/out/404.html +++ b/litellm/proxy/_experimental/out/404.html @@ -1 +1 @@ -404: This page could not be found.Create Next App

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.Create Next App

404

This page could not be found.

\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_buildManifest.js b/litellm/proxy/_experimental/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_buildManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_buildManifest.js rename to litellm/proxy/_experimental/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_buildManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_ssgManifest.js b/litellm/proxy/_experimental/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_ssgManifest.js similarity index 100% rename from litellm/proxy/_experimental/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_ssgManifest.js rename to litellm/proxy/_experimental/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_ssgManifest.js diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-390e012b130397f7.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-390e012b130397f7.js new file mode 100644 index 00000000000..468de83c62b --- /dev/null +++ b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-390e012b130397f7.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8598:function(e,t,r){Promise.resolve().then(r.t.bind(r,5250,23)),Promise.resolve().then(r.bind(r,7476))},7476:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return F}});var l=r(3827),n=r(4090),s=r(588);let a=async(e,t,r,l)=>{try{if(console.log("Form Values in keyCreateCall:",l),l.metadata)try{l.metadata=JSON.parse(l.metadata)}catch(e){s.ZP.error("Failed to parse metadata: "+e)}let n=await fetch("".concat(e,"/key/generate"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({user_id:r,...l})});if(!n.ok){let e=await n.text();throw s.ZP.error("Failed to create key: "+e),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await n.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},o=async(e,t,r)=>{try{let l=await fetch("".concat(e,"/key/delete"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({keys:[r]})});if(!l.ok)throw Error("Network response was not ok");let n=await l.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},i=async(e,t,r)=>{try{let l=await fetch("".concat(e,"/user/info?user_id=").concat(r),{method:"GET",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});if(!l.ok)throw Error("Network response was not ok");let n=await l.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}};var c=r(384),d=r(6453),h=r(2179),x=r(1801),u=r(6776),m=r(2902),j=r(7171),y=r(9714),p=r(8707),Z=r(1861);let{Option:k}=u.default;var g=e=>{let{userID:t,accessToken:r,proxyBaseUrl:o,data:i,setData:u}=e,[k]=m.Z.useForm(),[g,f]=(0,n.useState)(!1),[w,b]=(0,n.useState)(null),C=()=>{f(!1),k.resetFields()},S=()=>{f(!1),b(null),k.resetFields()},v=async e=>{try{s.ZP.info("Making API Call"),e.models&&""!==e.models.trim()?e.models=e.models.split(",").map(e=>e.trim()):e.models=[],f(!0);let l=await a(o,r,t,e);u(e=>e?[...e,l]:[l]),b(l.key),s.ZP.success("API Key Created"),k.resetFields()}catch(e){console.error("Error creating the key:",e)}};return(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"mx-auto",onClick:()=>f(!0),children:"+ Create New Key"}),(0,l.jsx)(j.Z,{title:"Create Key",visible:g,width:800,footer:null,onOk:C,onCancel:S,children:(0,l.jsxs)(m.Z,{form:k,onFinish:v,labelCol:{span:6},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsx)(m.Z.Item,{label:"Key Name",name:"key_alias",children:(0,l.jsx)(y.Z,{})}),(0,l.jsx)(m.Z.Item,{label:"Models (Comma Separated). Eg: gpt-3.5-turbo,gpt-4",name:"models",children:(0,l.jsx)(y.Z,{placeholder:"gpt-4,gpt-3.5-turbo"})}),(0,l.jsx)(m.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(p.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(m.Z.Item,{label:"Duration (eg: 30s, 30h, 30d)",name:"duration",children:(0,l.jsx)(y.Z,{})}),(0,l.jsx)(m.Z.Item,{label:"Team ID",name:"team_id",children:(0,l.jsx)(y.Z,{placeholder:"ai_team"})}),(0,l.jsx)(m.Z.Item,{label:"Metadata",name:"metadata",children:(0,l.jsx)(y.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(Z.ZP,{htmlType:"submit",children:"Create Key"})})]})}),w&&(0,l.jsx)(j.Z,{title:"Save your key",visible:g,onOk:C,onCancel:S,footer:null,children:(0,l.jsxs)(d.Z,{numItems:1,className:"gap-2 w-full",children:[(0,l.jsx)(c.Z,{numColSpan:1,children:(0,l.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,l.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,l.jsx)(c.Z,{numColSpan:1,children:null!=w?(0,l.jsxs)(x.Z,{children:["API Key: ",w]}):(0,l.jsx)(x.Z,{children:"Key being created, this might take 30s"})})]})})]})},f=r(3393),w=r(3810),b=r(1244),C=r(827),S=r(3851),v=r(2044),I=r(4167),N=r(4480),E=r(2287),D=r(2440),P=e=>{let{userID:t,accessToken:r,proxyBaseUrl:n,data:s,setData:a}=e,i=async e=>{if(null!=s)try{await o(n,r,e);let t=s.filter(t=>t.token!==e);a(t)}catch(e){console.error("Error deleting the key:",e)}};if(null!=s)return console.log("RERENDER TRIGGERED"),(0,l.jsxs)(w.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4",children:[(0,l.jsx)(D.Z,{children:"API Keys"}),(0,l.jsxs)(C.Z,{className:"mt-5",children:[(0,l.jsx)(I.Z,{children:(0,l.jsxs)(E.Z,{children:[(0,l.jsx)(N.Z,{children:"Secret Key"}),(0,l.jsx)(N.Z,{children:"Spend (USD)"}),(0,l.jsx)(N.Z,{children:"Key Budget (USD)"}),(0,l.jsx)(N.Z,{children:"Team ID"}),(0,l.jsx)(N.Z,{children:"Metadata"}),(0,l.jsx)(N.Z,{children:"Expires"})]})}),(0,l.jsx)(S.Z,{children:s.map(e=>(console.log(e),(0,l.jsxs)(E.Z,{children:[(0,l.jsx)(v.Z,{children:null!=e.key_alias?(0,l.jsx)(x.Z,{children:e.key_alias}):(0,l.jsx)(x.Z,{children:e.token})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:e.spend})}),(0,l.jsx)(v.Z,{children:null!=e.max_budget?(0,l.jsx)(x.Z,{children:e.max_budget}):(0,l.jsx)(x.Z,{children:"Unlimited Budget"})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:e.team_id})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:JSON.stringify(e.metadata)})}),(0,l.jsx)(v.Z,{children:null!=e.expires?(0,l.jsx)(x.Z,{children:e.expires}):(0,l.jsx)(x.Z,{children:"Never expires"})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(b.Z,{onClick:()=>i(e.token),icon:f.Z,size:"xs"})})]},e.token)))})]})]})},_=r(891),T=()=>{let[e,t]=(0,n.useState)(""),[r,s]=(0,n.useState)(!1),a="".concat(window.location.href,"?proxyBaseUrl=").concat(e);return(0,l.jsx)("div",{children:(0,l.jsxs)(w.Z,{decoration:"top",decorationColor:"blue",style:{width:"1000px"},children:[(0,l.jsx)(x.Z,{children:"Admin Configuration"}),(0,l.jsx)("label",{htmlFor:"proxyUrl",children:"Enter Proxy URL:"}),(0,l.jsx)(_.Z,{type:"text",id:"proxyUrl",value:e,onChange:e=>{t(e.target.value),s(!1)},placeholder:"https://your-proxy-endpoint.com"}),(0,l.jsx)(h.Z,{onClick:()=>{s(!0)},className:"gap-2",children:"Save"}),r&&(0,l.jsx)("div",{children:(0,l.jsxs)(d.Z,{numItems:1,className:"gap-2",children:[(0,l.jsx)(c.Z,{children:(0,l.jsxs)("p",{children:["Proxy Admin UI (Save this URL): ",a]})}),(0,l.jsx)(c.Z,{children:(0,l.jsxs)("p",{children:["Get Started with Proxy Admin UI \uD83D\uDC49",(0,l.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{color:"blue",textDecoration:"underline"},children:a})]})})]})})]})})},A=r(7907),U=r(7963),F=()=>{let[e,t]=(0,n.useState)(null),r=(0,A.useSearchParams)(),s=r.get("userID"),a=r.get("proxyBaseUrl"),o=r.get("token"),[h,x]=(0,n.useState)(null);if((0,n.useEffect)(()=>{if(o){let e=(0,U.o)(o);e&&(console.log("Decoded token:",e),console.log("Decoded key:",e.key),x(e.key))}s&&h&&a&&!e&&(async()=>{try{let e=await i(a,h,s);t(e.keys)}catch(e){console.error("There was an error fetching the data",e)}})()},[s,o,h,a,e]),null==a)return(0,l.jsx)("div",{children:(0,l.jsx)(T,{})});if(null==s||null==o){let e=a.endsWith("/")?a:a+"/";return window.location.href="".concat(e,"sso/key/generate"),null}return null==h?null:(0,l.jsx)(d.Z,{numItems:1,className:"gap-0 p-10 h-[75vh] w-full",children:(0,l.jsxs)(c.Z,{numColSpan:1,children:[(0,l.jsx)(P,{userID:s,accessToken:h,proxyBaseUrl:a,data:e,setData:t}),(0,l.jsx)(g,{userID:s,accessToken:h,proxyBaseUrl:a,data:e,setData:t})]})})}}},function(e){e.O(0,[291,971,69,744],function(){return e(e.s=8598)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-b376373c879283de.js b/litellm/proxy/_experimental/out/_next/static/chunks/app/page-b376373c879283de.js deleted file mode 100644 index 6c505dc6713..00000000000 --- a/litellm/proxy/_experimental/out/_next/static/chunks/app/page-b376373c879283de.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8598:function(e,r,t){Promise.resolve().then(t.t.bind(t,5250,23)),Promise.resolve().then(t.bind(t,7476))},7476:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return F}});var n=t(3827),l=t(4090);let s=async(e,r,t,n)=>{try{console.log("Form Values in keyCreateCall:",n);let l=await fetch("".concat(e,"/key/generate"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...n})});if(!l.ok){let e=await l.json();throw console.error("Error response from the server:",e),Error("Network response was not ok")}let s=await l.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},o=async(e,r,t)=>{try{let n=await fetch("".concat(e,"/key/delete"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!n.ok)throw Error("Network response was not ok");let l=await n.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},a=async(e,r,t)=>{try{let n=await fetch("".concat(e,"/user/info?user_id=").concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!n.ok)throw Error("Network response was not ok");let l=await n.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}};var i=t(384),c=t(6453),d=t(2179),h=t(1801),u=t(6776),x=t(2902),j=t(588),y=t(7171),m=t(9714),p=t(8707),Z=t(1861);let{Option:k}=u.default;var g=e=>{let{userID:r,accessToken:t,proxyBaseUrl:o,data:a,setData:u}=e,[k]=x.Z.useForm(),[g,f]=(0,l.useState)(!1),[w,b]=(0,l.useState)(null),C=()=>{f(!1),k.resetFields()},S=()=>{f(!1),b(null),k.resetFields()},v=async e=>{try{j.ZP.info("Making API Call"),e.models&&""!==e.models.trim()?e.models=e.models.split(",").map(e=>e.trim()):e.models=[],f(!0);let n=await s(o,t,r,e);u(e=>e?[...e,n]:[n]),b(n.key),j.ZP.success("API Key Created"),k.resetFields()}catch(e){console.error("Error creating the key:",e)}};return(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{className:"mx-auto",onClick:()=>f(!0),children:"+ Create New Key"}),(0,n.jsx)(y.Z,{title:"Create Key",visible:g,width:800,footer:null,onOk:C,onCancel:S,children:(0,n.jsxs)(x.Z,{form:k,onFinish:v,labelCol:{span:6},wrapperCol:{span:16},labelAlign:"left",children:[(0,n.jsx)(x.Z.Item,{label:"Key Name",name:"key_alias",children:(0,n.jsx)(m.Z,{})}),(0,n.jsx)(x.Z.Item,{label:"Models (Comma Separated). Eg: gpt-3.5-turbo,gpt-4",name:"models",children:(0,n.jsx)(m.Z,{placeholder:"gpt-4,gpt-3.5-turbo"})}),(0,n.jsx)(x.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,n.jsx)(p.Z,{step:.01,precision:2,width:200})}),(0,n.jsx)(x.Z.Item,{label:"Duration (eg: 30s, 30h, 30d)",name:"duration",children:(0,n.jsx)(m.Z,{})}),(0,n.jsx)(x.Z.Item,{label:"Metadata",name:"metadata",children:(0,n.jsx)(m.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,n.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,n.jsx)(Z.ZP,{htmlType:"submit",children:"Create Key"})})]})}),w&&(0,n.jsx)(y.Z,{title:"Save your key",visible:g,onOk:C,onCancel:S,footer:null,children:(0,n.jsxs)(c.Z,{numItems:1,className:"gap-2 w-full",children:[(0,n.jsx)(i.Z,{numColSpan:1,children:(0,n.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,n.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,n.jsx)(i.Z,{numColSpan:1,children:null!=w?(0,n.jsxs)(h.Z,{children:["API Key: ",w]}):(0,n.jsx)(h.Z,{children:"Key being created, this might take 30s"})})]})})]})},f=t(3393),w=t(3810),b=t(1244),C=t(827),S=t(3851),v=t(2044),E=t(4167),I=t(4480),N=t(2287),D=t(2440),P=e=>{let{userID:r,accessToken:t,proxyBaseUrl:l,data:s,setData:a}=e,i=async e=>{if(null!=s)try{await o(l,t,e);let r=s.filter(r=>r.token!==e);a(r)}catch(e){console.error("Error deleting the key:",e)}};if(null!=s)return console.log("RERENDER TRIGGERED"),(0,n.jsxs)(w.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4",children:[(0,n.jsx)(D.Z,{children:"API Keys"}),(0,n.jsxs)(C.Z,{className:"mt-5",children:[(0,n.jsx)(E.Z,{children:(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(I.Z,{children:"Secret Key"}),(0,n.jsx)(I.Z,{children:"Spend (USD)"}),(0,n.jsx)(I.Z,{children:"Key Budget (USD)"}),(0,n.jsx)(I.Z,{children:"Expires"})]})}),(0,n.jsx)(S.Z,{children:s.map(e=>(console.log(e),(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(v.Z,{children:null!=e.key_name?(0,n.jsx)(h.Z,{children:e.key_name}):(0,n.jsx)(h.Z,{children:e.token})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(h.Z,{children:e.spend})}),(0,n.jsx)(v.Z,{children:null!=e.max_budget?(0,n.jsx)(h.Z,{children:e.max_budget}):(0,n.jsx)(h.Z,{children:"Unlimited Budget"})}),(0,n.jsx)(v.Z,{children:null!=e.expires?(0,n.jsx)(h.Z,{children:e.expires}):(0,n.jsx)(h.Z,{children:"Never expires"})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(b.Z,{onClick:()=>i(e.token),icon:f.Z,size:"xs"})})]},e.token)))})]})]})},_=t(891),A=()=>{let[e,r]=(0,l.useState)(""),[t,s]=(0,l.useState)(!1),o="".concat(window.location.href,"?proxyBaseUrl=").concat(e);return(0,n.jsx)("div",{children:(0,n.jsxs)(w.Z,{decoration:"top",decorationColor:"blue",style:{width:"1000px"},children:[(0,n.jsx)(h.Z,{children:"Admin Configuration"}),(0,n.jsx)("label",{htmlFor:"proxyUrl",children:"Enter Proxy URL:"}),(0,n.jsx)(_.Z,{type:"text",id:"proxyUrl",value:e,onChange:e=>{r(e.target.value),s(!1)},placeholder:"https://your-proxy-endpoint.com"}),(0,n.jsx)(d.Z,{onClick:()=>{s(!0)},className:"gap-2",children:"Save"}),t&&(0,n.jsx)("div",{children:(0,n.jsxs)(c.Z,{numItems:1,className:"gap-2",children:[(0,n.jsx)(i.Z,{children:(0,n.jsxs)("p",{children:["Proxy Admin UI (Save this URL): ",o]})}),(0,n.jsx)(i.Z,{children:(0,n.jsxs)("p",{children:["Get Started with Proxy Admin UI \uD83D\uDC49",(0,n.jsx)("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"blue",textDecoration:"underline"},children:o})]})})]})})]})})},U=t(7907),T=t(7963),F=()=>{let[e,r]=(0,l.useState)(null),t=(0,U.useSearchParams)(),s=t.get("userID"),o=t.get("proxyBaseUrl"),d=t.get("token"),[h,u]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(d){let e=(0,T.o)(d);e&&(console.log("Decoded token:",e),console.log("Decoded key:",e.key),u(e.key))}s&&h&&o&&!e&&(async()=>{try{let e=await a(o,h,s);r(e.keys)}catch(e){console.error("There was an error fetching the data",e)}})()},[s,d,h,o,e]),null==o)return(0,n.jsx)("div",{children:(0,n.jsx)(A,{})});if(null==s||null==d){let e=o.endsWith("/")?o:o+"/";return window.location.href="".concat(e,"sso/key/generate"),null}return null==h?null:(0,n.jsx)(c.Z,{numItems:1,className:"gap-0 p-10 h-[75vh] w-full",children:(0,n.jsxs)(i.Z,{numColSpan:1,children:[(0,n.jsx)(P,{userID:s,accessToken:h,proxyBaseUrl:o,data:e,setData:r}),(0,n.jsx)(g,{userID:s,accessToken:h,proxyBaseUrl:o,data:e,setData:r})]})})}}},function(e){e.O(0,[291,971,69,744],function(){return e(e.s=8598)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.html b/litellm/proxy/_experimental/out/index.html index d7fcd4fbbe4..1268e8bedca 100644 --- a/litellm/proxy/_experimental/out/index.html +++ b/litellm/proxy/_experimental/out/index.html @@ -1 +1 @@ -Create Next App
Loading...
\ No newline at end of file +Create Next App
Loading...
\ No newline at end of file diff --git a/litellm/proxy/_experimental/out/index.txt b/litellm/proxy/_experimental/out/index.txt index cb83d12e70e..c2aa067a46e 100644 --- a/litellm/proxy/_experimental/out/index.txt +++ b/litellm/proxy/_experimental/out/index.txt @@ -1,8 +1,8 @@ 2:"$Sreact.suspense" -3:I[5250,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-b376373c879283de.js"],""] -4:I[7476,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-b376373c879283de.js"],""] +3:I[5250,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-390e012b130397f7.js"],""] +4:I[7476,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-390e012b130397f7.js"],""] 5:I[5613,[],""] 6:I[1778,[],""] -0:["FyY3KX_tIybXFPWL2RGlt",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"fallback":["$","div",null,{"children":"Loading..."}],"children":["$","div",null,{"className":"flex min-h-screen flex-col items-center","children":[["$","nav",null,{"className":"left-0 right-0 top-0 flex justify-between items-center h-12","children":[["$","div",null,{"className":"text-left mx-4 my-2 absolute top-0 left-0","children":["$","div",null,{"className":"flex flex-col items-center","children":["$","$L3",null,{"href":"/","children":["$","button",null,{"className":"text-gray-800 text-2xl px-4 py-1 rounded text-center","children":"🚅 LiteLLM"}]}]}]}],["$","div",null,{"className":"text-right mx-4 my-2 absolute top-0 right-0","children":[["$","a",null,{"href":"https://docs.litellm.ai/docs/","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 mr-2 text-center","children":"Docs"}]}],["$","a",null,{"href":"https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 text-center","children":"Schedule Demo"}]}]]}]]}],["$","$L4",null,{}]]}]}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/7384ba6288e79f81.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] +0:["8YrDFJdukjBa2XHc3AeKh",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"fallback":["$","div",null,{"children":"Loading..."}],"children":["$","div",null,{"className":"flex min-h-screen flex-col items-center","children":[["$","nav",null,{"className":"left-0 right-0 top-0 flex justify-between items-center h-12","children":[["$","div",null,{"className":"text-left mx-4 my-2 absolute top-0 left-0","children":["$","div",null,{"className":"flex flex-col items-center","children":["$","$L3",null,{"href":"/","children":["$","button",null,{"className":"text-gray-800 text-2xl px-4 py-1 rounded text-center","children":"🚅 LiteLLM"}]}]}]}],["$","div",null,{"className":"text-right mx-4 my-2 absolute top-0 right-0","children":[["$","a",null,{"href":"https://docs.litellm.ai/docs/","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 mr-2 text-center","children":"Docs"}]}],["$","a",null,{"href":"https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 text-center","children":"Schedule Demo"}]}]]}]]}],["$","$L4",null,{}]]}]}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/7384ba6288e79f81.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Create Next App"}],["$","meta","3",{"name":"description","content":"Generated by create next app"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/ui/litellm-dashboard/out/404.html b/ui/litellm-dashboard/out/404.html index ed97d67e5d6..52c9265abad 100644 --- a/ui/litellm-dashboard/out/404.html +++ b/ui/litellm-dashboard/out/404.html @@ -1 +1 @@ -404: This page could not be found.Create Next App

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.Create Next App

404

This page could not be found.

\ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_buildManifest.js b/ui/litellm-dashboard/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_buildManifest.js similarity index 100% rename from ui/litellm-dashboard/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_buildManifest.js rename to ui/litellm-dashboard/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_buildManifest.js diff --git a/ui/litellm-dashboard/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_ssgManifest.js b/ui/litellm-dashboard/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_ssgManifest.js similarity index 100% rename from ui/litellm-dashboard/out/_next/static/FyY3KX_tIybXFPWL2RGlt/_ssgManifest.js rename to ui/litellm-dashboard/out/_next/static/8YrDFJdukjBa2XHc3AeKh/_ssgManifest.js diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-390e012b130397f7.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-390e012b130397f7.js new file mode 100644 index 00000000000..468de83c62b --- /dev/null +++ b/ui/litellm-dashboard/out/_next/static/chunks/app/page-390e012b130397f7.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8598:function(e,t,r){Promise.resolve().then(r.t.bind(r,5250,23)),Promise.resolve().then(r.bind(r,7476))},7476:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return F}});var l=r(3827),n=r(4090),s=r(588);let a=async(e,t,r,l)=>{try{if(console.log("Form Values in keyCreateCall:",l),l.metadata)try{l.metadata=JSON.parse(l.metadata)}catch(e){s.ZP.error("Failed to parse metadata: "+e)}let n=await fetch("".concat(e,"/key/generate"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({user_id:r,...l})});if(!n.ok){let e=await n.text();throw s.ZP.error("Failed to create key: "+e),console.error("Error response from the server:",e),Error("Network response was not ok")}let a=await n.json();return console.log("API Response:",a),a}catch(e){throw console.error("Failed to create key:",e),e}},o=async(e,t,r)=>{try{let l=await fetch("".concat(e,"/key/delete"),{method:"POST",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},body:JSON.stringify({keys:[r]})});if(!l.ok)throw Error("Network response was not ok");let n=await l.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}},i=async(e,t,r)=>{try{let l=await fetch("".concat(e,"/user/info?user_id=").concat(r),{method:"GET",headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});if(!l.ok)throw Error("Network response was not ok");let n=await l.json();return console.log(n),n}catch(e){throw console.error("Failed to create key:",e),e}};var c=r(384),d=r(6453),h=r(2179),x=r(1801),u=r(6776),m=r(2902),j=r(7171),y=r(9714),p=r(8707),Z=r(1861);let{Option:k}=u.default;var g=e=>{let{userID:t,accessToken:r,proxyBaseUrl:o,data:i,setData:u}=e,[k]=m.Z.useForm(),[g,f]=(0,n.useState)(!1),[w,b]=(0,n.useState)(null),C=()=>{f(!1),k.resetFields()},S=()=>{f(!1),b(null),k.resetFields()},v=async e=>{try{s.ZP.info("Making API Call"),e.models&&""!==e.models.trim()?e.models=e.models.split(",").map(e=>e.trim()):e.models=[],f(!0);let l=await a(o,r,t,e);u(e=>e?[...e,l]:[l]),b(l.key),s.ZP.success("API Key Created"),k.resetFields()}catch(e){console.error("Error creating the key:",e)}};return(0,l.jsxs)("div",{children:[(0,l.jsx)(h.Z,{className:"mx-auto",onClick:()=>f(!0),children:"+ Create New Key"}),(0,l.jsx)(j.Z,{title:"Create Key",visible:g,width:800,footer:null,onOk:C,onCancel:S,children:(0,l.jsxs)(m.Z,{form:k,onFinish:v,labelCol:{span:6},wrapperCol:{span:16},labelAlign:"left",children:[(0,l.jsx)(m.Z.Item,{label:"Key Name",name:"key_alias",children:(0,l.jsx)(y.Z,{})}),(0,l.jsx)(m.Z.Item,{label:"Models (Comma Separated). Eg: gpt-3.5-turbo,gpt-4",name:"models",children:(0,l.jsx)(y.Z,{placeholder:"gpt-4,gpt-3.5-turbo"})}),(0,l.jsx)(m.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,l.jsx)(p.Z,{step:.01,precision:2,width:200})}),(0,l.jsx)(m.Z.Item,{label:"Duration (eg: 30s, 30h, 30d)",name:"duration",children:(0,l.jsx)(y.Z,{})}),(0,l.jsx)(m.Z.Item,{label:"Team ID",name:"team_id",children:(0,l.jsx)(y.Z,{placeholder:"ai_team"})}),(0,l.jsx)(m.Z.Item,{label:"Metadata",name:"metadata",children:(0,l.jsx)(y.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,l.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,l.jsx)(Z.ZP,{htmlType:"submit",children:"Create Key"})})]})}),w&&(0,l.jsx)(j.Z,{title:"Save your key",visible:g,onOk:C,onCancel:S,footer:null,children:(0,l.jsxs)(d.Z,{numItems:1,className:"gap-2 w-full",children:[(0,l.jsx)(c.Z,{numColSpan:1,children:(0,l.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,l.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,l.jsx)(c.Z,{numColSpan:1,children:null!=w?(0,l.jsxs)(x.Z,{children:["API Key: ",w]}):(0,l.jsx)(x.Z,{children:"Key being created, this might take 30s"})})]})})]})},f=r(3393),w=r(3810),b=r(1244),C=r(827),S=r(3851),v=r(2044),I=r(4167),N=r(4480),E=r(2287),D=r(2440),P=e=>{let{userID:t,accessToken:r,proxyBaseUrl:n,data:s,setData:a}=e,i=async e=>{if(null!=s)try{await o(n,r,e);let t=s.filter(t=>t.token!==e);a(t)}catch(e){console.error("Error deleting the key:",e)}};if(null!=s)return console.log("RERENDER TRIGGERED"),(0,l.jsxs)(w.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4",children:[(0,l.jsx)(D.Z,{children:"API Keys"}),(0,l.jsxs)(C.Z,{className:"mt-5",children:[(0,l.jsx)(I.Z,{children:(0,l.jsxs)(E.Z,{children:[(0,l.jsx)(N.Z,{children:"Secret Key"}),(0,l.jsx)(N.Z,{children:"Spend (USD)"}),(0,l.jsx)(N.Z,{children:"Key Budget (USD)"}),(0,l.jsx)(N.Z,{children:"Team ID"}),(0,l.jsx)(N.Z,{children:"Metadata"}),(0,l.jsx)(N.Z,{children:"Expires"})]})}),(0,l.jsx)(S.Z,{children:s.map(e=>(console.log(e),(0,l.jsxs)(E.Z,{children:[(0,l.jsx)(v.Z,{children:null!=e.key_alias?(0,l.jsx)(x.Z,{children:e.key_alias}):(0,l.jsx)(x.Z,{children:e.token})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:e.spend})}),(0,l.jsx)(v.Z,{children:null!=e.max_budget?(0,l.jsx)(x.Z,{children:e.max_budget}):(0,l.jsx)(x.Z,{children:"Unlimited Budget"})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:e.team_id})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(x.Z,{children:JSON.stringify(e.metadata)})}),(0,l.jsx)(v.Z,{children:null!=e.expires?(0,l.jsx)(x.Z,{children:e.expires}):(0,l.jsx)(x.Z,{children:"Never expires"})}),(0,l.jsx)(v.Z,{children:(0,l.jsx)(b.Z,{onClick:()=>i(e.token),icon:f.Z,size:"xs"})})]},e.token)))})]})]})},_=r(891),T=()=>{let[e,t]=(0,n.useState)(""),[r,s]=(0,n.useState)(!1),a="".concat(window.location.href,"?proxyBaseUrl=").concat(e);return(0,l.jsx)("div",{children:(0,l.jsxs)(w.Z,{decoration:"top",decorationColor:"blue",style:{width:"1000px"},children:[(0,l.jsx)(x.Z,{children:"Admin Configuration"}),(0,l.jsx)("label",{htmlFor:"proxyUrl",children:"Enter Proxy URL:"}),(0,l.jsx)(_.Z,{type:"text",id:"proxyUrl",value:e,onChange:e=>{t(e.target.value),s(!1)},placeholder:"https://your-proxy-endpoint.com"}),(0,l.jsx)(h.Z,{onClick:()=>{s(!0)},className:"gap-2",children:"Save"}),r&&(0,l.jsx)("div",{children:(0,l.jsxs)(d.Z,{numItems:1,className:"gap-2",children:[(0,l.jsx)(c.Z,{children:(0,l.jsxs)("p",{children:["Proxy Admin UI (Save this URL): ",a]})}),(0,l.jsx)(c.Z,{children:(0,l.jsxs)("p",{children:["Get Started with Proxy Admin UI \uD83D\uDC49",(0,l.jsx)("a",{href:a,target:"_blank",rel:"noopener noreferrer",style:{color:"blue",textDecoration:"underline"},children:a})]})})]})})]})})},A=r(7907),U=r(7963),F=()=>{let[e,t]=(0,n.useState)(null),r=(0,A.useSearchParams)(),s=r.get("userID"),a=r.get("proxyBaseUrl"),o=r.get("token"),[h,x]=(0,n.useState)(null);if((0,n.useEffect)(()=>{if(o){let e=(0,U.o)(o);e&&(console.log("Decoded token:",e),console.log("Decoded key:",e.key),x(e.key))}s&&h&&a&&!e&&(async()=>{try{let e=await i(a,h,s);t(e.keys)}catch(e){console.error("There was an error fetching the data",e)}})()},[s,o,h,a,e]),null==a)return(0,l.jsx)("div",{children:(0,l.jsx)(T,{})});if(null==s||null==o){let e=a.endsWith("/")?a:a+"/";return window.location.href="".concat(e,"sso/key/generate"),null}return null==h?null:(0,l.jsx)(d.Z,{numItems:1,className:"gap-0 p-10 h-[75vh] w-full",children:(0,l.jsxs)(c.Z,{numColSpan:1,children:[(0,l.jsx)(P,{userID:s,accessToken:h,proxyBaseUrl:a,data:e,setData:t}),(0,l.jsx)(g,{userID:s,accessToken:h,proxyBaseUrl:a,data:e,setData:t})]})})}}},function(e){e.O(0,[291,971,69,744],function(){return e(e.s=8598)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/_next/static/chunks/app/page-b376373c879283de.js b/ui/litellm-dashboard/out/_next/static/chunks/app/page-b376373c879283de.js deleted file mode 100644 index 6c505dc6713..00000000000 --- a/ui/litellm-dashboard/out/_next/static/chunks/app/page-b376373c879283de.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{8598:function(e,r,t){Promise.resolve().then(t.t.bind(t,5250,23)),Promise.resolve().then(t.bind(t,7476))},7476:function(e,r,t){"use strict";t.r(r),t.d(r,{default:function(){return F}});var n=t(3827),l=t(4090);let s=async(e,r,t,n)=>{try{console.log("Form Values in keyCreateCall:",n);let l=await fetch("".concat(e,"/key/generate"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({user_id:t,...n})});if(!l.ok){let e=await l.json();throw console.error("Error response from the server:",e),Error("Network response was not ok")}let s=await l.json();return console.log("API Response:",s),s}catch(e){throw console.error("Failed to create key:",e),e}},o=async(e,r,t)=>{try{let n=await fetch("".concat(e,"/key/delete"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({keys:[t]})});if(!n.ok)throw Error("Network response was not ok");let l=await n.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}},a=async(e,r,t)=>{try{let n=await fetch("".concat(e,"/user/info?user_id=").concat(t),{method:"GET",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"}});if(!n.ok)throw Error("Network response was not ok");let l=await n.json();return console.log(l),l}catch(e){throw console.error("Failed to create key:",e),e}};var i=t(384),c=t(6453),d=t(2179),h=t(1801),u=t(6776),x=t(2902),j=t(588),y=t(7171),m=t(9714),p=t(8707),Z=t(1861);let{Option:k}=u.default;var g=e=>{let{userID:r,accessToken:t,proxyBaseUrl:o,data:a,setData:u}=e,[k]=x.Z.useForm(),[g,f]=(0,l.useState)(!1),[w,b]=(0,l.useState)(null),C=()=>{f(!1),k.resetFields()},S=()=>{f(!1),b(null),k.resetFields()},v=async e=>{try{j.ZP.info("Making API Call"),e.models&&""!==e.models.trim()?e.models=e.models.split(",").map(e=>e.trim()):e.models=[],f(!0);let n=await s(o,t,r,e);u(e=>e?[...e,n]:[n]),b(n.key),j.ZP.success("API Key Created"),k.resetFields()}catch(e){console.error("Error creating the key:",e)}};return(0,n.jsxs)("div",{children:[(0,n.jsx)(d.Z,{className:"mx-auto",onClick:()=>f(!0),children:"+ Create New Key"}),(0,n.jsx)(y.Z,{title:"Create Key",visible:g,width:800,footer:null,onOk:C,onCancel:S,children:(0,n.jsxs)(x.Z,{form:k,onFinish:v,labelCol:{span:6},wrapperCol:{span:16},labelAlign:"left",children:[(0,n.jsx)(x.Z.Item,{label:"Key Name",name:"key_alias",children:(0,n.jsx)(m.Z,{})}),(0,n.jsx)(x.Z.Item,{label:"Models (Comma Separated). Eg: gpt-3.5-turbo,gpt-4",name:"models",children:(0,n.jsx)(m.Z,{placeholder:"gpt-4,gpt-3.5-turbo"})}),(0,n.jsx)(x.Z.Item,{label:"Max Budget (USD)",name:"max_budget",children:(0,n.jsx)(p.Z,{step:.01,precision:2,width:200})}),(0,n.jsx)(x.Z.Item,{label:"Duration (eg: 30s, 30h, 30d)",name:"duration",children:(0,n.jsx)(m.Z,{})}),(0,n.jsx)(x.Z.Item,{label:"Metadata",name:"metadata",children:(0,n.jsx)(m.Z.TextArea,{rows:4,placeholder:"Enter metadata as JSON"})}),(0,n.jsx)("div",{style:{textAlign:"right",marginTop:"10px"},children:(0,n.jsx)(Z.ZP,{htmlType:"submit",children:"Create Key"})})]})}),w&&(0,n.jsx)(y.Z,{title:"Save your key",visible:g,onOk:C,onCancel:S,footer:null,children:(0,n.jsxs)(c.Z,{numItems:1,className:"gap-2 w-full",children:[(0,n.jsx)(i.Z,{numColSpan:1,children:(0,n.jsxs)("p",{children:["Please save this secret key somewhere safe and accessible. For security reasons, ",(0,n.jsx)("b",{children:"you will not be able to view it again"})," ","through your LiteLLM account. If you lose this secret key, you will need to generate a new one."]})}),(0,n.jsx)(i.Z,{numColSpan:1,children:null!=w?(0,n.jsxs)(h.Z,{children:["API Key: ",w]}):(0,n.jsx)(h.Z,{children:"Key being created, this might take 30s"})})]})})]})},f=t(3393),w=t(3810),b=t(1244),C=t(827),S=t(3851),v=t(2044),E=t(4167),I=t(4480),N=t(2287),D=t(2440),P=e=>{let{userID:r,accessToken:t,proxyBaseUrl:l,data:s,setData:a}=e,i=async e=>{if(null!=s)try{await o(l,t,e);let r=s.filter(r=>r.token!==e);a(r)}catch(e){console.error("Error deleting the key:",e)}};if(null!=s)return console.log("RERENDER TRIGGERED"),(0,n.jsxs)(w.Z,{className:"w-full mx-auto flex-auto overflow-y-auto max-h-[50vh] mb-4",children:[(0,n.jsx)(D.Z,{children:"API Keys"}),(0,n.jsxs)(C.Z,{className:"mt-5",children:[(0,n.jsx)(E.Z,{children:(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(I.Z,{children:"Secret Key"}),(0,n.jsx)(I.Z,{children:"Spend (USD)"}),(0,n.jsx)(I.Z,{children:"Key Budget (USD)"}),(0,n.jsx)(I.Z,{children:"Expires"})]})}),(0,n.jsx)(S.Z,{children:s.map(e=>(console.log(e),(0,n.jsxs)(N.Z,{children:[(0,n.jsx)(v.Z,{children:null!=e.key_name?(0,n.jsx)(h.Z,{children:e.key_name}):(0,n.jsx)(h.Z,{children:e.token})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(h.Z,{children:e.spend})}),(0,n.jsx)(v.Z,{children:null!=e.max_budget?(0,n.jsx)(h.Z,{children:e.max_budget}):(0,n.jsx)(h.Z,{children:"Unlimited Budget"})}),(0,n.jsx)(v.Z,{children:null!=e.expires?(0,n.jsx)(h.Z,{children:e.expires}):(0,n.jsx)(h.Z,{children:"Never expires"})}),(0,n.jsx)(v.Z,{children:(0,n.jsx)(b.Z,{onClick:()=>i(e.token),icon:f.Z,size:"xs"})})]},e.token)))})]})]})},_=t(891),A=()=>{let[e,r]=(0,l.useState)(""),[t,s]=(0,l.useState)(!1),o="".concat(window.location.href,"?proxyBaseUrl=").concat(e);return(0,n.jsx)("div",{children:(0,n.jsxs)(w.Z,{decoration:"top",decorationColor:"blue",style:{width:"1000px"},children:[(0,n.jsx)(h.Z,{children:"Admin Configuration"}),(0,n.jsx)("label",{htmlFor:"proxyUrl",children:"Enter Proxy URL:"}),(0,n.jsx)(_.Z,{type:"text",id:"proxyUrl",value:e,onChange:e=>{r(e.target.value),s(!1)},placeholder:"https://your-proxy-endpoint.com"}),(0,n.jsx)(d.Z,{onClick:()=>{s(!0)},className:"gap-2",children:"Save"}),t&&(0,n.jsx)("div",{children:(0,n.jsxs)(c.Z,{numItems:1,className:"gap-2",children:[(0,n.jsx)(i.Z,{children:(0,n.jsxs)("p",{children:["Proxy Admin UI (Save this URL): ",o]})}),(0,n.jsx)(i.Z,{children:(0,n.jsxs)("p",{children:["Get Started with Proxy Admin UI \uD83D\uDC49",(0,n.jsx)("a",{href:o,target:"_blank",rel:"noopener noreferrer",style:{color:"blue",textDecoration:"underline"},children:o})]})})]})})]})})},U=t(7907),T=t(7963),F=()=>{let[e,r]=(0,l.useState)(null),t=(0,U.useSearchParams)(),s=t.get("userID"),o=t.get("proxyBaseUrl"),d=t.get("token"),[h,u]=(0,l.useState)(null);if((0,l.useEffect)(()=>{if(d){let e=(0,T.o)(d);e&&(console.log("Decoded token:",e),console.log("Decoded key:",e.key),u(e.key))}s&&h&&o&&!e&&(async()=>{try{let e=await a(o,h,s);r(e.keys)}catch(e){console.error("There was an error fetching the data",e)}})()},[s,d,h,o,e]),null==o)return(0,n.jsx)("div",{children:(0,n.jsx)(A,{})});if(null==s||null==d){let e=o.endsWith("/")?o:o+"/";return window.location.href="".concat(e,"sso/key/generate"),null}return null==h?null:(0,n.jsx)(c.Z,{numItems:1,className:"gap-0 p-10 h-[75vh] w-full",children:(0,n.jsxs)(i.Z,{numColSpan:1,children:[(0,n.jsx)(P,{userID:s,accessToken:h,proxyBaseUrl:o,data:e,setData:r}),(0,n.jsx)(g,{userID:s,accessToken:h,proxyBaseUrl:o,data:e,setData:r})]})})}}},function(e){e.O(0,[291,971,69,744],function(){return e(e.s=8598)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/ui/litellm-dashboard/out/index.html b/ui/litellm-dashboard/out/index.html index d7fcd4fbbe4..1268e8bedca 100644 --- a/ui/litellm-dashboard/out/index.html +++ b/ui/litellm-dashboard/out/index.html @@ -1 +1 @@ -Create Next App
Loading...
\ No newline at end of file +Create Next App
Loading...
\ No newline at end of file diff --git a/ui/litellm-dashboard/out/index.txt b/ui/litellm-dashboard/out/index.txt index cb83d12e70e..c2aa067a46e 100644 --- a/ui/litellm-dashboard/out/index.txt +++ b/ui/litellm-dashboard/out/index.txt @@ -1,8 +1,8 @@ 2:"$Sreact.suspense" -3:I[5250,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-b376373c879283de.js"],""] -4:I[7476,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-b376373c879283de.js"],""] +3:I[5250,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-390e012b130397f7.js"],""] +4:I[7476,["291","static/chunks/291-b42f47441ebb3671.js","931","static/chunks/app/page-390e012b130397f7.js"],""] 5:I[5613,[],""] 6:I[1778,[],""] -0:["FyY3KX_tIybXFPWL2RGlt",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"fallback":["$","div",null,{"children":"Loading..."}],"children":["$","div",null,{"className":"flex min-h-screen flex-col items-center","children":[["$","nav",null,{"className":"left-0 right-0 top-0 flex justify-between items-center h-12","children":[["$","div",null,{"className":"text-left mx-4 my-2 absolute top-0 left-0","children":["$","div",null,{"className":"flex flex-col items-center","children":["$","$L3",null,{"href":"/","children":["$","button",null,{"className":"text-gray-800 text-2xl px-4 py-1 rounded text-center","children":"🚅 LiteLLM"}]}]}]}],["$","div",null,{"className":"text-right mx-4 my-2 absolute top-0 right-0","children":[["$","a",null,{"href":"https://docs.litellm.ai/docs/","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 mr-2 text-center","children":"Docs"}]}],["$","a",null,{"href":"https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 text-center","children":"Schedule Demo"}]}]]}]]}],["$","$L4",null,{}]]}]}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/7384ba6288e79f81.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] +0:["8YrDFJdukjBa2XHc3AeKh",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},["$L1",["$","$2",null,{"fallback":["$","div",null,{"children":"Loading..."}],"children":["$","div",null,{"className":"flex min-h-screen flex-col items-center","children":[["$","nav",null,{"className":"left-0 right-0 top-0 flex justify-between items-center h-12","children":[["$","div",null,{"className":"text-left mx-4 my-2 absolute top-0 left-0","children":["$","div",null,{"className":"flex flex-col items-center","children":["$","$L3",null,{"href":"/","children":["$","button",null,{"className":"text-gray-800 text-2xl px-4 py-1 rounded text-center","children":"🚅 LiteLLM"}]}]}]}],["$","div",null,{"className":"text-right mx-4 my-2 absolute top-0 right-0","children":[["$","a",null,{"href":"https://docs.litellm.ai/docs/","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 mr-2 text-center","children":"Docs"}]}],["$","a",null,{"href":"https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version","target":"_blank","rel":"noopener noreferrer","children":["$","button",null,{"className":"border border-gray-800 rounded-lg text-gray-800 text-xl px-4 py-1 rounded p-1 text-center","children":"Schedule Demo"}]}]]}]]}],["$","$L4",null,{}]]}]}],null]]},[null,["$","html",null,{"lang":"en","children":["$","body",null,{"className":"__className_c23dc8","children":["$","$L5",null,{"parallelRouterKey":"children","segmentPath":["children"],"loading":"$undefined","loadingStyles":"$undefined","loadingScripts":"$undefined","hasLoading":false,"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L6",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}]}],null]],[[["$","link","0",{"rel":"stylesheet","href":"/ui/_next/static/css/7384ba6288e79f81.css","precedence":"next","crossOrigin":""}]],"$L7"]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"Create Next App"}],["$","meta","3",{"name":"description","content":"Generated by create next app"}],["$","link","4",{"rel":"icon","href":"/ui/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null