xinference 0.9.0__py3-none-any.whl → 0.9.2__py3-none-any.whl

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.

Potentially problematic release.


This version of xinference might be problematic. Click here for more details.

Files changed (47) hide show
  1. xinference/_version.py +3 -3
  2. xinference/api/restful_api.py +33 -0
  3. xinference/client/common.py +2 -0
  4. xinference/client/restful/restful_client.py +49 -17
  5. xinference/conftest.py +4 -1
  6. xinference/core/supervisor.py +11 -1
  7. xinference/core/worker.py +29 -9
  8. xinference/deploy/cmdline.py +73 -2
  9. xinference/deploy/utils.py +25 -1
  10. xinference/device_utils.py +0 -2
  11. xinference/model/core.py +13 -2
  12. xinference/model/image/core.py +16 -2
  13. xinference/model/image/stable_diffusion/core.py +25 -2
  14. xinference/model/llm/__init__.py +17 -0
  15. xinference/model/llm/core.py +18 -2
  16. xinference/model/llm/ggml/llamacpp.py +3 -19
  17. xinference/model/llm/llm_family.json +8 -3
  18. xinference/model/llm/llm_family.py +100 -29
  19. xinference/model/llm/llm_family_modelscope.json +57 -3
  20. xinference/model/llm/pytorch/baichuan.py +2 -0
  21. xinference/model/llm/pytorch/chatglm.py +2 -0
  22. xinference/model/llm/pytorch/core.py +23 -0
  23. xinference/model/llm/pytorch/falcon.py +4 -0
  24. xinference/model/llm/pytorch/internlm2.py +2 -0
  25. xinference/model/llm/pytorch/llama_2.py +4 -0
  26. xinference/model/llm/pytorch/qwen_vl.py +1 -0
  27. xinference/model/llm/pytorch/vicuna.py +2 -0
  28. xinference/model/llm/pytorch/yi_vl.py +1 -0
  29. xinference/types.py +5 -2
  30. xinference/web/ui/build/asset-manifest.json +3 -3
  31. xinference/web/ui/build/index.html +1 -1
  32. xinference/web/ui/build/static/js/{main.87d39ffb.js → main.78829790.js} +3 -3
  33. xinference/web/ui/build/static/js/main.78829790.js.map +1 -0
  34. xinference/web/ui/node_modules/.cache/babel-loader/18e5d5422e2464abf4a3e6d38164570e2e426e0a921e9a2628bbae81b18da353.json +1 -0
  35. xinference/web/ui/node_modules/.cache/babel-loader/98b7ef307f436affe13d75a4f265b27e828ccc2b10ffae6513abe2681bc11971.json +1 -0
  36. xinference/web/ui/node_modules/.cache/babel-loader/e8687f75d2adacd34852b71c41ca17203d6fb4c8999ea55325bb2939f9d9ea90.json +1 -0
  37. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/METADATA +7 -5
  38. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/RECORD +43 -43
  39. xinference/web/ui/build/static/js/main.87d39ffb.js.map +0 -1
  40. xinference/web/ui/node_modules/.cache/babel-loader/0738899eefad7f90261125823d87ea9f0d53667b1479a0c1f398aff14f2bbd2a.json +0 -1
  41. xinference/web/ui/node_modules/.cache/babel-loader/64accc515dc6cd584a2873796cd7da6f93de57f7e465eb5423cca9a2f3fe3eff.json +0 -1
  42. xinference/web/ui/node_modules/.cache/babel-loader/77d4d795f078408fa2dd49da26d1ba1543d51b63cc253e736f4bef2e6014e888.json +0 -1
  43. /xinference/web/ui/build/static/js/{main.87d39ffb.js.LICENSE.txt → main.78829790.js.LICENSE.txt} +0 -0
  44. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/LICENSE +0 -0
  45. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/WHEEL +0 -0
  46. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/entry_points.txt +0 -0
  47. {xinference-0.9.0.dist-info → xinference-0.9.2.dist-info}/top_level.txt +0 -0
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _regeneratorRuntime from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js\";import _asyncToGenerator from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Checkbox,FormControl,FormControlLabel,FormHelperText,Radio,RadioGroup,Tab}from'@mui/material';import Alert from'@mui/material/Alert';import AlertTitle from'@mui/material/AlertTitle';import Button from'@mui/material/Button';import TextField from'@mui/material/TextField';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import Title from'../../components/Title';import{useMode}from'../../theme';import RegisterEmbeddingModel from'./register_embedding';import RegisterRerankModel from'./register_rerank';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var SUPPORTED_LANGUAGES_DICT={en:'English',zh:'Chinese'};var SUPPORTED_FEATURES=['Generate','Chat'];// Convert dictionary of supported languages into list\nvar SUPPORTED_LANGUAGES=Object.keys(SUPPORTED_LANGUAGES_DICT);var RegisterModel=function RegisterModel(){var ERROR_COLOR=useMode();var endPoint=useContext(ApiContext).endPoint;var _useContext=useContext(ApiContext),setErrorMsg=_useContext.setErrorMsg;var _useState=useState(''),_useState2=_slicedToArray(_useState,2),successMsg=_useState2[0],setSuccessMsg=_useState2[1];var _useState3=useState('pytorch'),_useState4=_slicedToArray(_useState3,2),modelFormat=_useState4[0],setModelFormat=_useState4[1];var _useState5=useState(7),_useState6=_slicedToArray(_useState5,2),modelSize=_useState6[0],setModelSize=_useState6[1];var _useState7=useState('/path/to/llama-2'),_useState8=_slicedToArray(_useState7,2),modelUri=_useState8[0],setModelUri=_useState8[1];var _useState9=useState(''),_useState10=_slicedToArray(_useState9,2),quantization=_useState10[0],setQuantization=_useState10[1];var _useState11=useState({version:1,context_length:2048,model_name:'custom-llama-2',model_lang:['en'],model_ability:['generate'],model_description:'This is a custom model description.',model_family:'',model_specs:[],prompt_style:undefined}),_useState12=_slicedToArray(_useState11,2),formData=_useState12[0],setFormData=_useState12[1];var _useState13=useState([]),_useState14=_slicedToArray(_useState13,2),promptStyles=_useState14[0],setPromptStyles=_useState14[1];var _useState15=useState({chat:[],generate:[]}),_useState16=_slicedToArray(_useState15,2),family=_useState16[0],setFamily=_useState16[1];var _useState17=useState(''),_useState18=_slicedToArray(_useState17,2),familyLabel=_useState18[0],setFamilyLabel=_useState18[1];var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var errorModelName=formData.model_name.trim().length<=0;var errorModelDescription=formData.model_description.length<0;var errorContextLength=formData.context_length===0;var errorLanguage=formData.model_lang===undefined||formData.model_lang.length===0;var errorAbility=formData.model_ability===undefined||formData.model_ability.length===0;var errorModelSize=formData.model_specs&&formData.model_specs.some(function(spec){return spec.model_size_in_billions===undefined||spec.model_size_in_billions===0;});var errorFamily=familyLabel==='';var errorAny=errorModelName||errorModelDescription||errorContextLength||errorLanguage||errorAbility||errorModelSize||errorFamily;useEffect(function(){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token==='need_auth'){navigate('/login',{replace:true});return;}var getBuiltinFamilies=/*#__PURE__*/function(){var _ref=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(){var response,errorData,data;return _regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:_context.next=2;return fetch(endPoint+'/v1/models/families',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context.sent;if(response.ok){_context.next=10;break;}_context.next=6;return response.json();case 6:errorData=_context.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context.next=16;break;case 10:_context.next=12;return response.json();case 12:data=_context.sent;data.chat.push('other');data.generate.push('other');setFamily(data);case 16:case\"end\":return _context.stop();}},_callee);}));return function getBuiltinFamilies(){return _ref.apply(this,arguments);};}();var getBuiltInPromptStyles=/*#__PURE__*/function(){var _ref2=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(){var response,errorData,data,res,key,v;return _regeneratorRuntime().wrap(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:_context2.next=2;return fetch(endPoint+'/v1/models/prompts',{method:'GET',headers:{'Content-Type':'application/json'}});case 2:response=_context2.sent;if(response.ok){_context2.next=10;break;}_context2.next=6;return response.json();case 6:errorData=_context2.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context2.next=16;break;case 10:_context2.next=12;return response.json();case 12:data=_context2.sent;res=[];for(key in data){v=data[key];v['name']=key;res.push(v);}setPromptStyles(res);case 16:case\"end\":return _context2.stop();}},_callee2);}));return function getBuiltInPromptStyles(){return _ref2.apply(this,arguments);};}();// avoid keep requesting backend to get prompts\nif(promptStyles.length===0){getBuiltInPromptStyles().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}if(family.chat.length===0){getBuiltinFamilies().catch(function(error){setErrorMsg(error.message||'An unexpected error occurred when getting builtin prompt styles.');console.error('Error: ',error);});}},[cookie.token]);var getFamilyByAbility=function getFamilyByAbility(){if(formData.model_ability.includes('chat')){return family.chat;}else{return family.generate;}};var isModelFormatPytorch=function isModelFormatPytorch(){return modelFormat==='pytorch';};var isModelFormatGPTQ=function isModelFormatGPTQ(){return modelFormat==='gptq';};var isModelFormatAWQ=function isModelFormatAWQ(){return modelFormat==='awq';};var getPathComponents=function getPathComponents(path){var normalizedPath=path.replace(/\\\\/g,'/');var baseDir=normalizedPath.substring(0,normalizedPath.lastIndexOf('/'));var filename=normalizedPath.substring(normalizedPath.lastIndexOf('/')+1);return{baseDir:baseDir,filename:filename};};var handleClick=/*#__PURE__*/function(){var _ref3=_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee3(){var _getPathComponents,baseDir,filename,ps,_ps$stop,_ps$stop_token_ids,response,errorData;return _regeneratorRuntime().wrap(function _callee3$(_context3){while(1)switch(_context3.prev=_context3.next){case 0:if(isModelFormatGPTQ()){formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_uri:modelUri}];}else if(isModelFormatAWQ()){formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_uri:modelUri}];}else if(!isModelFormatPytorch()){_getPathComponents=getPathComponents(modelUri),baseDir=_getPathComponents.baseDir,filename=_getPathComponents.filename;formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:[quantization],model_id:'',model_file_name_template:filename,model_uri:baseDir}];}else{formData.model_specs=[{model_format:modelFormat,model_size_in_billions:modelSize,quantizations:['4-bit','8-bit','none'],model_id:'',model_uri:modelUri}];}formData.model_family=familyLabel;if(formData.model_ability.includes('chat')){ps=promptStyles.find(function(item){return item.name===familyLabel;});if(ps){formData.prompt_style={style_name:ps.style_name,system_prompt:ps.system_prompt,roles:ps.roles,intra_message_sep:ps.intra_message_sep,inter_message_sep:ps.inter_message_sep,stop:(_ps$stop=ps.stop)!==null&&_ps$stop!==void 0?_ps$stop:null,stop_token_ids:(_ps$stop_token_ids=ps.stop_token_ids)!==null&&_ps$stop_token_ids!==void 0?_ps$stop_token_ids:null};}}if(!errorAny){_context3.next=6;break;}setErrorMsg('Please fill in valid value for all fields');return _context3.abrupt(\"return\");case 6:_context3.prev=6;_context3.next=9;return fetcher(endPoint+'/v1/model_registrations/LLM',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model:JSON.stringify(formData),persist:true})});case 9:response=_context3.sent;if(response.ok){_context3.next=17;break;}_context3.next=13;return response.json();case 13:errorData=_context3.sent;// Assuming the server returns error details in JSON format\nsetErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));_context3.next=18;break;case 17:setSuccessMsg('Model has been registered successfully! Navigate to launch model page to proceed.');case 18:_context3.next=24;break;case 20:_context3.prev=20;_context3.t0=_context3[\"catch\"](6);console.error('There was a problem with the fetch operation:',_context3.t0);setErrorMsg(_context3.t0.message||'An unexpected error occurred.');case 24:case\"end\":return _context3.stop();}},_callee3,null,[[6,20]]);}));return function handleClick(){return _ref3.apply(this,arguments);};}();var toggleLanguage=function toggleLanguage(lang){if(formData.model_lang.includes(lang)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:formData.model_lang.filter(function(l){return l!==lang;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_lang:[].concat(_toConsumableArray(formData.model_lang),[lang])}));}};var toggleAbility=function toggleAbility(ability){setFamilyLabel('');if(formData.model_ability.includes(ability)){setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:formData.model_ability.filter(function(a){return a!==ability;})}));}else{setFormData(_objectSpread(_objectSpread({},formData),{},{model_ability:[].concat(_toConsumableArray(formData.model_ability),[ability])}));}};return/*#__PURE__*/_jsxs(Box,{m:\"20px\",children:[/*#__PURE__*/_jsx(Title,{title:\"Register Model\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:function onChange(e,v){setTabValue(v);},\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Model\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Model\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank Model\",value:\"3\"})]})}),/*#__PURE__*/_jsxs(TabPanel,{value:\"1\",sx:{padding:0},children:[/*#__PURE__*/_jsx(Box,{padding:\"20px\"}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(TextField,{label:\"Model Name\",error:errorModelName,defaultValue:formData.model_name,size:\"small\",helperText:\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_name:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5},children:\"Model Format\"}),/*#__PURE__*/_jsx(RadioGroup,{value:modelFormat,onChange:function onChange(e){setModelFormat(e.target.value);},children:/*#__PURE__*/_jsxs(Box,{sx:styles.checkboxWrapper,children:[/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"pytorch\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"PyTorch\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggmlv3\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGML\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"ggufv2\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GGUF\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"gptq\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"GPTQ\"})}),/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:\"awq\",control:/*#__PURE__*/_jsx(Radio,{}),label:\"AWQ\"})})]})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{error:errorContextLength,label:\"Context Length\",value:formData.context_length,size:\"small\",onChange:function onChange(event){var value=event.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}// Update with the processed value\nsetFormData(_objectSpread(_objectSpread({},formData),{},{context_length:Number(value)}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Size in Billions\",size:\"small\",error:errorModelSize,value:modelSize,onChange:function onChange(e){var value=e.target.value;// Remove leading zeros\nif(/^0+/.test(value)){value=value.replace(/^0+/,'')||'0';}// Ensure it's a positive integer, if not set it to the minimum\nif(!/^\\d+$/.test(value)||parseInt(value)<0){value='0';}setModelSize(Number(value));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Path\",size:\"small\",value:modelUri,onChange:function onChange(e){setModelUri(e.target.value);},helperText:\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Quantization (Optional)\",size:\"small\",value:quantization,onChange:function onChange(e){setQuantization(e.target.value);},helperText:\"For GPTQ/AWQ models, please be careful to fill in the quantization corresponding to the model you want to register.\"}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(TextField,{label:\"Model Description (Optional)\",error:errorModelDescription,defaultValue:formData.model_description,size:\"small\",onChange:function onChange(event){return setFormData(_objectSpread(_objectSpread({},formData),{},{model_description:event.target.value}));}}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorLanguage?ERROR_COLOR:'inherit'},children:\"Model Languages\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_LANGUAGES.map(function(lang){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_lang.includes(lang),onChange:function onChange(){return toggleLanguage(lang);},name:lang,sx:errorLanguage?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:SUPPORTED_LANGUAGES_DICT[lang],style:{paddingLeft:10,color:errorLanguage?ERROR_COLOR:'inherit'}})},lang);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"}),/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Abilities\"}),/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:SUPPORTED_FEATURES.map(function(ability){return/*#__PURE__*/_jsx(Box,{sx:{marginRight:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{control:/*#__PURE__*/_jsx(Checkbox,{checked:formData.model_ability.includes(ability.toLowerCase()),onChange:function onChange(){return toggleAbility(ability.toLowerCase());},name:ability,sx:errorAbility?{'color':ERROR_COLOR,'&.Mui-checked':{color:ERROR_COLOR}}:{}}),label:ability,style:{paddingLeft:10,color:errorAbility?ERROR_COLOR:'inherit'}})},ability);})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(FormControl,{sx:styles.baseFormControl,children:[/*#__PURE__*/_jsx(\"label\",{style:{paddingLeft:5,color:errorAbility?ERROR_COLOR:'inherit'},children:\"Model Family\"}),/*#__PURE__*/_jsx(FormHelperText,{children:\"Please be careful to select the family name corresponding to the model you want to register. If not found, please choose `other`.\"}),/*#__PURE__*/_jsx(RadioGroup,{value:familyLabel,onChange:function onChange(e){setFamilyLabel(e.target.value);},children:/*#__PURE__*/_jsx(Box,{sx:styles.checkboxWrapper,children:getFamilyByAbility().map(function(v){return/*#__PURE__*/_jsx(Box,{sx:{marginLeft:'10px'},children:/*#__PURE__*/_jsx(FormControlLabel,{value:v,control:/*#__PURE__*/_jsx(Radio,{}),label:v})});})})}),/*#__PURE__*/_jsx(Box,{padding:\"15px\"})]}),/*#__PURE__*/_jsxs(Box,{width:'100%',children:[successMsg!==''&&/*#__PURE__*/_jsxs(Alert,{severity:\"success\",children:[/*#__PURE__*/_jsx(AlertTitle,{children:\"Success\"}),successMsg]}),/*#__PURE__*/_jsx(Button,{variant:\"contained\",color:\"primary\",type:\"submit\",onClick:handleClick,children:\"Register Model\"})]})]}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterEmbeddingModel,{})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(RegisterRerankModel,{})})]})]});};export default RegisterModel;var styles={baseFormControl:{width:'100%',margin:'normal',size:'small'},checkboxWrapper:{display:'flex',flexWrap:'wrap',maxWidth:'80%'},labelPaddingLeft:{paddingLeft:5},formControlLabelPaddingLeft:{paddingLeft:10},buttonBox:{width:'100%',margin:'20px'},error:{fontWeight:'bold',margin:'5px 0',padding:'1px',borderRadius:'5px'}};","map":{"version":3,"names":["TabContext","TabList","TabPanel","Box","Checkbox","FormControl","FormControlLabel","FormHelperText","Radio","RadioGroup","Tab","Alert","AlertTitle","Button","TextField","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","Title","useMode","RegisterEmbeddingModel","RegisterRerankModel","jsx","_jsx","jsxs","_jsxs","SUPPORTED_LANGUAGES_DICT","en","zh","SUPPORTED_FEATURES","SUPPORTED_LANGUAGES","Object","keys","RegisterModel","ERROR_COLOR","endPoint","_useContext","setErrorMsg","_useState","_useState2","_slicedToArray","successMsg","setSuccessMsg","_useState3","_useState4","modelFormat","setModelFormat","_useState5","_useState6","modelSize","setModelSize","_useState7","_useState8","modelUri","setModelUri","_useState9","_useState10","quantization","setQuantization","_useState11","version","context_length","model_name","model_lang","model_ability","model_description","model_family","model_specs","prompt_style","undefined","_useState12","formData","setFormData","_useState13","_useState14","promptStyles","setPromptStyles","_useState15","chat","generate","_useState16","family","setFamily","_useState17","_useState18","familyLabel","setFamilyLabel","_React$useState","_React$useState2","tabValue","setTabValue","_useCookies","_useCookies2","cookie","navigate","errorModelName","trim","length","errorModelDescription","errorContextLength","errorLanguage","errorAbility","errorModelSize","some","spec","model_size_in_billions","errorFamily","errorAny","token","replace","getBuiltinFamilies","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","errorData","data","wrap","_callee$","_context","prev","next","fetch","method","headers","sent","ok","json","concat","status","detail","push","stop","apply","arguments","getBuiltInPromptStyles","_ref2","_callee2","res","key","v","_callee2$","_context2","catch","error","message","console","getFamilyByAbility","includes","isModelFormatPytorch","isModelFormatGPTQ","isModelFormatAWQ","getPathComponents","path","normalizedPath","baseDir","substring","lastIndexOf","filename","handleClick","_ref3","_callee3","_getPathComponents","ps","_ps$stop","_ps$stop_token_ids","_callee3$","_context3","model_format","quantizations","model_id","model_uri","model_file_name_template","find","item","name","style_name","system_prompt","roles","intra_message_sep","inter_message_sep","stop_token_ids","abrupt","body","JSON","stringify","model","persist","t0","toggleLanguage","lang","_objectSpread","filter","l","_toConsumableArray","toggleAbility","ability","a","m","children","title","value","sx","borderBottom","borderColor","onChange","e","label","padding","styles","baseFormControl","defaultValue","size","helperText","event","target","style","paddingLeft","checkboxWrapper","marginLeft","control","test","parseInt","Number","color","map","marginRight","checked","toLowerCase","width","severity","variant","type","onClick","margin","display","flexWrap","maxWidth","labelPaddingLeft","formControlLabelPaddingLeft","buttonBox","fontWeight","borderRadius"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/register_model/index.js"],"sourcesContent":["import { TabContext, TabList, TabPanel } from '@mui/lab'\nimport {\n Box,\n Checkbox,\n FormControl,\n FormControlLabel,\n FormHelperText,\n Radio,\n RadioGroup,\n Tab,\n} from '@mui/material'\nimport Alert from '@mui/material/Alert'\nimport AlertTitle from '@mui/material/AlertTitle'\nimport Button from '@mui/material/Button'\nimport TextField from '@mui/material/TextField'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport Title from '../../components/Title'\nimport { useMode } from '../../theme'\nimport RegisterEmbeddingModel from './register_embedding'\nimport RegisterRerankModel from './register_rerank'\n\nconst SUPPORTED_LANGUAGES_DICT = { en: 'English', zh: 'Chinese' }\nconst SUPPORTED_FEATURES = ['Generate', 'Chat']\n\n// Convert dictionary of supported languages into list\nconst SUPPORTED_LANGUAGES = Object.keys(SUPPORTED_LANGUAGES_DICT)\n\nconst RegisterModel = () => {\n const ERROR_COLOR = useMode()\n const endPoint = useContext(ApiContext).endPoint\n const { setErrorMsg } = useContext(ApiContext)\n const [successMsg, setSuccessMsg] = useState('')\n const [modelFormat, setModelFormat] = useState('pytorch')\n const [modelSize, setModelSize] = useState(7)\n const [modelUri, setModelUri] = useState('/path/to/llama-2')\n const [quantization, setQuantization] = useState('')\n const [formData, setFormData] = useState({\n version: 1,\n context_length: 2048,\n model_name: 'custom-llama-2',\n model_lang: ['en'],\n model_ability: ['generate'],\n model_description: 'This is a custom model description.',\n model_family: '',\n model_specs: [],\n prompt_style: undefined,\n })\n const [promptStyles, setPromptStyles] = useState([])\n const [family, setFamily] = useState({\n chat: [],\n generate: [],\n })\n const [familyLabel, setFamilyLabel] = useState('')\n const [tabValue, setTabValue] = React.useState('1')\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n\n const errorModelName = formData.model_name.trim().length <= 0\n const errorModelDescription = formData.model_description.length < 0\n const errorContextLength = formData.context_length === 0\n const errorLanguage =\n formData.model_lang === undefined || formData.model_lang.length === 0\n const errorAbility =\n formData.model_ability === undefined || formData.model_ability.length === 0\n const errorModelSize =\n formData.model_specs &&\n formData.model_specs.some((spec) => {\n return (\n spec.model_size_in_billions === undefined ||\n spec.model_size_in_billions === 0\n )\n })\n const errorFamily = familyLabel === ''\n const errorAny =\n errorModelName ||\n errorModelDescription ||\n errorContextLength ||\n errorLanguage ||\n errorAbility ||\n errorModelSize ||\n errorFamily\n\n useEffect(() => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token === 'need_auth') {\n navigate('/login', { replace: true })\n return\n }\n\n const getBuiltinFamilies = async () => {\n const response = await fetch(endPoint + '/v1/models/families', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n data.chat.push('other')\n data.generate.push('other')\n setFamily(data)\n }\n }\n\n const getBuiltInPromptStyles = async () => {\n const response = await fetch(endPoint + '/v1/models/prompts', {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n const data = await response.json()\n let res = []\n for (const key in data) {\n let v = data[key]\n v['name'] = key\n res.push(v)\n }\n setPromptStyles(res)\n }\n }\n // avoid keep requesting backend to get prompts\n if (promptStyles.length === 0) {\n getBuiltInPromptStyles().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n if (family.chat.length === 0) {\n getBuiltinFamilies().catch((error) => {\n setErrorMsg(\n error.message ||\n 'An unexpected error occurred when getting builtin prompt styles.'\n )\n console.error('Error: ', error)\n })\n }\n }, [cookie.token])\n\n const getFamilyByAbility = () => {\n if (formData.model_ability.includes('chat')) {\n return family.chat\n } else {\n return family.generate\n }\n }\n\n const isModelFormatPytorch = () => {\n return modelFormat === 'pytorch'\n }\n\n const isModelFormatGPTQ = () => {\n return modelFormat === 'gptq'\n }\n\n const isModelFormatAWQ = () => {\n return modelFormat === 'awq'\n }\n\n const getPathComponents = (path) => {\n const normalizedPath = path.replace(/\\\\/g, '/')\n const baseDir = normalizedPath.substring(0, normalizedPath.lastIndexOf('/'))\n const filename = normalizedPath.substring(\n normalizedPath.lastIndexOf('/') + 1\n )\n return { baseDir, filename }\n }\n\n const handleClick = async () => {\n if (isModelFormatGPTQ()) {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n } else if (isModelFormatAWQ()) {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n } else if (!isModelFormatPytorch()) {\n const { baseDir, filename } = getPathComponents(modelUri)\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: [quantization],\n model_id: '',\n model_file_name_template: filename,\n model_uri: baseDir,\n },\n ]\n } else {\n formData.model_specs = [\n {\n model_format: modelFormat,\n model_size_in_billions: modelSize,\n quantizations: ['4-bit', '8-bit', 'none'],\n model_id: '',\n model_uri: modelUri,\n },\n ]\n }\n\n formData.model_family = familyLabel\n\n if (formData.model_ability.includes('chat')) {\n const ps = promptStyles.find((item) => item.name === familyLabel)\n if (ps) {\n formData.prompt_style = {\n style_name: ps.style_name,\n system_prompt: ps.system_prompt,\n roles: ps.roles,\n intra_message_sep: ps.intra_message_sep,\n inter_message_sep: ps.inter_message_sep,\n stop: ps.stop ?? null,\n stop_token_ids: ps.stop_token_ids ?? null,\n }\n }\n }\n\n if (errorAny) {\n setErrorMsg('Please fill in valid value for all fields')\n return\n }\n\n try {\n const response = await fetcher(endPoint + '/v1/model_registrations/LLM', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model: JSON.stringify(formData),\n persist: true,\n }),\n })\n if (!response.ok) {\n const errorData = await response.json() // Assuming the server returns error details in JSON format\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n } else {\n setSuccessMsg(\n 'Model has been registered successfully! Navigate to launch model page to proceed.'\n )\n }\n } catch (error) {\n console.error('There was a problem with the fetch operation:', error)\n setErrorMsg(error.message || 'An unexpected error occurred.')\n }\n }\n\n const toggleLanguage = (lang) => {\n if (formData.model_lang.includes(lang)) {\n setFormData({\n ...formData,\n model_lang: formData.model_lang.filter((l) => l !== lang),\n })\n } else {\n setFormData({\n ...formData,\n model_lang: [...formData.model_lang, lang],\n })\n }\n }\n\n const toggleAbility = (ability) => {\n setFamilyLabel('')\n if (formData.model_ability.includes(ability)) {\n setFormData({\n ...formData,\n model_ability: formData.model_ability.filter((a) => a !== ability),\n })\n } else {\n setFormData({\n ...formData,\n model_ability: [...formData.model_ability, ability],\n })\n }\n }\n\n return (\n <Box m=\"20px\">\n <Title title=\"Register Model\" />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={(e, v) => {\n setTabValue(v)\n }}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Model\" value=\"1\" />\n <Tab label=\"Embedding Model\" value=\"2\" />\n <Tab label=\"Rerank Model\" value=\"3\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <Box padding=\"20px\"></Box>\n {/* Base Information */}\n <FormControl sx={styles.baseFormControl}>\n <TextField\n label=\"Model Name\"\n error={errorModelName}\n defaultValue={formData.model_name}\n size=\"small\"\n helperText=\"Alphanumeric characters with properly placed hyphens and underscores. Must not match any built-in model names.\"\n onChange={(event) =>\n setFormData({ ...formData, model_name: event.target.value })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n }}\n >\n Model Format\n </label>\n\n <RadioGroup\n value={modelFormat}\n onChange={(e) => {\n setModelFormat(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"pytorch\"\n control={<Radio />}\n label=\"PyTorch\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggmlv3\"\n control={<Radio />}\n label=\"GGML\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"ggufv2\"\n control={<Radio />}\n label=\"GGUF\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"gptq\"\n control={<Radio />}\n label=\"GPTQ\"\n />\n </Box>\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel\n value=\"awq\"\n control={<Radio />}\n label=\"AWQ\"\n />\n </Box>\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n\n <TextField\n error={errorContextLength}\n label=\"Context Length\"\n value={formData.context_length}\n size=\"small\"\n onChange={(event) => {\n let value = event.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n // Update with the processed value\n setFormData({\n ...formData,\n context_length: Number(value),\n })\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Size in Billions\"\n size=\"small\"\n error={errorModelSize}\n value={modelSize}\n onChange={(e) => {\n let value = e.target.value\n // Remove leading zeros\n if (/^0+/.test(value)) {\n value = value.replace(/^0+/, '') || '0'\n }\n // Ensure it's a positive integer, if not set it to the minimum\n if (!/^\\d+$/.test(value) || parseInt(value) < 0) {\n value = '0'\n }\n setModelSize(Number(value))\n }}\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Path\"\n size=\"small\"\n value={modelUri}\n onChange={(e) => {\n setModelUri(e.target.value)\n }}\n helperText=\"For PyTorch, provide the model directory. For GGML/GGUF, provide the model file path.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Quantization (Optional)\"\n size=\"small\"\n value={quantization}\n onChange={(e) => {\n setQuantization(e.target.value)\n }}\n helperText=\"For GPTQ/AWQ models, please be careful to fill in the quantization corresponding to the model you want to register.\"\n />\n <Box padding=\"15px\"></Box>\n\n <TextField\n label=\"Model Description (Optional)\"\n error={errorModelDescription}\n defaultValue={formData.model_description}\n size=\"small\"\n onChange={(event) =>\n setFormData({\n ...formData,\n model_description: event.target.value,\n })\n }\n />\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Languages\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_LANGUAGES.map((lang) => (\n <Box key={lang} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_lang.includes(lang)}\n onChange={() => toggleLanguage(lang)}\n name={lang}\n sx={\n errorLanguage\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={SUPPORTED_LANGUAGES_DICT[lang]}\n style={{\n paddingLeft: 10,\n color: errorLanguage ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Abilities\n </label>\n <Box sx={styles.checkboxWrapper}>\n {SUPPORTED_FEATURES.map((ability) => (\n <Box key={ability} sx={{ marginRight: '10px' }}>\n <FormControlLabel\n control={\n <Checkbox\n checked={formData.model_ability.includes(\n ability.toLowerCase()\n )}\n onChange={() => toggleAbility(ability.toLowerCase())}\n name={ability}\n sx={\n errorAbility\n ? {\n 'color': ERROR_COLOR,\n '&.Mui-checked': {\n color: ERROR_COLOR,\n },\n }\n : {}\n }\n />\n }\n label={ability}\n style={{\n paddingLeft: 10,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n />\n </Box>\n ))}\n </Box>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <FormControl sx={styles.baseFormControl}>\n <label\n style={{\n paddingLeft: 5,\n color: errorAbility ? ERROR_COLOR : 'inherit',\n }}\n >\n Model Family\n </label>\n <FormHelperText>\n Please be careful to select the family name corresponding to the\n model you want to register. If not found, please choose `other`.\n </FormHelperText>\n <RadioGroup\n value={familyLabel}\n onChange={(e) => {\n setFamilyLabel(e.target.value)\n }}\n >\n <Box sx={styles.checkboxWrapper}>\n {getFamilyByAbility().map((v) => (\n <Box sx={{ marginLeft: '10px' }}>\n <FormControlLabel value={v} control={<Radio />} label={v} />\n </Box>\n ))}\n </Box>\n </RadioGroup>\n <Box padding=\"15px\"></Box>\n </FormControl>\n\n <Box width={'100%'}>\n {successMsg !== '' && (\n <Alert severity=\"success\">\n <AlertTitle>Success</AlertTitle>\n {successMsg}\n </Alert>\n )}\n <Button\n variant=\"contained\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleClick}\n >\n Register Model\n </Button>\n </Box>\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <RegisterEmbeddingModel />\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <RegisterRerankModel />\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RegisterModel\n\nconst styles = {\n baseFormControl: {\n width: '100%',\n margin: 'normal',\n size: 'small',\n },\n checkboxWrapper: {\n display: 'flex',\n flexWrap: 'wrap',\n maxWidth: '80%',\n },\n labelPaddingLeft: {\n paddingLeft: 5,\n },\n formControlLabelPaddingLeft: {\n paddingLeft: 10,\n },\n buttonBox: {\n width: '100%',\n margin: '20px',\n },\n error: {\n fontWeight: 'bold',\n margin: '5px 0',\n padding: '1px',\n borderRadius: '5px',\n },\n}\n"],"mappings":"wtBAAA,OAASA,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAA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AY,CAAE,KAChB,CACF,CAAC"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _toConsumableArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import{ChatOutlined,EditNoteOutlined,HelpCenterOutlined,RocketLaunchOutlined,UndoOutlined}from'@mui/icons-material';import DeleteIcon from'@mui/icons-material/Delete';import{Box,Chip,CircularProgress,FormControl,Grid,InputLabel,MenuItem,Select,Stack,TextField}from'@mui/material';import IconButton from'@mui/material/IconButton';import React,{useContext,useEffect,useState}from'react';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import fetcher from'../../components/fetcher';import TitleTypography from'../../components/titleTypography';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var CARD_HEIGHT=380;var CARD_WIDTH=300;var ModelCard=function ModelCard(_ref){var url=_ref.url,modelData=_ref.modelData,gpuAvailable=_ref.gpuAvailable,_ref$is_custom=_ref.is_custom,is_custom=_ref$is_custom===void 0?false:_ref$is_custom;var _useState=useState(false),_useState2=_slicedToArray(_useState,2),hover=_useState2[0],setHover=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),selected=_useState4[0],setSelected=_useState4[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var navigate=useNavigate();// Model parameter selections\nvar _useState5=useState(''),_useState6=_slicedToArray(_useState5,2),modelUID=_useState6[0],setModelUID=_useState6[1];var _useState7=useState(''),_useState8=_slicedToArray(_useState7,2),modelFormat=_useState8[0],setModelFormat=_useState8[1];var _useState9=useState(''),_useState10=_slicedToArray(_useState9,2),modelSize=_useState10[0],setModelSize=_useState10[1];var _useState11=useState(''),_useState12=_slicedToArray(_useState11,2),quantization=_useState12[0],setQuantization=_useState12[1];var _useState13=useState('auto'),_useState14=_slicedToArray(_useState13,2),nGPU=_useState14[0],setNGPU=_useState14[1];var _useState15=useState(-1),_useState16=_slicedToArray(_useState15,2),nGPULayers=_useState16[0],setNGPULayers=_useState16[1];var _useState17=useState(1),_useState18=_slicedToArray(_useState17,2),replica=_useState18[0],setReplica=_useState18[1];var _useState19=useState([]),_useState20=_slicedToArray(_useState19,2),formatOptions=_useState20[0],setFormatOptions=_useState20[1];var _useState21=useState([]),_useState22=_slicedToArray(_useState21,2),sizeOptions=_useState22[0],setSizeOptions=_useState22[1];var _useState23=useState([]),_useState24=_slicedToArray(_useState23,2),quantizationOptions=_useState24[0],setQuantizationOptions=_useState24[1];var _useState25=useState(false),_useState26=_slicedToArray(_useState25,2),customDeleted=_useState26[0],setCustomDeleted=_useState26[1];var range=function range(start,end){return new Array(end-start+1).fill(undefined).map(function(_,i){return i+start;});};var isCached=function isCached(spec){if(spec.model_format==='pytorch'){return spec.cache_status&&spec.cache_status===true;}else{return spec.cache_status&&spec.cache_status.some(function(cs){return cs;});}};// model size can be int or string. For string style, \"1_8\" means 1.8 as an example.\nvar convertModelSize=function convertModelSize(size){return size.toString().includes('_')?size:parseInt(size,10);};// UseEffects for parameter selection, change options based on previous selections\nuseEffect(function(){if(modelData){var modelFamily=modelData.model_specs;var formats=_toConsumableArray(new Set(modelFamily.map(function(spec){return spec.model_format;})));setFormatOptions(formats);}},[modelData]);useEffect(function(){if(modelFormat&&modelData){var modelFamily=modelData.model_specs;var sizes=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat;}).map(function(spec){return spec.model_size_in_billions;})));setSizeOptions(sizes);}},[modelFormat,modelData]);useEffect(function(){if(modelFormat&&modelSize&&modelData){var modelFamily=modelData.model_specs;var quants=_toConsumableArray(new Set(modelFamily.filter(function(spec){return spec.model_format===modelFormat&&spec.model_size_in_billions===convertModelSize(modelSize);}).flatMap(function(spec){return spec.quantizations;})));setQuantizationOptions(quants);}},[modelFormat,modelSize,modelData]);var getNGPURange=function getNGPURange(){if(gpuAvailable===0){// remain 'auto' for distributed situation\nreturn['auto','CPU'];}return['auto','CPU'].concat(range(1,gpuAvailable));};var launchModel=function launchModel(url){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);var modelDataWithID={// If user does not fill model_uid, pass null (None) to server and server generates it.\nmodel_uid:modelUID.trim()===''?null:modelUID.trim(),model_name:modelData.model_name,model_format:modelFormat,model_size_in_billions:convertModelSize(modelSize),quantization:quantization,n_gpu:parseInt(nGPU,10)===0||nGPU==='CPU'?null:nGPU==='auto'?'auto':parseInt(nGPU,10),replica:replica};if(nGPULayers>=0){modelDataWithID.n_gpu_layers=nGPULayers;}// First fetcher request to initiate the model\nfetcher(url+'/v1/models',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify(modelDataWithID)}).then(function(response){if(!response.ok){// Assuming the server returns error details in JSON format\nresponse.json().then(function(errorData){setErrorMsg(\"Server error: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{navigate('/running_models');}setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});};var styles={container:{display:'block',position:'relative',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',borderRadius:'20px',background:'white',overflow:'hidden'},containerSelected:{display:'block',position:'relative',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',borderRadius:'20px',background:'white',overflow:'hidden',boxShadow:'0 0 2px #00000099'},descriptionCard:{position:'relative',top:'-1px',left:'-1px',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',padding:'20px',borderRadius:'20px',background:'white'},parameterCard:{position:'relative',top:\"-\".concat(CARD_HEIGHT+1,\"px\"),left:'-1px',width:\"\".concat(CARD_WIDTH,\"px\"),height:\"\".concat(CARD_HEIGHT,\"px\"),border:'1px solid #ddd',padding:'20px',borderRadius:'20px',background:'white'},img:{display:'block',margin:'0 auto',width:'180px',height:'180px',objectFit:'cover',borderRadius:'10px'},h2:{margin:'10px 10px',fontSize:'20px'},p:{minHeight:'140px',fontSize:'14px',padding:'0px 10px 15px 10px'},buttonsContainer:{display:'flex',margin:'0 auto',marginTop:'15px',border:'none',justifyContent:'space-between',alignItems:'center'},buttonContainer:{width:'45%',borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'0px'},buttonItem:{width:'100%',margin:'0 auto',padding:'5px',display:'flex',justifyContent:'center',borderRadius:'4px',border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},instructionText:{fontSize:'12px',color:'#666666',fontStyle:'italic',margin:'10px 0',textAlign:'center'},slideIn:{transform:'translateX(0%)',transition:'transform 0.2s ease-in-out'},slideOut:{transform:'translateX(100%)',transition:'transform 0.2s ease-in-out'},iconRow:{display:'flex',justifyContent:'space-between',alignItems:'center'},iconItem:{display:'flex',flexDirection:'column',alignItems:'center',margin:'20px'},boldIconText:{fontWeight:'bold',fontSize:'1.2em'},muiIcon:{fontSize:'1.5em'},smallText:{fontSize:'0.8em'},tagRow:{margin:'2px 5px'}};var handeCustomDelete=function handeCustomDelete(e){e.stopPropagation();fetcher(url+\"/v1/model_registrations/LLM/\".concat(modelData.model_name),{method:'DELETE',headers:{'Content-Type':'application/json'}}).then(function(){return setCustomDeleted(true);}).catch(console.error);};// Set two different states based on mouse hover\nreturn/*#__PURE__*/_jsxs(Box,{style:hover?styles.containerSelected:styles.container,onMouseEnter:function onMouseEnter(){return setHover(true);},onMouseLeave:function onMouseLeave(){return setHover(false);},onClick:function onClick(){if(!selected&&!customDeleted){setSelected(true);}},children:[/*#__PURE__*/_jsxs(Box,{style:styles.descriptionCard,children:[is_custom&&/*#__PURE__*/_jsxs(Stack,{direction:\"row\",justifyContent:\"space-evenly\",alignItems:\"center\",spacing:1,children:[/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsx(IconButton,{\"aria-label\":\"delete\",onClick:handeCustomDelete,disabled:customDeleted,children:/*#__PURE__*/_jsx(DeleteIcon,{})})]}),!is_custom&&/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsxs(Stack,{spacing:1,direction:\"row\",useFlexGap:true,flexWrap:\"wrap\",sx:{marginLeft:1},children:[function(){return modelData.model_lang.map(function(v){return/*#__PURE__*/_jsx(Chip,{label:v,variant:\"outlined\",size:\"small\"});});}(),function(){if(modelData.model_specs.some(function(spec){return isCached(spec);})){return/*#__PURE__*/_jsx(Chip,{label:\"Cached\",variant:\"outlined\",size:\"small\"});}}(),function(){if(is_custom&&customDeleted){return/*#__PURE__*/_jsx(Chip,{label:\"Deleted\",variant:\"outlined\",size:\"small\"});}}()]}),/*#__PURE__*/_jsx(\"p\",{style:styles.p,children:modelData.model_description}),/*#__PURE__*/_jsxs(\"div\",{style:styles.iconRow,children:[/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsxs(\"span\",{style:styles.boldIconText,children:[Math.floor(modelData.context_length/1000),\"K\"]}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"context length\"})]}),function(){if(modelData.model_ability.includes('chat')){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(ChatOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"chat model\"})]});}else if(modelData.model_ability.includes('generate')){return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(EditNoteOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"generate model\"})]});}else{return/*#__PURE__*/_jsxs(\"div\",{style:styles.iconItem,children:[/*#__PURE__*/_jsx(HelpCenterOutlined,{style:styles.muiIcon}),/*#__PURE__*/_jsx(\"small\",{style:styles.smallText,children:\"other model\"})]});}}()]})]}),/*#__PURE__*/_jsxs(Box,{style:selected?_objectSpread(_objectSpread({},styles.parameterCard),styles.slideIn):_objectSpread(_objectSpread({},styles.parameterCard),styles.slideOut),children:[/*#__PURE__*/_jsx(TitleTypography,{value:modelData.model_name}),/*#__PURE__*/_jsx(Box,{display:\"flex\",flexDirection:\"column\",width:\"100%\",mx:\"auto\",children:/*#__PURE__*/_jsxs(Grid,{container:true,rowSpacing:0,columnSpacing:1,children:[/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelFormat-label\",children:\"Model Format\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelFormat-label\",value:modelFormat,onChange:function onChange(e){return setModelFormat(e.target.value);},label:\"Model Format\",children:formatOptions.map(function(format){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===format;});var cached=specs.some(function(spec){return isCached(spec);});var displayedFormat=cached?format+' (cached)':format;return/*#__PURE__*/_jsx(MenuItem,{value:format,children:displayedFormat},format);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"modelSize-label\",children:\"Model Size\"}),/*#__PURE__*/_jsx(Select,{labelId:\"modelSize-label\",value:modelSize,onChange:function onChange(e){return setModelSize(e.target.value);},label:\"Model Size\",children:sizeOptions.map(function(size){var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===size;});var cached=specs.some(function(spec){return isCached(spec);});var displayedSize=cached?size+' (cached)':size;return/*#__PURE__*/_jsx(MenuItem,{value:size,children:displayedSize},size);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat||!modelSize,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"quantization-label\",children:\"Quantization\"}),/*#__PURE__*/_jsx(Select,{labelId:\"quantization-label\",value:quantization,onChange:function onChange(e){return setQuantization(e.target.value);},label:\"Quantization\",children:quantizationOptions.map(function(quant,index){var _specs$0$cache_status,_specs$,_specs$0$cache_status2,_specs$2,_specs$2$cache_status;var specs=modelData.model_specs.filter(function(spec){return spec.model_format===modelFormat;}).filter(function(spec){return spec.model_size_in_billions===convertModelSize(modelSize);});var cached=modelFormat==='pytorch'?(_specs$0$cache_status=(_specs$=specs[0])===null||_specs$===void 0?void 0:_specs$.cache_status)!==null&&_specs$0$cache_status!==void 0?_specs$0$cache_status:false===true:(_specs$0$cache_status2=(_specs$2=specs[0])===null||_specs$2===void 0?void 0:(_specs$2$cache_status=_specs$2.cache_status)===null||_specs$2$cache_status===void 0?void 0:_specs$2$cache_status[index])!==null&&_specs$0$cache_status2!==void 0?_specs$0$cache_status2:false===true;var displayedQuant=cached?quant+' (cached)':quant;return/*#__PURE__*/_jsx(MenuItem,{value:quant,children:displayedQuant},quant);})})]})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:modelFormat!=='ggufv2'&&modelFormat!=='ggmlv3'?/*#__PURE__*/_jsxs(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,disabled:!modelFormat||!modelSize||!quantization,children:[/*#__PURE__*/_jsx(InputLabel,{id:\"n-gpu-label\",children:\"N-GPU\"}),/*#__PURE__*/_jsx(Select,{labelId:\"n-gpu-label\",value:nGPU,onChange:function onChange(e){return setNGPU(e.target.value);},label:\"N-GPU\",children:getNGPURange().map(function(v){return/*#__PURE__*/_jsx(MenuItem,{value:v,children:v},v);})})]}):/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{disabled:!modelFormat||!modelSize||!quantization,type:\"number\",label:\"N GPU Layers\",InputProps:{inputProps:{min:-1}},value:nGPULayers,onChange:function onChange(e){return setNGPULayers(parseInt(e.target.value,10));}})})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{variant:\"outlined\",value:modelUID,label:\"(Optional) Model UID, model name by default\",onChange:function onChange(e){return setModelUID(e.target.value);}})})}),/*#__PURE__*/_jsx(Grid,{item:true,xs:6,children:/*#__PURE__*/_jsx(FormControl,{variant:\"outlined\",margin:\"normal\",fullWidth:true,children:/*#__PURE__*/_jsx(TextField,{disabled:!modelFormat||!modelSize||!quantization,type:\"number\",InputProps:{inputProps:{min:1}},label:\"Replica\",value:replica,onChange:function onChange(e){return setReplica(parseInt(e.target.value,10));}})})})]})}),/*#__PURE__*/_jsxs(Box,{style:styles.buttonsContainer,children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch\",style:styles.buttonContainer,onClick:function onClick(){return launchModel(url,modelData);},disabled:isCallingApi||isUpdatingModel||!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!=='pytorch')),children:function(){if(isCallingApi||isUpdatingModel){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:'#f2f2f2'}),children:/*#__PURE__*/_jsx(CircularProgress,{size:\"20px\",sx:{color:'#000000'}})});}else if(!(modelFormat&&modelSize&&modelData&&(quantization||!modelData.is_builtin&&modelFormat!=='pytorch'))){return/*#__PURE__*/_jsx(Box,{style:_objectSpread(_objectSpread({},styles.buttonItem),{},{backgroundColor:'#f2f2f2'}),children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{size:\"20px\"})});}else{return/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(RocketLaunchOutlined,{color:\"#000000\",size:\"20px\"})});}}()}),/*#__PURE__*/_jsx(\"button\",{title:\"Go Back\",style:styles.buttonContainer,onClick:function onClick(){return setSelected(false);},children:/*#__PURE__*/_jsx(Box,{style:styles.buttonItem,children:/*#__PURE__*/_jsx(UndoOutlined,{color:\"#000000\",size:\"20px\"})})})]})]})]});};export default ModelCard;","map":{"version":3,"names":["ChatOutlined","EditNoteOutlined","HelpCenterOutlined","RocketLaunchOutlined","UndoOutlined","DeleteIcon","Box","Chip","CircularProgress","FormControl","Grid","InputLabel","MenuItem","Select","Stack","TextField","IconButton","React","useContext","useEffect","useState","useNavigate","ApiContext","fetcher","TitleTypography","jsx","_jsx","jsxs","_jsxs","CARD_HEIGHT","CARD_WIDTH","ModelCard","_ref","url","modelData","gpuAvailable","_ref$is_custom","is_custom","_useState","_useState2","_slicedToArray","hover","setHover","_useState3","_useState4","selected","setSelected","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","_useContext3","setErrorMsg","navigate","_useState5","_useState6","modelUID","setModelUID","_useState7","_useState8","modelFormat","setModelFormat","_useState9","_useState10","modelSize","setModelSize","_useState11","_useState12","quantization","setQuantization","_useState13","_useState14","nGPU","setNGPU","_useState15","_useState16","nGPULayers","setNGPULayers","_useState17","_useState18","replica","setReplica","_useState19","_useState20","formatOptions","setFormatOptions","_useState21","_useState22","sizeOptions","setSizeOptions","_useState23","_useState24","quantizationOptions","setQuantizationOptions","_useState25","_useState26","customDeleted","setCustomDeleted","range","start","end","Array","fill","undefined","map","_","i","isCached","spec","model_format","cache_status","some","cs","convertModelSize","size","toString","includes","parseInt","modelFamily","model_specs","formats","_toConsumableArray","Set","sizes","filter","model_size_in_billions","quants","flatMap","quantizations","getNGPURange","concat","launchModel","modelDataWithID","model_uid","trim","model_name","n_gpu","n_gpu_layers","method","headers","body","JSON","stringify","then","response","ok","json","errorData","status","detail","catch","error","console","styles","container","display","position","width","height","border","borderRadius","background","overflow","containerSelected","boxShadow","descriptionCard","top","left","padding","parameterCard","img","margin","objectFit","h2","fontSize","p","minHeight","buttonsContainer","marginTop","justifyContent","alignItems","buttonContainer","borderWidth","backgroundColor","paddingLeft","paddingRight","buttonItem","borderColor","instructionText","color","fontStyle","textAlign","slideIn","transform","transition","slideOut","iconRow","iconItem","flexDirection","boldIconText","fontWeight","muiIcon","smallText","tagRow","handeCustomDelete","e","stopPropagation","style","onMouseEnter","onMouseLeave","onClick","children","direction","spacing","value","disabled","useFlexGap","flexWrap","sx","marginLeft","model_lang","v","label","variant","model_description","Math","floor","context_length","model_ability","_objectSpread","mx","rowSpacing","columnSpacing","item","xs","fullWidth","id","labelId","onChange","target","format","specs","cached","displayedFormat","displayedSize","quant","index","_specs$0$cache_status","_specs$","_specs$0$cache_status2","_specs$2","_specs$2$cache_status","displayedQuant","type","InputProps","inputProps","min","title","is_builtin"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/launch_model/modelCard.js"],"sourcesContent":["import {\n ChatOutlined,\n EditNoteOutlined,\n HelpCenterOutlined,\n RocketLaunchOutlined,\n UndoOutlined,\n} from '@mui/icons-material'\nimport DeleteIcon from '@mui/icons-material/Delete'\nimport {\n Box,\n Chip,\n CircularProgress,\n FormControl,\n Grid,\n InputLabel,\n MenuItem,\n Select,\n Stack,\n TextField,\n} from '@mui/material'\nimport IconButton from '@mui/material/IconButton'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport fetcher from '../../components/fetcher'\nimport TitleTypography from '../../components/titleTypography'\n\nconst CARD_HEIGHT = 380\nconst CARD_WIDTH = 300\n\nconst ModelCard = ({ url, modelData, gpuAvailable, is_custom = false }) => {\n const [hover, setHover] = useState(false)\n const [selected, setSelected] = useState(false)\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const navigate = useNavigate()\n\n // Model parameter selections\n const [modelUID, setModelUID] = useState('')\n const [modelFormat, setModelFormat] = useState('')\n const [modelSize, setModelSize] = useState('')\n const [quantization, setQuantization] = useState('')\n const [nGPU, setNGPU] = useState('auto')\n const [nGPULayers, setNGPULayers] = useState(-1)\n const [replica, setReplica] = useState(1)\n\n const [formatOptions, setFormatOptions] = useState([])\n const [sizeOptions, setSizeOptions] = useState([])\n const [quantizationOptions, setQuantizationOptions] = useState([])\n const [customDeleted, setCustomDeleted] = useState(false)\n\n const range = (start, end) => {\n return new Array(end - start + 1).fill(undefined).map((_, i) => i + start)\n }\n\n const isCached = (spec) => {\n if (spec.model_format === 'pytorch') {\n return spec.cache_status && spec.cache_status === true\n } else {\n return spec.cache_status && spec.cache_status.some((cs) => cs)\n }\n }\n\n // model size can be int or string. For string style, \"1_8\" means 1.8 as an example.\n const convertModelSize = (size) => {\n return size.toString().includes('_') ? size : parseInt(size, 10)\n }\n\n // UseEffects for parameter selection, change options based on previous selections\n useEffect(() => {\n if (modelData) {\n const modelFamily = modelData.model_specs\n const formats = [...new Set(modelFamily.map((spec) => spec.model_format))]\n setFormatOptions(formats)\n }\n }, [modelData])\n\n useEffect(() => {\n if (modelFormat && modelData) {\n const modelFamily = modelData.model_specs\n const sizes = [\n ...new Set(\n modelFamily\n .filter((spec) => spec.model_format === modelFormat)\n .map((spec) => spec.model_size_in_billions)\n ),\n ]\n setSizeOptions(sizes)\n }\n }, [modelFormat, modelData])\n\n useEffect(() => {\n if (modelFormat && modelSize && modelData) {\n const modelFamily = modelData.model_specs\n const quants = [\n ...new Set(\n modelFamily\n .filter(\n (spec) =>\n spec.model_format === modelFormat &&\n spec.model_size_in_billions === convertModelSize(modelSize)\n )\n .flatMap((spec) => spec.quantizations)\n ),\n ]\n setQuantizationOptions(quants)\n }\n }, [modelFormat, modelSize, modelData])\n\n const getNGPURange = () => {\n if (gpuAvailable === 0) {\n // remain 'auto' for distributed situation\n return ['auto', 'CPU']\n }\n return ['auto', 'CPU'].concat(range(1, gpuAvailable))\n }\n\n const launchModel = (url) => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n\n setIsCallingApi(true)\n\n const modelDataWithID = {\n // If user does not fill model_uid, pass null (None) to server and server generates it.\n model_uid: modelUID.trim() === '' ? null : modelUID.trim(),\n model_name: modelData.model_name,\n model_format: modelFormat,\n model_size_in_billions: convertModelSize(modelSize),\n quantization: quantization,\n n_gpu:\n parseInt(nGPU, 10) === 0 || nGPU === 'CPU'\n ? null\n : nGPU === 'auto'\n ? 'auto'\n : parseInt(nGPU, 10),\n replica: replica,\n }\n\n if (nGPULayers >= 0) {\n modelDataWithID.n_gpu_layers = nGPULayers\n }\n\n // First fetcher request to initiate the model\n fetcher(url + '/v1/models', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(modelDataWithID),\n })\n .then((response) => {\n if (!response.ok) {\n // Assuming the server returns error details in JSON format\n response.json().then((errorData) => {\n setErrorMsg(\n `Server error: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n navigate('/running_models')\n }\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }\n\n const styles = {\n container: {\n display: 'block',\n position: 'relative',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n borderRadius: '20px',\n background: 'white',\n overflow: 'hidden',\n },\n containerSelected: {\n display: 'block',\n position: 'relative',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n borderRadius: '20px',\n background: 'white',\n overflow: 'hidden',\n boxShadow: '0 0 2px #00000099',\n },\n descriptionCard: {\n position: 'relative',\n top: '-1px',\n left: '-1px',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n padding: '20px',\n borderRadius: '20px',\n background: 'white',\n },\n parameterCard: {\n position: 'relative',\n top: `-${CARD_HEIGHT + 1}px`,\n left: '-1px',\n width: `${CARD_WIDTH}px`,\n height: `${CARD_HEIGHT}px`,\n border: '1px solid #ddd',\n padding: '20px',\n borderRadius: '20px',\n background: 'white',\n },\n img: {\n display: 'block',\n margin: '0 auto',\n width: '180px',\n height: '180px',\n objectFit: 'cover',\n borderRadius: '10px',\n },\n h2: {\n margin: '10px 10px',\n fontSize: '20px',\n },\n p: {\n minHeight: '140px',\n fontSize: '14px',\n padding: '0px 10px 15px 10px',\n },\n buttonsContainer: {\n display: 'flex',\n margin: '0 auto',\n marginTop: '15px',\n border: 'none',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n buttonContainer: {\n width: '45%',\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '0px',\n },\n buttonItem: {\n width: '100%',\n margin: '0 auto',\n padding: '5px',\n display: 'flex',\n justifyContent: 'center',\n borderRadius: '4px',\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n },\n instructionText: {\n fontSize: '12px',\n color: '#666666',\n fontStyle: 'italic',\n margin: '10px 0',\n textAlign: 'center',\n },\n slideIn: {\n transform: 'translateX(0%)',\n transition: 'transform 0.2s ease-in-out',\n },\n slideOut: {\n transform: 'translateX(100%)',\n transition: 'transform 0.2s ease-in-out',\n },\n iconRow: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n },\n iconItem: {\n display: 'flex',\n flexDirection: 'column',\n alignItems: 'center',\n margin: '20px',\n },\n boldIconText: {\n fontWeight: 'bold',\n fontSize: '1.2em',\n },\n muiIcon: {\n fontSize: '1.5em',\n },\n smallText: {\n fontSize: '0.8em',\n },\n tagRow: {\n margin: '2px 5px',\n },\n }\n\n const handeCustomDelete = (e) => {\n e.stopPropagation()\n fetcher(url + `/v1/model_registrations/LLM/${modelData.model_name}`, {\n method: 'DELETE',\n headers: {\n 'Content-Type': 'application/json',\n },\n })\n .then(() => setCustomDeleted(true))\n .catch(console.error)\n }\n\n // Set two different states based on mouse hover\n return (\n <Box\n style={hover ? styles.containerSelected : styles.container}\n onMouseEnter={() => setHover(true)}\n onMouseLeave={() => setHover(false)}\n onClick={() => {\n if (!selected && !customDeleted) {\n setSelected(true)\n }\n }}\n >\n {/* First state: show description page */}\n <Box style={styles.descriptionCard}>\n {is_custom && (\n <Stack\n direction=\"row\"\n justifyContent=\"space-evenly\"\n alignItems=\"center\"\n spacing={1}\n >\n <TitleTypography value={modelData.model_name} />\n <IconButton\n aria-label=\"delete\"\n onClick={handeCustomDelete}\n disabled={customDeleted}\n >\n <DeleteIcon />\n </IconButton>\n </Stack>\n )}\n {!is_custom && <TitleTypography value={modelData.model_name} />}\n <Stack\n spacing={1}\n direction=\"row\"\n useFlexGap\n flexWrap=\"wrap\"\n sx={{ marginLeft: 1 }}\n >\n {(() => {\n return modelData.model_lang.map((v) => {\n return <Chip label={v} variant=\"outlined\" size=\"small\" />\n })\n })()}\n {(() => {\n if (modelData.model_specs.some((spec) => isCached(spec))) {\n return <Chip label=\"Cached\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n {(() => {\n if (is_custom && customDeleted) {\n return <Chip label=\"Deleted\" variant=\"outlined\" size=\"small\" />\n }\n })()}\n </Stack>\n <p style={styles.p}>{modelData.model_description}</p>\n\n <div style={styles.iconRow}>\n <div style={styles.iconItem}>\n <span style={styles.boldIconText}>\n {Math.floor(modelData.context_length / 1000)}K\n </span>\n <small style={styles.smallText}>context length</small>\n </div>\n {(() => {\n if (modelData.model_ability.includes('chat')) {\n return (\n <div style={styles.iconItem}>\n <ChatOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>chat model</small>\n </div>\n )\n } else if (modelData.model_ability.includes('generate')) {\n return (\n <div style={styles.iconItem}>\n <EditNoteOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>generate model</small>\n </div>\n )\n } else {\n return (\n <div style={styles.iconItem}>\n <HelpCenterOutlined style={styles.muiIcon} />\n <small style={styles.smallText}>other model</small>\n </div>\n )\n }\n })()}\n </div>\n </Box>\n {/* Second state: show parameter selection page */}\n <Box\n style={\n selected\n ? { ...styles.parameterCard, ...styles.slideIn }\n : { ...styles.parameterCard, ...styles.slideOut }\n }\n >\n <TitleTypography value={modelData.model_name} />\n <Box display=\"flex\" flexDirection=\"column\" width=\"100%\" mx=\"auto\">\n <Grid container rowSpacing={0} columnSpacing={1}>\n <Grid item xs={6}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <InputLabel id=\"modelFormat-label\">Model Format</InputLabel>\n <Select\n labelId=\"modelFormat-label\"\n value={modelFormat}\n onChange={(e) => setModelFormat(e.target.value)}\n label=\"Model Format\"\n >\n {formatOptions.map((format) => {\n const specs = modelData.model_specs.filter(\n (spec) => spec.model_format === format\n )\n const cached = specs.some((spec) => isCached(spec))\n const displayedFormat = cached\n ? format + ' (cached)'\n : format\n\n return (\n <MenuItem key={format} value={format}>\n {displayedFormat}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={6}>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat}\n >\n <InputLabel id=\"modelSize-label\">Model Size</InputLabel>\n <Select\n labelId=\"modelSize-label\"\n value={modelSize}\n onChange={(e) => setModelSize(e.target.value)}\n label=\"Model Size\"\n >\n {sizeOptions.map((size) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter((spec) => spec.model_size_in_billions === size)\n const cached = specs.some((spec) => isCached(spec))\n const displayedSize = cached ? size + ' (cached)' : size\n\n return (\n <MenuItem key={size} value={size}>\n {displayedSize}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={6}>\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat || !modelSize}\n >\n <InputLabel id=\"quantization-label\">Quantization</InputLabel>\n <Select\n labelId=\"quantization-label\"\n value={quantization}\n onChange={(e) => setQuantization(e.target.value)}\n label=\"Quantization\"\n >\n {quantizationOptions.map((quant, index) => {\n const specs = modelData.model_specs\n .filter((spec) => spec.model_format === modelFormat)\n .filter(\n (spec) =>\n spec.model_size_in_billions ===\n convertModelSize(modelSize)\n )\n\n const cached =\n modelFormat === 'pytorch'\n ? specs[0]?.cache_status ?? false === true\n : specs[0]?.cache_status?.[index] ?? false === true\n const displayedQuant = cached ? quant + ' (cached)' : quant\n\n return (\n <MenuItem key={quant} value={quant}>\n {displayedQuant}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n </Grid>\n <Grid item xs={6}>\n {modelFormat !== 'ggufv2' && modelFormat !== 'ggmlv3' ? (\n <FormControl\n variant=\"outlined\"\n margin=\"normal\"\n fullWidth\n disabled={!modelFormat || !modelSize || !quantization}\n >\n <InputLabel id=\"n-gpu-label\">N-GPU</InputLabel>\n <Select\n labelId=\"n-gpu-label\"\n value={nGPU}\n onChange={(e) => setNGPU(e.target.value)}\n label=\"N-GPU\"\n >\n {getNGPURange().map((v) => {\n return (\n <MenuItem key={v} value={v}>\n {v}\n </MenuItem>\n )\n })}\n </Select>\n </FormControl>\n ) : (\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n disabled={!modelFormat || !modelSize || !quantization}\n type=\"number\"\n label=\"N GPU Layers\"\n InputProps={{\n inputProps: {\n min: -1,\n },\n }}\n value={nGPULayers}\n onChange={(e) =>\n setNGPULayers(parseInt(e.target.value, 10))\n }\n />\n </FormControl>\n )}\n </Grid>\n <Grid item xs={6}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n variant=\"outlined\"\n value={modelUID}\n label=\"(Optional) Model UID, model name by default\"\n onChange={(e) => setModelUID(e.target.value)}\n />\n </FormControl>\n </Grid>\n <Grid item xs={6}>\n <FormControl variant=\"outlined\" margin=\"normal\" fullWidth>\n <TextField\n disabled={!modelFormat || !modelSize || !quantization}\n type=\"number\"\n InputProps={{\n inputProps: {\n min: 1,\n },\n }}\n label=\"Replica\"\n value={replica}\n onChange={(e) => setReplica(parseInt(e.target.value, 10))}\n />\n </FormControl>\n </Grid>\n </Grid>\n </Box>\n <Box style={styles.buttonsContainer}>\n <button\n title=\"Launch\"\n style={styles.buttonContainer}\n onClick={() => launchModel(url, modelData)}\n disabled={\n isCallingApi ||\n isUpdatingModel ||\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== 'pytorch'))\n )\n }\n >\n {(() => {\n if (isCallingApi || isUpdatingModel) {\n return (\n <Box\n style={{ ...styles.buttonItem, backgroundColor: '#f2f2f2' }}\n >\n <CircularProgress\n size=\"20px\"\n sx={{\n color: '#000000',\n }}\n />\n </Box>\n )\n } else if (\n !(\n modelFormat &&\n modelSize &&\n modelData &&\n (quantization ||\n (!modelData.is_builtin && modelFormat !== 'pytorch'))\n )\n ) {\n return (\n <Box\n style={{ ...styles.buttonItem, backgroundColor: '#f2f2f2' }}\n >\n <RocketLaunchOutlined size=\"20px\" />\n </Box>\n )\n } else {\n return (\n <Box style={styles.buttonItem}>\n <RocketLaunchOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n )\n }\n })()}\n </button>\n <button\n title=\"Go Back\"\n style={styles.buttonContainer}\n onClick={() => setSelected(false)}\n >\n <Box style={styles.buttonItem}>\n <UndoOutlined color=\"#000000\" size=\"20px\" />\n </Box>\n </button>\n </Box>\n </Box>\n </Box>\n )\n}\n\nexport default ModelCard\n"],"mappings":"8aAAA,OACEA,YAAY,CACZC,gBAAgB,CAChBC,kBAAkB,CAClBC,oBAAoB,CACpBC,YAAY,KACP,qBAAqB,CAC5B,MAAO,CAAAC,UAAU,KAAM,4BAA4B,CACnD,OACEC,GAAG,CACHC,IAAI,CACJC,gBAAgB,CAChBC,WAAW,CAC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EV,CAAC,IAAM,CACL,mBACEzF,IAAA,CAACpB,GAAG,EAAC0M,KAAK,CAAEtD,MAAM,CAACiC,UAAW,CAAAyB,QAAA,cAC5B1L,IAAA,CAACvB,oBAAoB,EAAC2L,KAAK,CAAC,SAAS,CAAC3E,IAAI,CAAC,MAAM,CAAE,CAAC,CACjD,CAAC,CAEV,CACF,CAAC,CAAE,CAAC,CACE,CAAC,cACTzF,IAAA,WACEwO,KAAK,CAAC,SAAS,CACflD,KAAK,CAAEtD,MAAM,CAAC4B,eAAgB,CAC9B6B,OAAO,CAAE,SAAAA,QAAA,QAAM,CAAArK,WAAW,CAAC,KAAK,CAAC,EAAC,CAAAsK,QAAA,cAElC1L,IAAA,CAACpB,GAAG,EAAC0M,KAAK,CAAEtD,MAAM,CAACiC,UAAW,CAAAyB,QAAA,cAC5B1L,IAAA,CAACtB,YAAY,EAAC0L,KAAK,CAAC,SAAS,CAAC3E,IAAI,CAAC,MAAM,CAAE,CAAC,CACzC,CAAC,CACA,CAAC,EACN,CAAC,EACH,CAAC,EACH,CAAC,CAEV,CAAC,CAED,cAAe,CAAApF,SAAS"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -0,0 +1 @@
1
+ {"ast":null,"code":"import _objectSpread from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/objectSpread2.js\";import _slicedToArray from\"/home/runner/work/inference/inference/xinference/web/ui/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";import DeleteOutlineOutlinedIcon from'@mui/icons-material/DeleteOutlineOutlined';import OpenInBrowserOutlinedIcon from'@mui/icons-material/OpenInBrowserOutlined';import{TabContext,TabList,TabPanel}from'@mui/lab';import{Box,Stack,Tab}from'@mui/material';import{DataGrid}from'@mui/x-data-grid';import React,{useContext,useEffect,useState}from'react';import{useCookies}from'react-cookie';import{useNavigate}from'react-router-dom';import{ApiContext}from'../../components/apiContext';import ErrorMessageSnackBar from'../../components/errorMessageSnackBar';import fetcher from'../../components/fetcher';import Title from'../../components/Title';import{jsx as _jsx}from\"react/jsx-runtime\";import{jsxs as _jsxs}from\"react/jsx-runtime\";var RunningModels=function RunningModels(){var _React$useState=React.useState('1'),_React$useState2=_slicedToArray(_React$useState,2),tabValue=_React$useState2[0],setTabValue=_React$useState2[1];var _useState=useState([]),_useState2=_slicedToArray(_useState,2),llmData=_useState2[0],setLlmData=_useState2[1];var _useState3=useState([]),_useState4=_slicedToArray(_useState3,2),embeddingModelData=_useState4[0],setEmbeddingModelData=_useState4[1];var _useState5=useState([]),_useState6=_slicedToArray(_useState5,2),imageModelData=_useState6[0],setImageModelData=_useState6[1];var _useState7=useState([]),_useState8=_slicedToArray(_useState7,2),rerankModelData=_useState8[0],setRerankModelData=_useState8[1];var _useContext=useContext(ApiContext),isCallingApi=_useContext.isCallingApi,setIsCallingApi=_useContext.setIsCallingApi;var _useContext2=useContext(ApiContext),isUpdatingModel=_useContext2.isUpdatingModel,setIsUpdatingModel=_useContext2.setIsUpdatingModel;var _useContext3=useContext(ApiContext),setErrorMsg=_useContext3.setErrorMsg;var _useCookies=useCookies(['token']),_useCookies2=_slicedToArray(_useCookies,1),cookie=_useCookies2[0];var navigate=useNavigate();var endPoint=useContext(ApiContext).endPoint;var handleTabChange=function handleTabChange(event,newValue){setTabValue(newValue);};var update=function update(isCallingApi){if(cookie.token===''||cookie.token===undefined){return;}if(cookie.token==='need_auth'){navigate('/login',{replace:true});return;}if(isCallingApi){setLlmData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setEmbeddingModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setImageModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);setRerankModelData([{id:'Loading, do not refresh page...',url:'IS_LOADING'}]);}else{setIsUpdatingModel(true);fetcher(\"\".concat(endPoint,\"/v1/models/\"),{method:'GET'}).then(function(response){if(!response.ok){response.json().then(function(errorData){setErrorMsg(\"Login failed: \".concat(response.status,\" - \").concat(errorData.detail||'Unknown error'));});}else{response.json().then(function(data){var newLlmData=[];var newEmbeddingModelData=[];var newImageModelData=[];var newRerankModelData=[];Object.entries(data).forEach(function(_ref){var _ref2=_slicedToArray(_ref,2),key=_ref2[0],value=_ref2[1];var newValue=_objectSpread(_objectSpread({},value),{},{id:key,url:key});if(newValue.model_type==='LLM'){newLlmData.push(newValue);}else if(newValue.model_type==='embedding'){newEmbeddingModelData.push(newValue);}else if(newValue.model_type==='image'){newImageModelData.push(newValue);}else if(newValue.model_type==='rerank'){newRerankModelData.push(newValue);}});setLlmData(newLlmData);setEmbeddingModelData(newEmbeddingModelData);setImageModelData(newImageModelData);setRerankModelData(newRerankModelData);setIsUpdatingModel(false);});}}).catch(function(error){console.error('Error:',error);setIsUpdatingModel(false);});}};useEffect(function(){update(isCallingApi);// eslint-disable-next-line\n},[isCallingApi,cookie.token]);var llmColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:'Name',flex:1},{field:'address',headerName:'Address',flex:1},{field:'accelerators',headerName:'GPU Indexes',flex:1},{field:'model_size_in_billions',headerName:'Size',flex:1},{field:'quantization',headerName:'Quantization',flex:1},{field:'replica',headerName:'Replica',flex:1},{field:'url',headerName:'Actions',flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref3){var row=_ref3.row;var url=row.url;var openUrl=\"\".concat(endPoint,\"/\")+url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;var gradioUrl=\"\".concat(endPoint,\"/v1/ui/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsxs(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:[/*#__PURE__*/_jsx(\"button\",{title:\"Launch Web UI\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){// Make sure no ongoing call\nreturn;}setIsCallingApi(true);fetcher(openUrl,{method:'HEAD'}).then(function(response){if(response.status===404){// If web UI doesn't exist (404 Not Found)\nconsole.log('UI does not exist, creating new...');return fetcher(gradioUrl,{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({model_type:row.model_type,model_name:row.model_family,model_size_in_billions:row.model_size_in_billions,model_format:row.model_format,quantization:row.quantization,context_length:row.context_length,model_ability:row.model_ability,model_description:row.model_description,model_lang:row.model_lang})}).then(function(response){return response.json();}).then(function(){return window.open(openUrl,'_blank','noopener noreferrer');}).finally(function(){return setIsCallingApi(false);});}else if(response.ok){// If web UI does exist\nconsole.log('UI exists, opening...');window.open(openUrl,'_blank','noopener noreferrer');setIsCallingApi(false);}else{// Other HTTP errors\nconsole.error(\"Unexpected response status: \".concat(response.status));setIsCallingApi(false);}}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(OpenInBrowserOutlinedIcon,{})})}),/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})]});}}];var embeddingModelColumns=[{field:'id',headerName:'ID',flex:1,minWidth:250},{field:'model_name',headerName:'Name',flex:1},{field:'address',headerName:'Address',flex:1},{field:'accelerators',headerName:'GPU Indexes',flex:1},{field:'replica',headerName:'Replica',flex:1},{field:'url',headerName:'Actions',flex:1,minWidth:200,sortable:false,filterable:false,disableColumnMenu:true,renderCell:function renderCell(_ref4){var row=_ref4.row;var url=row.url;var closeUrl=\"\".concat(endPoint,\"/v1/models/\")+url;if(url==='IS_LOADING'){return/*#__PURE__*/_jsx(\"div\",{});}return/*#__PURE__*/_jsx(Box,{style:{width:'100%',display:'flex',justifyContent:'left',alignItems:'left'},children:/*#__PURE__*/_jsx(\"button\",{title:\"Terminate Model\",style:{borderWidth:'0px',backgroundColor:'transparent',paddingLeft:'0px',paddingRight:'10px'},onClick:function onClick(){if(isCallingApi||isUpdatingModel){return;}setIsCallingApi(true);fetcher(closeUrl,{method:'DELETE'}).then(function(response){response.json();}).then(function(){setIsCallingApi(false);}).catch(function(error){console.error('Error:',error);setIsCallingApi(false);});},children:/*#__PURE__*/_jsx(Box,{width:\"40px\",m:\"0 auto\",p:\"5px\",display:\"flex\",justifyContent:\"center\",borderRadius:\"4px\",style:{border:'1px solid #e5e7eb',borderWidth:'1px',borderColor:'#e5e7eb'},children:/*#__PURE__*/_jsx(DeleteOutlineOutlinedIcon,{})})})});}}];var imageModelColumns=embeddingModelColumns;var rerankModelColumns=embeddingModelColumns;var dataGridStyle={'& .MuiDataGrid-cell':{borderBottom:'none'},'& .MuiDataGrid-columnHeaders':{borderBottom:'none'},'& .MuiDataGrid-columnHeaderTitle':{fontWeight:'bold'},'& .MuiDataGrid-virtualScroller':{overflowX:'visible !important',overflow:'visible'},'& .MuiDataGrid-footerContainer':{borderTop:'none'},'border-width':'0px'};var noRowsOverlay=function noRowsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models\"});};var noResultsOverlay=function noResultsOverlay(){return/*#__PURE__*/_jsx(Stack,{height:\"100%\",alignItems:\"center\",justifyContent:\"center\",children:\"No Running Models Matches\"});};return/*#__PURE__*/_jsxs(Box,{sx:{height:'100%',width:'100%',paddingLeft:'20px',paddingTop:'20px'},children:[/*#__PURE__*/_jsx(Title,{title:\"Running Models\"}),/*#__PURE__*/_jsx(ErrorMessageSnackBar,{}),/*#__PURE__*/_jsxs(TabContext,{value:tabValue,children:[/*#__PURE__*/_jsx(Box,{sx:{borderBottom:1,borderColor:'divider'},children:/*#__PURE__*/_jsxs(TabList,{value:tabValue,onChange:handleTabChange,\"aria-label\":\"tabs\",children:[/*#__PURE__*/_jsx(Tab,{label:\"Language Models\",value:\"1\"}),/*#__PURE__*/_jsx(Tab,{label:\"Embedding Models\",value:\"2\"}),/*#__PURE__*/_jsx(Tab,{label:\"Rerank models\",value:\"3\"}),/*#__PURE__*/_jsx(Tab,{label:\"Image models\",value:\"4\"})]})}),/*#__PURE__*/_jsx(TabPanel,{value:\"1\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:llmData,columns:llmColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"2\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:embeddingModelData,columns:embeddingModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"3\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:rerankModelData,columns:rerankModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})}),/*#__PURE__*/_jsx(TabPanel,{value:\"4\",sx:{padding:0},children:/*#__PURE__*/_jsx(Box,{sx:{height:'100%',width:'100%'},children:/*#__PURE__*/_jsx(DataGrid,{rows:imageModelData,columns:imageModelColumns,autoHeight:true,sx:dataGridStyle,slots:{noRowsOverlay:noRowsOverlay,noResultsOverlay:noResultsOverlay}})})})]})]});};export default RunningModels;","map":{"version":3,"names":["DeleteOutlineOutlinedIcon","OpenInBrowserOutlinedIcon","TabContext","TabList","TabPanel","Box","Stack","Tab","DataGrid","React","useContext","useEffect","useState","useCookies","useNavigate","ApiContext","ErrorMessageSnackBar","fetcher","Title","jsx","_jsx","jsxs","_jsxs","RunningModels","_React$useState","_React$useState2","_slicedToArray","tabValue","setTabValue","_useState","_useState2","llmData","setLlmData","_useState3","_useState4","embeddingModelData","setEmbeddingModelData","_useState5","_useState6","imageModelData","setImageModelData","_useState7","_useState8","rerankModelData","setRerankModelData","_useContext","isCallingApi","setIsCallingApi","_useContext2","isUpdatingModel","setIsUpdatingModel","_useContext3","setErrorMsg","_useCookies","_useCookies2","cookie","navigate","endPoint","handleTabChange","event","newValue","update","token","undefined","replace","id","url","concat","method","then","response","ok","json","errorData","status","detail","data","newLlmData","newEmbeddingModelData","newImageModelData","newRerankModelData","Object","entries","forEach","_ref","_ref2","key","value","_objectSpread","model_type","push","catch","error","console","llmColumns","field","headerName","flex","minWidth","sortable","filterable","disableColumnMenu","renderCell","_ref3","row","openUrl","closeUrl","gradioUrl","style","width","display","justifyContent","alignItems","children","title","borderWidth","backgroundColor","paddingLeft","paddingRight","onClick","log","headers","body","JSON","stringify","model_name","model_family","model_size_in_billions","model_format","quantization","context_length","model_ability","model_description","model_lang","window","open","finally","m","p","borderRadius","border","borderColor","embeddingModelColumns","_ref4","imageModelColumns","rerankModelColumns","dataGridStyle","borderBottom","fontWeight","overflowX","overflow","borderTop","noRowsOverlay","height","noResultsOverlay","sx","paddingTop","onChange","label","padding","rows","columns","autoHeight","slots"],"sources":["/home/runner/work/inference/inference/xinference/web/ui/src/scenes/running_models/index.js"],"sourcesContent":["import DeleteOutlineOutlinedIcon from '@mui/icons-material/DeleteOutlineOutlined'\nimport OpenInBrowserOutlinedIcon from '@mui/icons-material/OpenInBrowserOutlined'\nimport { TabContext, TabList, TabPanel } from '@mui/lab'\nimport { Box, Stack, Tab } from '@mui/material'\nimport { DataGrid } from '@mui/x-data-grid'\nimport React, { useContext, useEffect, useState } from 'react'\nimport { useCookies } from 'react-cookie'\nimport { useNavigate } from 'react-router-dom'\n\nimport { ApiContext } from '../../components/apiContext'\nimport ErrorMessageSnackBar from '../../components/errorMessageSnackBar'\nimport fetcher from '../../components/fetcher'\nimport Title from '../../components/Title'\n\nconst RunningModels = () => {\n const [tabValue, setTabValue] = React.useState('1')\n const [llmData, setLlmData] = useState([])\n const [embeddingModelData, setEmbeddingModelData] = useState([])\n const [imageModelData, setImageModelData] = useState([])\n const [rerankModelData, setRerankModelData] = useState([])\n const { isCallingApi, setIsCallingApi } = useContext(ApiContext)\n const { isUpdatingModel, setIsUpdatingModel } = useContext(ApiContext)\n const { setErrorMsg } = useContext(ApiContext)\n const [cookie] = useCookies(['token'])\n const navigate = useNavigate()\n const endPoint = useContext(ApiContext).endPoint\n\n const handleTabChange = (event, newValue) => {\n setTabValue(newValue)\n }\n\n const update = (isCallingApi) => {\n if (cookie.token === '' || cookie.token === undefined) {\n return\n }\n if (cookie.token === 'need_auth') {\n navigate('/login', { replace: true })\n return\n }\n if (isCallingApi) {\n setLlmData([{ id: 'Loading, do not refresh page...', url: 'IS_LOADING' }])\n setEmbeddingModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setImageModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n setRerankModelData([\n { id: 'Loading, do not refresh page...', url: 'IS_LOADING' },\n ])\n } else {\n setIsUpdatingModel(true)\n fetcher(`${endPoint}/v1/models/`, {\n method: 'GET',\n })\n .then((response) => {\n if (!response.ok) {\n response.json().then((errorData) => {\n setErrorMsg(\n `Login failed: ${response.status} - ${\n errorData.detail || 'Unknown error'\n }`\n )\n })\n } else {\n response.json().then((data) => {\n const newLlmData = []\n const newEmbeddingModelData = []\n const newImageModelData = []\n const newRerankModelData = []\n Object.entries(data).forEach(([key, value]) => {\n let newValue = {\n ...value,\n id: key,\n url: key,\n }\n if (newValue.model_type === 'LLM') {\n newLlmData.push(newValue)\n } else if (newValue.model_type === 'embedding') {\n newEmbeddingModelData.push(newValue)\n } else if (newValue.model_type === 'image') {\n newImageModelData.push(newValue)\n } else if (newValue.model_type === 'rerank') {\n newRerankModelData.push(newValue)\n }\n })\n setLlmData(newLlmData)\n setEmbeddingModelData(newEmbeddingModelData)\n setImageModelData(newImageModelData)\n setRerankModelData(newRerankModelData)\n setIsUpdatingModel(false)\n })\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsUpdatingModel(false)\n })\n }\n }\n\n useEffect(() => {\n update(isCallingApi)\n // eslint-disable-next-line\n }, [isCallingApi, cookie.token])\n\n const llmColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: 'Name',\n flex: 1,\n },\n {\n field: 'address',\n headerName: 'Address',\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: 'GPU Indexes',\n flex: 1,\n },\n {\n field: 'model_size_in_billions',\n headerName: 'Size',\n flex: 1,\n },\n {\n field: 'quantization',\n headerName: 'Quantization',\n flex: 1,\n },\n {\n field: 'replica',\n headerName: 'Replica',\n flex: 1,\n },\n {\n field: 'url',\n headerName: 'Actions',\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const openUrl = `${endPoint}/` + url\n const closeUrl = `${endPoint}/v1/models/` + url\n const gradioUrl = `${endPoint}/v1/ui/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Launch Web UI\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n // Make sure no ongoing call\n return\n }\n\n setIsCallingApi(true)\n\n fetcher(openUrl, {\n method: 'HEAD',\n })\n .then((response) => {\n if (response.status === 404) {\n // If web UI doesn't exist (404 Not Found)\n console.log('UI does not exist, creating new...')\n return fetcher(gradioUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n model_type: row.model_type,\n model_name: row.model_family,\n model_size_in_billions: row.model_size_in_billions,\n model_format: row.model_format,\n quantization: row.quantization,\n context_length: row.context_length,\n model_ability: row.model_ability,\n model_description: row.model_description,\n model_lang: row.model_lang,\n }),\n })\n .then((response) => response.json())\n .then(() =>\n window.open(openUrl, '_blank', 'noopener noreferrer')\n )\n .finally(() => setIsCallingApi(false))\n } else if (response.ok) {\n // If web UI does exist\n console.log('UI exists, opening...')\n window.open(openUrl, '_blank', 'noopener noreferrer')\n setIsCallingApi(false)\n } else {\n // Other HTTP errors\n console.error(\n `Unexpected response status: ${response.status}`\n )\n setIsCallingApi(false)\n }\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <OpenInBrowserOutlinedIcon />\n </Box>\n </button>\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n\n const embeddingModelColumns = [\n {\n field: 'id',\n headerName: 'ID',\n flex: 1,\n minWidth: 250,\n },\n {\n field: 'model_name',\n headerName: 'Name',\n flex: 1,\n },\n {\n field: 'address',\n headerName: 'Address',\n flex: 1,\n },\n {\n field: 'accelerators',\n headerName: 'GPU Indexes',\n flex: 1,\n },\n {\n field: 'replica',\n headerName: 'Replica',\n flex: 1,\n },\n {\n field: 'url',\n headerName: 'Actions',\n flex: 1,\n minWidth: 200,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n renderCell: ({ row }) => {\n const url = row.url\n const closeUrl = `${endPoint}/v1/models/` + url\n\n if (url === 'IS_LOADING') {\n return <div></div>\n }\n\n return (\n <Box\n style={{\n width: '100%',\n display: 'flex',\n justifyContent: 'left',\n alignItems: 'left',\n }}\n >\n <button\n title=\"Terminate Model\"\n style={{\n borderWidth: '0px',\n backgroundColor: 'transparent',\n paddingLeft: '0px',\n paddingRight: '10px',\n }}\n onClick={() => {\n if (isCallingApi || isUpdatingModel) {\n return\n }\n setIsCallingApi(true)\n fetcher(closeUrl, {\n method: 'DELETE',\n })\n .then((response) => {\n response.json()\n })\n .then(() => {\n setIsCallingApi(false)\n })\n .catch((error) => {\n console.error('Error:', error)\n setIsCallingApi(false)\n })\n }}\n >\n <Box\n width=\"40px\"\n m=\"0 auto\"\n p=\"5px\"\n display=\"flex\"\n justifyContent=\"center\"\n borderRadius=\"4px\"\n style={{\n border: '1px solid #e5e7eb',\n borderWidth: '1px',\n borderColor: '#e5e7eb',\n }}\n >\n <DeleteOutlineOutlinedIcon />\n </Box>\n </button>\n </Box>\n )\n },\n },\n ]\n\n const imageModelColumns = embeddingModelColumns\n const rerankModelColumns = embeddingModelColumns\n\n const dataGridStyle = {\n '& .MuiDataGrid-cell': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaders': {\n borderBottom: 'none',\n },\n '& .MuiDataGrid-columnHeaderTitle': {\n fontWeight: 'bold',\n },\n '& .MuiDataGrid-virtualScroller': {\n overflowX: 'visible !important',\n overflow: 'visible',\n },\n '& .MuiDataGrid-footerContainer': {\n borderTop: 'none',\n },\n 'border-width': '0px',\n }\n\n const noRowsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models\n </Stack>\n )\n }\n\n const noResultsOverlay = () => {\n return (\n <Stack height=\"100%\" alignItems=\"center\" justifyContent=\"center\">\n No Running Models Matches\n </Stack>\n )\n }\n\n return (\n <Box\n sx={{\n height: '100%',\n width: '100%',\n paddingLeft: '20px',\n paddingTop: '20px',\n }}\n >\n <Title title=\"Running Models\" />\n <ErrorMessageSnackBar />\n <TabContext value={tabValue}>\n <Box sx={{ borderBottom: 1, borderColor: 'divider' }}>\n <TabList\n value={tabValue}\n onChange={handleTabChange}\n aria-label=\"tabs\"\n >\n <Tab label=\"Language Models\" value=\"1\" />\n <Tab label=\"Embedding Models\" value=\"2\" />\n <Tab label=\"Rerank models\" value=\"3\" />\n <Tab label=\"Image models\" value=\"4\" />\n </TabList>\n </Box>\n <TabPanel value=\"1\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={llmData}\n columns={llmColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"2\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={embeddingModelData}\n columns={embeddingModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"3\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={rerankModelData}\n columns={rerankModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n <TabPanel value=\"4\" sx={{ padding: 0 }}>\n <Box sx={{ height: '100%', width: '100%' }}>\n <DataGrid\n rows={imageModelData}\n columns={imageModelColumns}\n autoHeight={true}\n sx={dataGridStyle}\n slots={{\n noRowsOverlay: noRowsOverlay,\n noResultsOverlay: noResultsOverlay,\n }}\n />\n </Box>\n </TabPanel>\n </TabContext>\n </Box>\n )\n}\n\nexport default RunningModels\n"],"mappings":"yRAAA,MAAO,CAAAA,yBAAyB,KAAM,2CAA2C,CACjF,MAAO,CAAAC,yBAAyB,KAAM,2CAA2C,CACjF,OAASC,UAAU,CAAEC,OAAO,CAAEC,QAAQ,KAAQ,UAAU,CACxD,OAASC,GAAG,CAAEC,KAAK,CAAEC,GAAG,KAAQ,eAAe,CAC/C,OAASC,QAAQ,KAAQ,kBAAkB,CAC3C,MAAO,CAAAC,KAAK,EAAIC,UAAU,CAAEC,SAAS,CAAEC,QAAQ,KAAQ,OAAO,CAC9D,OAASC,UAAU,KAAQ,cAAc,CACzC,OAASC,WAAW,KAAQ,kBAAkB,CAE9C,OAASC,UAAU,KAAQ,6BAA6B,CACxD,MAAO,CAAAC,oBAAoB,KAAM,uCAAuC,CACxE,MAAO,CAAAC,OAAO,KAAM,0BAA0B,CAC9C,MAAO,CAAAC,KAAK,KAAM,wBAAwB,QAAAC,GAAA,IAAAC,IAAA,gCAAAC,IAAA,IAAAC,KAAA,yBAE1C,GAAM,CAAAC,aAAa,CAAG,QAAhB,CAAAA,aAAaA,C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,IAAA,CAACf,GAAG,EAACsJ,EAAE,CAAE,CAAEF,MAAM,CAAE,MAAM,CAAE5C,KAAK,CAAE,MAAO,CAAE,CAAAI,QAAA,cACzC7F,IAAA,CAACZ,QAAQ,EACPwJ,IAAI,CAAEzH,cAAe,CACrB0H,OAAO,CAAEjB,iBAAkB,CAC3BkB,UAAU,CAAE,IAAK,CACjBP,EAAE,CAAET,aAAc,CAClBiB,KAAK,CAAE,CACLX,aAAa,CAAEA,aAAa,CAC5BE,gBAAgB,CAAEA,gBACpB,CAAE,CACH,CAAC,CACC,CAAC,CACE,CAAC,EACD,CAAC,EACV,CAAC,CAEV,CAAC,CAED,cAAe,CAAAnI,aAAa"},"metadata":{},"sourceType":"module","externalDependencies":[]}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xinference
3
- Version: 0.9.0
3
+ Version: 0.9.2
4
4
  Summary: Model Serving Made Easy
5
5
  Home-page: https://github.com/xorbitsai/inference
6
6
  Author: Qin Xuye
@@ -42,6 +42,7 @@ Requires-Dist: passlib[bcrypt]
42
42
  Requires-Dist: aioprometheus[starlette] >=23.12.0
43
43
  Requires-Dist: pynvml
44
44
  Requires-Dist: async-timeout
45
+ Requires-Dist: peft
45
46
  Provides-Extra: all
46
47
  Requires-Dist: chatglm-cpp >=0.3.0 ; extra == 'all'
47
48
  Requires-Dist: llama-cpp-python >=0.2.25 ; extra == 'all'
@@ -60,7 +61,7 @@ Requires-Dist: controlnet-aux ; extra == 'all'
60
61
  Requires-Dist: orjson ; extra == 'all'
61
62
  Requires-Dist: optimum ; extra == 'all'
62
63
  Requires-Dist: auto-gptq ; (sys_platform != "darwin") and extra == 'all'
63
- Requires-Dist: vllm >=0.2.6 ; (sys_platform == "linux") and extra == 'all'
64
+ Requires-Dist: vllm <0.3.1,>=0.2.6 ; (sys_platform == "linux") and extra == 'all'
64
65
  Provides-Extra: benchmark
65
66
  Requires-Dist: psutil ; extra == 'benchmark'
66
67
  Provides-Extra: dev
@@ -116,8 +117,9 @@ Requires-Dist: einops ; extra == 'transformers'
116
117
  Requires-Dist: tiktoken ; extra == 'transformers'
117
118
  Requires-Dist: auto-gptq ; extra == 'transformers'
118
119
  Requires-Dist: optimum ; extra == 'transformers'
120
+ Requires-Dist: peft ; extra == 'transformers'
119
121
  Provides-Extra: vllm
120
- Requires-Dist: vllm >=0.2.6 ; extra == 'vllm'
122
+ Requires-Dist: vllm <0.3.1,>=0.2.6 ; extra == 'vllm'
121
123
 
122
124
  <div align="center">
123
125
  <img src="./assets/xorbits-logo.png" width="180px" alt="xorbits" />
@@ -155,12 +157,12 @@ potential of cutting-edge AI models.
155
157
  - Function calling API: [#701](https://github.com/xorbitsai/inference/pull/701), here's example: https://github.com/xorbitsai/inference/blob/main/examples/FunctionCall.ipynb
156
158
  - Support rerank model: [#672](https://github.com/xorbitsai/inference/pull/672)
157
159
  ### New Models
160
+ - Built-in support for [Gemma](https://github.com/google-deepmind/gemma): [#1024](https://github.com/xorbitsai/inference/pull/1024)
161
+ - Built-in support for [Qwen1.5](https://github.com/QwenLM/Qwen1.5): [#994](https://github.com/xorbitsai/inference/pull/994)
158
162
  - Built-in support for [Yi-VL](https://github.com/01-ai/Yi): [#946](https://github.com/xorbitsai/inference/pull/946)
159
163
  - Built-in support for [Whisper](https://github.com/openai/whisper): [#929](https://github.com/xorbitsai/inference/pull/929)
160
164
  - Built-in support for [Orion-chat](https://huggingface.co/OrionStarAI): [#933](https://github.com/xorbitsai/inference/pull/933)
161
165
  - Built-in support for [InternLM2-chat](https://huggingface.co/internlm/internlm2-chat-7b): [#829](https://github.com/xorbitsai/inference/pull/913)
162
- - Built-in support for [qwen-vl](https://huggingface.co/Qwen/Qwen-VL-Chat): [#829](https://github.com/xorbitsai/inference/pull/829)
163
- - Built-in support for [phi-2](https://huggingface.co/microsoft/phi-2): [#828](https://github.com/xorbitsai/inference/pull/828)
164
166
  ### Integrations
165
167
  - [Dify](https://docs.dify.ai/advanced/model-configuration/xinference): an LLMOps platform that enables developers (and even non-developers) to quickly build useful applications based on large language models, ensuring they are visual, operable, and improvable.
166
168
  - [Chatbox](https://chatboxai.app/): a desktop client for multiple cutting-edge LLM models, available on Windows, Mac and Linux.