Add new Mintlify documentation site (docs_new/) (#23001)

Co-authored-by: AdityaVKochar <adityavardhankochar@gmail.com>
Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com>
Co-authored-by: adhyan-jain <adhyanjain2006@gmail.com>
Co-authored-by: Adhyan Jain <71976554+adhyan-jain@users.noreply.github.com>
Co-authored-by: Maitri-shah29 <maitrirajivshah@gmail.com>
Co-authored-by: Adarsh Shirawalmath <114558126+adarshxs@users.noreply.github.com>
Co-authored-by: Maitri Shah <shah29maitri@gmail.com>
Co-authored-by: Aditya Vardhan Kochar <80113212+AdityaVKochar@users.noreply.github.com>
Co-authored-by: Rishit Shivam <164783543+pokymono@users.noreply.github.com>
Co-authored-by: Rishitshivam <164783543+Rishitshivam@users.noreply.github.com>
Co-authored-by: IshhanKheria <ishhankheria06@gmail.com>
Co-authored-by: Ishita Joshi <ishitata.joshi@gmail.com>
Co-authored-by: Richard Chen <104477092+Richardczl98@users.noreply.github.com>
Co-authored-by: longGGGGGG <553746008@qq.com>
Co-authored-by: Richard <richardchen@radixark.ai>
Co-authored-by: Nakul Sinha <nakul.new4socials@gmail.com>
Co-authored-by: Divyam Agrawal <ludicrouslytrue@gmail.com>
Co-authored-by: Richardczl98 <Zhenlinc@stanford.edu>
Co-authored-by: Krishang Zinzuwadia <krishangzinzuwadia@gmail.com>
Co-authored-by: nimeshas <nimesha.s106@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jignas Paturu <86356085+JignasP@users.noreply.github.com>
Co-authored-by: zijiexia <37504505+zijiexia@users.noreply.github.com>
This commit is contained in:
Mingyi
2026-04-20 15:10:22 -07:00
committed by GitHub
co-authored by AdityaVKochar mintlify[bot] adhyan-jain Adhyan Jain Maitri-shah29 Adarsh Shirawalmath Maitri Shah Aditya Vardhan Kochar Rishit Shivam Rishitshivam IshhanKheria Ishita Joshi Richard Chen longGGGGGG Richard Nakul Sinha Divyam Agrawal Richardczl98 Krishang Zinzuwadia nimeshas Claude Opus 4.6 github-actions[bot] Jignas Paturu zijiexia
parent 575fdc2c4c
commit a3291b5654
330 changed files with 100371 additions and 0 deletions
@@ -0,0 +1,335 @@
export const FluxDeployment = () => {
const config = {
modelFamily: 'FLUX',
options: {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'b200', label: 'B200', default: true },
{ id: 'h200', label: 'H200', default: false },
{ id: 'h100', label: 'H100', default: false },
{ id: 'mi355x', label: 'MI355X', default: false },
{ id: 'mi325x', label: 'MI325X', default: false },
{ id: 'mi300x', label: 'MI300X', default: false },
]
},
version: {
name: 'version',
title: 'Model Version',
items: [
{ id: 'flux1-dev', label: 'FLUX.1-dev', subtitle: '12B', default: true },
{ id: 'flux2-dev', label: 'FLUX.2-dev', subtitle: '32B', default: false }
]
}
},
modelConfigs: {
'flux1-dev': { repoId: 'black-forest-labs/FLUX.1-dev' },
'flux2-dev': { repoId: 'black-forest-labs/FLUX.2-dev' }
},
generateCommand: function(values) {
const { version } = values;
const config = this.modelConfigs[version];
return `sglang serve \\
--model-path ${config.repoId} \\
--ulysses-degree=1 \\
--ring-degree=1`;
}
};
if (!config || !config.options) {
return <div>Error: Invalid configuration provided</div>;
}
const getInitialState = () => {
const initialState = {};
Object.entries(config.options).forEach(([key, option]) => {
if (option.type === 'checkbox') {
initialState[key] = (option.items || [])
.filter((item) => item.default)
.map((item) => item.id);
return;
}
if (option.type === 'text') {
initialState[key] = option.default || '';
return;
}
let items = option.items || [];
if (option.getDynamicItems) {
const defaultValues = {};
Object.entries(config.options).forEach(([innerKey, innerOption]) => {
if (innerOption.type === 'checkbox') {
defaultValues[innerKey] = (innerOption.items || [])
.filter((item) => item.default)
.map((item) => item.id);
} else if (innerOption.type === 'text') {
defaultValues[innerKey] = innerOption.default || '';
} else if (innerOption.items && innerOption.items.length > 0) {
const defaultItem = innerOption.items.find((item) => item.default);
defaultValues[innerKey] = defaultItem ? defaultItem.id : innerOption.items[0].id;
}
});
items = option.getDynamicItems(defaultValues);
}
const defaultItem = items && items.find((item) => item.default);
initialState[key] = defaultItem ? defaultItem.id : items && items[0] ? items[0].id : '';
});
return initialState;
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode =
html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class', 'data-theme', 'style'],
});
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const handleCheckboxChange = (optionName, itemId, isChecked) => {
setValues((prev) => {
const currentValues = prev[optionName] || [];
if (isChecked) {
return { ...prev, [optionName]: [...currentValues, itemId] };
}
return {
...prev,
[optionName]: currentValues.filter((id) => id !== itemId),
};
});
};
const handleTextChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const command = config.generateCommand ? config.generateCommand.call(config, values) : '';
const containerStyle = {
maxWidth: '900px',
margin: '0 auto',
display: 'flex',
flexDirection: 'column',
gap: '4px',
};
const cardStyle = {
padding: '8px 12px',
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`,
borderRadius: '4px',
display: 'flex',
alignItems: 'center',
gap: '12px',
background: isDark ? '#1f2937' : '#fff',
};
const titleStyle = {
fontSize: '13px',
fontWeight: '600',
minWidth: '140px',
flexShrink: 0,
color: isDark ? '#e5e7eb' : 'inherit',
};
const itemsStyle = {
display: 'flex',
rowGap: '2px',
columnGap: '6px',
flexWrap: 'wrap',
alignItems: 'center',
flex: 1,
};
const labelBaseStyle = {
padding: '4px 10px',
border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`,
borderRadius: '3px',
cursor: 'pointer',
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
fontWeight: '500',
fontSize: '13px',
transition: 'all 0.2s',
userSelect: 'none',
minWidth: '45px',
textAlign: 'center',
flex: 1,
background: isDark ? '#374151' : '#fff',
color: isDark ? '#e5e7eb' : 'inherit',
};
const checkedStyle = {
background: '#D45D44',
color: 'white',
borderColor: '#D45D44',
};
const disabledStyle = {
cursor: 'not-allowed',
opacity: 0.5,
};
const subtitleStyle = {
display: 'block',
fontSize: '9px',
marginTop: '1px',
lineHeight: '1.1',
opacity: 0.7,
};
const textInputStyle = {
flex: 1,
padding: '8px 10px',
borderRadius: '4px',
border: `1px solid ${isDark ? '#4b5563' : '#d1d5db'}`,
background: isDark ? '#111827' : '#fff',
color: isDark ? '#e5e7eb' : '#111827',
fontSize: '13px',
};
const commandDisplayStyle = {
flex: 1,
padding: '12px 16px',
background: isDark ? '#111827' : '#f5f5f5',
borderRadius: '6px',
fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace",
fontSize: '12px',
lineHeight: '1.5',
color: isDark ? '#e5e7eb' : '#374151',
whiteSpace: 'pre-wrap',
overflowX: 'auto',
margin: 0,
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
};
return (
<div style={containerStyle} className="not-prose">
{Object.entries(config.options).map(([key, option]) => {
if (option.condition && !option.condition(values)) {
return null;
}
const items = option.getDynamicItems ? option.getDynamicItems(values) : option.items || [];
return (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{option.type === 'text' ? (
<input
type="text"
value={values[option.name] || ''}
placeholder={option.placeholder || ''}
onChange={(event) => handleTextChange(option.name, event.target.value)}
style={textInputStyle}
/>
) : option.type === 'checkbox' ? (
(option.items || []).map((item) => {
const isChecked = (values[option.name] || []).includes(item.id);
const isDisabled =
item.required ||
(typeof item.disabledWhen === 'function' && item.disabledWhen(values));
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="checkbox"
checked={isChecked}
disabled={isDisabled}
onChange={(event) =>
handleCheckboxChange(option.name, item.id, event.target.checked)
}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
) : (
items.map((item) => {
const isChecked = values[option.name] === item.id;
const isDisabled = Boolean(item.disabled);
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="radio"
name={option.name}
value={item.id}
checked={isChecked}
disabled={isDisabled}
onChange={() => !isDisabled && handleRadioChange(option.name, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
)}
</div>
</div>
);
})}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{command}</pre>
</div>
</div>
);
};
@@ -0,0 +1,115 @@
export const MOVADeployment = () => {
// Config options
const options = {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'b200', label: 'B200', default: true },
{ id: 'h200', label: 'H200', default: false },
{ id: 'h100', label: 'H100', default: false },
{ id: 'a100', label: 'A100', default: false }
]
},
resolution: {
name: 'resolution',
title: 'Resolution',
items: [
{ id: '360p', label: '360p', subtitle: 'Fast inference, lower VRAM', default: true },
{ id: '720p', label: '720p', subtitle: 'Higher resolution', default: false }
]
}
};
// Initialize state
const getInitialState = () => {
const initialState = {};
Object.entries(options).forEach(([key, option]) => {
const defaultItem = option.items.find(item => item.default);
initialState[key] = defaultItem ? defaultItem.id : option.items[0].id;
});
return initialState;
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
// Detect dark mode
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode = html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'data-theme', 'style'] });
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, value) => {
setValues(prev => ({ ...prev, [optionName]: value }));
};
// Generate command
const generateCommand = () => {
const { resolution } = values;
const modelPath = resolution === '720p'
? 'OpenMOSS-Team/MOVA-720p'
: 'OpenMOSS-Team/MOVA-360p';
return `export SG_OUTPUT_DIR=/root/output_mova
mkdir -p "$SG_OUTPUT_DIR"
sglang serve \\
--model-path ${modelPath} \\
--host 0.0.0.0 \\
--port 30002 \\
--adjust-frames false \\
--num-gpus 8 \\
--ring-degree 2 \\
--ulysses-degree 4 \\
--tp 1 \\
--enable-torch-compile \\
--save-output \\
--output-dir "$SG_OUTPUT_DIR"`;
};
// Styles - with dark mode support
const containerStyle = { maxWidth: '900px', margin: '0 auto', display: 'flex', flexDirection: 'column', gap: '4px' };
const cardStyle = { padding: '8px 12px', border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`, borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`, borderRadius: '4px', display: 'flex', alignItems: 'center', gap: '12px', background: isDark ? '#1f2937' : '#fff' };
const titleStyle = { fontSize: '13px', fontWeight: '600', minWidth: '140px', flexShrink: 0, color: isDark ? '#e5e7eb' : 'inherit' };
const itemsStyle = { display: 'flex', rowGap: '2px', columnGap: '6px', flexWrap: 'wrap', alignItems: 'center', flex: 1 };
const labelBaseStyle = { padding: '4px 10px', border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`, borderRadius: '3px', cursor: 'pointer', display: 'inline-flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', fontWeight: '500', fontSize: '13px', transition: 'all 0.2s', userSelect: 'none', minWidth: '45px', textAlign: 'center', flex: 1, background: isDark ? '#374151' : '#fff', color: isDark ? '#e5e7eb' : 'inherit' };
const checkedStyle = { background: '#D45D44', color: 'white', borderColor: '#D45D44' };
const subtitleStyle = { display: 'block', fontSize: '9px', marginTop: '1px', lineHeight: '1.1', opacity: 0.7 };
const commandDisplayStyle = { flex: 1, padding: '12px 16px', background: isDark ? '#111827' : '#f5f5f5', borderRadius: '6px', fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace", fontSize: '12px', lineHeight: '1.5', color: isDark ? '#e5e7eb' : '#374151', whiteSpace: 'pre-wrap', overflowX: 'auto', margin: 0, border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}` };
return (
<div style={containerStyle} className="not-prose">
{Object.entries(options).map(([key, option]) => (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{option.items.map(item => {
const isChecked = values[option.name] === item.id;
return (
<label key={item.id} style={{ ...labelBaseStyle, ...(isChecked ? checkedStyle : {}) }}>
<input type="radio" name={option.name} value={item.id} checked={isChecked} onChange={() => handleRadioChange(option.name, item.id)} style={{ display: 'none' }} />
{item.label}
{item.subtitle && <small style={{ ...subtitleStyle, color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit' }}>{item.subtitle}</small>}
</label>
);
})}
</div>
</div>
))}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{generateCommand()}</pre>
</div>
</div>
);
};
@@ -0,0 +1,316 @@
export const QwenImageDeployment = () => {
const config = {
modelFamily: 'Qwen-Image',
options: {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'mi300x', label: 'MI300X', default: true },
{ id: 'mi325x', label: 'MI325X', default: false },
{ id: 'mi355x', label: 'MI355X', default: false }
]
}
},
generateCommand: function(values) {
return `sglang serve \\
--model-path Qwen/Qwen-Image \\
--ulysses-degree=1 \\
--ring-degree=1`;
}
};
if (!config || !config.options) {
return <div>Error: Invalid configuration provided</div>;
}
const getInitialState = () => {
const initialState = {};
Object.entries(config.options).forEach(([key, option]) => {
if (option.type === 'checkbox') {
initialState[key] = (option.items || [])
.filter((item) => item.default)
.map((item) => item.id);
return;
}
if (option.type === 'text') {
initialState[key] = option.default || '';
return;
}
let items = option.items || [];
if (option.getDynamicItems) {
const defaultValues = {};
Object.entries(config.options).forEach(([innerKey, innerOption]) => {
if (innerOption.type === 'checkbox') {
defaultValues[innerKey] = (innerOption.items || [])
.filter((item) => item.default)
.map((item) => item.id);
} else if (innerOption.type === 'text') {
defaultValues[innerKey] = innerOption.default || '';
} else if (innerOption.items && innerOption.items.length > 0) {
const defaultItem = innerOption.items.find((item) => item.default);
defaultValues[innerKey] = defaultItem ? defaultItem.id : innerOption.items[0].id;
}
});
items = option.getDynamicItems(defaultValues);
}
const defaultItem = items && items.find((item) => item.default);
initialState[key] = defaultItem ? defaultItem.id : items && items[0] ? items[0].id : '';
});
return initialState;
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode =
html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class', 'data-theme', 'style'],
});
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const handleCheckboxChange = (optionName, itemId, isChecked) => {
setValues((prev) => {
const currentValues = prev[optionName] || [];
if (isChecked) {
return { ...prev, [optionName]: [...currentValues, itemId] };
}
return {
...prev,
[optionName]: currentValues.filter((id) => id !== itemId),
};
});
};
const handleTextChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const command = config.generateCommand ? config.generateCommand.call(config, values) : '';
const containerStyle = {
maxWidth: '900px',
margin: '0 auto',
display: 'flex',
flexDirection: 'column',
gap: '4px',
};
const cardStyle = {
padding: '8px 12px',
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`,
borderRadius: '4px',
display: 'flex',
alignItems: 'center',
gap: '12px',
background: isDark ? '#1f2937' : '#fff',
};
const titleStyle = {
fontSize: '13px',
fontWeight: '600',
minWidth: '140px',
flexShrink: 0,
color: isDark ? '#e5e7eb' : 'inherit',
};
const itemsStyle = {
display: 'flex',
rowGap: '2px',
columnGap: '6px',
flexWrap: 'wrap',
alignItems: 'center',
flex: 1,
};
const labelBaseStyle = {
padding: '4px 10px',
border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`,
borderRadius: '3px',
cursor: 'pointer',
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
fontWeight: '500',
fontSize: '13px',
transition: 'all 0.2s',
userSelect: 'none',
minWidth: '45px',
textAlign: 'center',
flex: 1,
background: isDark ? '#374151' : '#fff',
color: isDark ? '#e5e7eb' : 'inherit',
};
const checkedStyle = {
background: '#D45D44',
color: 'white',
borderColor: '#D45D44',
};
const disabledStyle = {
cursor: 'not-allowed',
opacity: 0.5,
};
const subtitleStyle = {
display: 'block',
fontSize: '9px',
marginTop: '1px',
lineHeight: '1.1',
opacity: 0.7,
};
const textInputStyle = {
flex: 1,
padding: '8px 10px',
borderRadius: '4px',
border: `1px solid ${isDark ? '#4b5563' : '#d1d5db'}`,
background: isDark ? '#111827' : '#fff',
color: isDark ? '#e5e7eb' : '#111827',
fontSize: '13px',
};
const commandDisplayStyle = {
flex: 1,
padding: '12px 16px',
background: isDark ? '#111827' : '#f5f5f5',
borderRadius: '6px',
fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace",
fontSize: '12px',
lineHeight: '1.5',
color: isDark ? '#e5e7eb' : '#374151',
whiteSpace: 'pre-wrap',
overflowX: 'auto',
margin: 0,
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
};
return (
<div style={containerStyle} className="not-prose">
{Object.entries(config.options).map(([key, option]) => {
if (option.condition && !option.condition(values)) {
return null;
}
const items = option.getDynamicItems ? option.getDynamicItems(values) : option.items || [];
return (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{option.type === 'text' ? (
<input
type="text"
value={values[option.name] || ''}
placeholder={option.placeholder || ''}
onChange={(event) => handleTextChange(option.name, event.target.value)}
style={textInputStyle}
/>
) : option.type === 'checkbox' ? (
(option.items || []).map((item) => {
const isChecked = (values[option.name] || []).includes(item.id);
const isDisabled =
item.required ||
(typeof item.disabledWhen === 'function' && item.disabledWhen(values));
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="checkbox"
checked={isChecked}
disabled={isDisabled}
onChange={(event) =>
handleCheckboxChange(option.name, item.id, event.target.checked)
}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
) : (
items.map((item) => {
const isChecked = values[option.name] === item.id;
const isDisabled = Boolean(item.disabled);
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="radio"
name={option.name}
value={item.id}
checked={isChecked}
disabled={isDisabled}
onChange={() => !isDisabled && handleRadioChange(option.name, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
)}
</div>
</div>
);
})}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{command}</pre>
</div>
</div>
);
};
@@ -0,0 +1,319 @@
export const QwenImageEditDeployment = () => {
const config = {
modelFamily: 'Qwen-Image-Edit',
options: {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'b200', label: 'B200', default: true },
{ id: 'h200', label: 'H200', default: false },
{ id: 'h100', label: 'H100', default: false },
{ id: 'mi300x', label: 'MI300X', default: false },
{ id: 'mi325x', label: 'MI325X', default: false },
{ id: 'mi355x', label: 'MI355X', default: false }
]
}
},
generateCommand: function(values) {
return `sglang serve \\
--model-path Qwen/Qwen-Image-Edit-2511 \\
--ulysses-degree=1 \\
--ring-degree=1`;
}
};
if (!config || !config.options) {
return <div>Error: Invalid configuration provided</div>;
}
const getInitialState = () => {
const initialState = {};
Object.entries(config.options).forEach(([key, option]) => {
if (option.type === 'checkbox') {
initialState[key] = (option.items || [])
.filter((item) => item.default)
.map((item) => item.id);
return;
}
if (option.type === 'text') {
initialState[key] = option.default || '';
return;
}
let items = option.items || [];
if (option.getDynamicItems) {
const defaultValues = {};
Object.entries(config.options).forEach(([innerKey, innerOption]) => {
if (innerOption.type === 'checkbox') {
defaultValues[innerKey] = (innerOption.items || [])
.filter((item) => item.default)
.map((item) => item.id);
} else if (innerOption.type === 'text') {
defaultValues[innerKey] = innerOption.default || '';
} else if (innerOption.items && innerOption.items.length > 0) {
const defaultItem = innerOption.items.find((item) => item.default);
defaultValues[innerKey] = defaultItem ? defaultItem.id : innerOption.items[0].id;
}
});
items = option.getDynamicItems(defaultValues);
}
const defaultItem = items && items.find((item) => item.default);
initialState[key] = defaultItem ? defaultItem.id : items && items[0] ? items[0].id : '';
});
return initialState;
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode =
html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class', 'data-theme', 'style'],
});
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const handleCheckboxChange = (optionName, itemId, isChecked) => {
setValues((prev) => {
const currentValues = prev[optionName] || [];
if (isChecked) {
return { ...prev, [optionName]: [...currentValues, itemId] };
}
return {
...prev,
[optionName]: currentValues.filter((id) => id !== itemId),
};
});
};
const handleTextChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const command = config.generateCommand ? config.generateCommand.call(config, values) : '';
const containerStyle = {
maxWidth: '900px',
margin: '0 auto',
display: 'flex',
flexDirection: 'column',
gap: '4px',
};
const cardStyle = {
padding: '8px 12px',
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`,
borderRadius: '4px',
display: 'flex',
alignItems: 'center',
gap: '12px',
background: isDark ? '#1f2937' : '#fff',
};
const titleStyle = {
fontSize: '13px',
fontWeight: '600',
minWidth: '140px',
flexShrink: 0,
color: isDark ? '#e5e7eb' : 'inherit',
};
const itemsStyle = {
display: 'flex',
rowGap: '2px',
columnGap: '6px',
flexWrap: 'wrap',
alignItems: 'center',
flex: 1,
};
const labelBaseStyle = {
padding: '4px 10px',
border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`,
borderRadius: '3px',
cursor: 'pointer',
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
fontWeight: '500',
fontSize: '13px',
transition: 'all 0.2s',
userSelect: 'none',
minWidth: '45px',
textAlign: 'center',
flex: 1,
background: isDark ? '#374151' : '#fff',
color: isDark ? '#e5e7eb' : 'inherit',
};
const checkedStyle = {
background: '#D45D44',
color: 'white',
borderColor: '#D45D44',
};
const disabledStyle = {
cursor: 'not-allowed',
opacity: 0.5,
};
const subtitleStyle = {
display: 'block',
fontSize: '9px',
marginTop: '1px',
lineHeight: '1.1',
opacity: 0.7,
};
const textInputStyle = {
flex: 1,
padding: '8px 10px',
borderRadius: '4px',
border: `1px solid ${isDark ? '#4b5563' : '#d1d5db'}`,
background: isDark ? '#111827' : '#fff',
color: isDark ? '#e5e7eb' : '#111827',
fontSize: '13px',
};
const commandDisplayStyle = {
flex: 1,
padding: '12px 16px',
background: isDark ? '#111827' : '#f5f5f5',
borderRadius: '6px',
fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace",
fontSize: '12px',
lineHeight: '1.5',
color: isDark ? '#e5e7eb' : '#374151',
whiteSpace: 'pre-wrap',
overflowX: 'auto',
margin: 0,
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
};
return (
<div style={containerStyle} className="not-prose">
{Object.entries(config.options).map(([key, option]) => {
if (option.condition && !option.condition(values)) {
return null;
}
const items = option.getDynamicItems ? option.getDynamicItems(values) : option.items || [];
return (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{option.type === 'text' ? (
<input
type="text"
value={values[option.name] || ''}
placeholder={option.placeholder || ''}
onChange={(event) => handleTextChange(option.name, event.target.value)}
style={textInputStyle}
/>
) : option.type === 'checkbox' ? (
(option.items || []).map((item) => {
const isChecked = (values[option.name] || []).includes(item.id);
const isDisabled =
item.required ||
(typeof item.disabledWhen === 'function' && item.disabledWhen(values));
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="checkbox"
checked={isChecked}
disabled={isDisabled}
onChange={(event) =>
handleCheckboxChange(option.name, item.id, event.target.checked)
}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
) : (
items.map((item) => {
const isChecked = values[option.name] === item.id;
const isDisabled = Boolean(item.disabled);
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="radio"
name={option.name}
value={item.id}
checked={isChecked}
disabled={isDisabled}
onChange={() => !isDisabled && handleRadioChange(option.name, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
)}
</div>
</div>
);
})}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{command}</pre>
</div>
</div>
);
};
@@ -0,0 +1,337 @@
export const Wan21Deployment = () => {
const MODELSIZE_DEFS = [
{
id: '14b',
label: '14B',
subtitle: 'High-quality, 480P/720P',
default: true,
validTasks: ['t2v', 'i2v'],
},
{
id: '1_3b',
label: '1.3B',
subtitle: 'Lightweight, 480P',
default: false,
validTasks: ['t2v'],
},
];
const modelConfigs = {
't2v-14b': {
repoId: 'Wan-AI/Wan2.1-T2V-14B-Diffusers',
supportedLoras: [
{ id: 'general', label: 'General Wan2.1 LoRA', path: 'NIVEDAN/wan2.1-lora' },
],
},
't2v-1_3b': {
repoId: 'Wan-AI/Wan2.1-T2V-1.3B-Diffusers',
supportedLoras: [],
},
'i2v-14b': {
repoId: 'Wan-AI/Wan2.1-I2V-14B-720P-Diffusers',
supportedLoras: [
{ id: 'fight', label: 'Fight Style LoRA', path: 'valiantcat/Wan2.1-Fight-LoRA' },
],
},
};
const options = {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [{ id: 'mi300x', label: 'MI300X/MI325X/MI355X', default: true }],
},
task: {
name: 'task',
title: 'Task Type',
items: [
{ id: 't2v', label: 'Text-to-Video (T2V)', default: true },
{ id: 'i2v', label: 'Image-to-Video (I2V)', default: false },
],
},
modelsize: {
name: 'modelsize',
title: 'Model Variant',
items: MODELSIZE_DEFS.map(({ validTasks, ...rest }) => rest),
},
bestPractice: {
name: 'bestPractice',
title: 'Sequence Parallelism',
items: [
{ id: 'off', label: 'Standard', default: true },
{ id: 'on', label: 'Best Practice (4 GPUs)', default: false },
],
},
};
function modelSizeItemsForTask(task) {
return MODELSIZE_DEFS.filter((item) => item.validTasks.includes(task)).map(
({ validTasks, ...rest }) => rest
);
}
const getInitialState = () => {
const task = 't2v';
const sizes = modelSizeItemsForTask(task);
const modelsize = sizes.find((size) => size.default)?.id || sizes[0].id;
const configKey = `${task}-${modelsize}`;
const supported = modelConfigs[configKey]?.supportedLoras || [];
return {
hardware: 'mi300x',
task,
modelsize,
bestPractice: 'off',
selectedLoraPath: supported[0]?.path ?? '',
};
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode =
html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class', 'data-theme', 'style'],
});
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, itemId) => {
setValues((prev) => {
let next = { ...prev, [optionName]: itemId };
if (optionName === 'task') {
const sizes = modelSizeItemsForTask(itemId);
if (!sizes.some((size) => size.id === next.modelsize)) {
next.modelsize = sizes.find((size) => size.default)?.id || sizes[0].id;
}
}
if (optionName === 'task' || optionName === 'modelsize') {
const configKey = `${next.task}-${next.modelsize}`;
const supported = modelConfigs[configKey]?.supportedLoras || [];
if (supported.length === 0) {
next.selectedLoraPath = '';
} else if (
next.selectedLoraPath &&
!supported.some((lora) => lora.path === next.selectedLoraPath)
) {
next.selectedLoraPath = supported[0].path;
}
}
return next;
});
};
const handleLoraToggle = (path) => {
setValues((prev) => ({
...prev,
selectedLoraPath: prev.selectedLoraPath === path ? '' : path,
}));
};
const handleTextChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const generateCommand = () => {
const { task, modelsize, selectedLoraPath, bestPractice } = values;
const configKey = `${task}-${modelsize}`;
const config = modelConfigs[configKey];
if (!config) {
return '# Error: Invalid configuration';
}
let command = `sglang serve \\\n --model-path ${config.repoId} \\\n --dit-layerwise-offload true`;
if (bestPractice === 'on') {
command += ` \\\n --num-gpus 4 \\\n --ulysses-degree 2 \\\n --enable-cfg-parallel`;
}
if (selectedLoraPath) {
command += ` \\\n --lora-path ${selectedLoraPath}`;
}
return command;
};
const modelSizeItems = modelSizeItemsForTask(values.task);
const loraConfigKey = `${values.task}-${values.modelsize}`;
const availableLoras = modelConfigs[loraConfigKey]?.supportedLoras || [];
const command = generateCommand();
const containerStyle = {
maxWidth: '900px',
margin: '0 auto',
display: 'flex',
flexDirection: 'column',
gap: '4px',
};
const cardStyle = {
padding: '8px 12px',
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`,
borderRadius: '4px',
display: 'flex',
alignItems: 'center',
gap: '12px',
background: isDark ? '#1f2937' : '#fff',
};
const titleStyle = {
fontSize: '13px',
fontWeight: '600',
minWidth: '140px',
flexShrink: 0,
color: isDark ? '#e5e7eb' : 'inherit',
};
const itemsStyle = {
display: 'flex',
rowGap: '2px',
columnGap: '6px',
flexWrap: 'wrap',
alignItems: 'center',
flex: 1,
};
const labelBaseStyle = {
padding: '4px 10px',
border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`,
borderRadius: '3px',
cursor: 'pointer',
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
fontWeight: '500',
fontSize: '13px',
transition: 'all 0.2s',
userSelect: 'none',
minWidth: '45px',
textAlign: 'center',
flex: 1,
background: isDark ? '#374151' : '#fff',
color: isDark ? '#e5e7eb' : 'inherit',
};
const checkedStyle = {
background: '#D45D44',
color: 'white',
borderColor: '#D45D44',
};
const disabledStyle = {
cursor: 'not-allowed',
opacity: 0.5,
};
const subtitleStyle = {
display: 'block',
fontSize: '9px',
marginTop: '1px',
lineHeight: '1.1',
opacity: 0.7,
};
const textInputStyle = {
flex: 1,
padding: '8px 10px',
borderRadius: '4px',
border: `1px solid ${isDark ? '#4b5563' : '#d1d5db'}`,
background: isDark ? '#111827' : '#fff',
color: isDark ? '#e5e7eb' : '#111827',
fontSize: '13px',
};
const commandDisplayStyle = {
flex: 1,
padding: '12px 16px',
background: isDark ? '#111827' : '#f5f5f5',
borderRadius: '6px',
fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace",
fontSize: '12px',
lineHeight: '1.5',
color: isDark ? '#e5e7eb' : '#374151',
whiteSpace: 'pre-wrap',
overflowX: 'auto',
margin: 0,
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
};
return (
<div style={containerStyle} className="not-prose">
{Object.entries(options).map(([key, option]) => (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{(key === 'modelsize' ? modelSizeItems : option.items).map((item) => {
const isChecked = values[option.name] === item.id;
return (
<label key={item.id} style={{ ...labelBaseStyle, ...(isChecked ? checkedStyle : {}) }}>
<input
type="radio"
name={option.name}
value={item.id}
checked={isChecked}
onChange={() => handleRadioChange(option.name, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small style={{ ...subtitleStyle, color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit' }}>
{item.subtitle}
</small>
)}
</label>
);
})}
</div>
</div>
))}
{availableLoras.length > 0 && (
<div style={cardStyle}>
<div style={titleStyle}>Select LoRA Model (Only some of the supported LoRAs are listed here)</div>
<div style={itemsStyle}>
{availableLoras.map((lora) => {
const isChecked = values.selectedLoraPath === lora.path;
return (
<label
key={lora.id}
style={{ ...labelBaseStyle, ...(isChecked ? checkedStyle : {}) }}
onClick={(event) => {
event.preventDefault();
handleLoraToggle(lora.path);
}}
>
<input
type="radio"
name="selectedLoraPath"
value={lora.path}
checked={isChecked}
readOnly
style={{ display: 'none' }}
/>
{lora.label}
<small style={{ ...subtitleStyle, color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit' }}>
{lora.path}
</small>
</label>
);
})}
</div>
</div>
)}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{command}</pre>
</div>
</div>
);
};
@@ -0,0 +1,216 @@
export const Wan22Deployment = () => {
const options = {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'b200', label: 'B200', default: true },
{ id: 'h200', label: 'H200', default: false },
{ id: 'mi300x', label: 'MI300X', default: false },
{ id: 'mi325x', label: 'MI325X', default: false },
{ id: 'mi355x', label: 'MI355X', default: false },
],
},
task: {
name: 'task',
title: 'Task Type',
items: [
{ id: 'i2v', label: 'Image-to-Video (I2V)', default: false },
{ id: 't2v', label: 'Text-to-Video (T2V)', default: true },
{ id: 'ti2v', label: 'Text/Image-to-Video (TI2V)', default: false },
],
},
modelsize: {
name: 'modelsize',
title: 'Model Size',
items: [
{ id: '14b', label: 'A14B', subtitle: 'Diffusers (A14B)', default: true, validTasks: ['i2v', 't2v'] },
{ id: '5b', label: '5B', subtitle: 'Diffusers', default: false, validTasks: ['ti2v'] },
],
},
bestPractice: {
name: 'bestPractice',
title: 'Sequence Parallelism',
items: [
{ id: 'off', label: 'Standard', default: true },
{ id: 'on', label: 'Best Practice (4 GPUs)', default: false },
],
},
};
const modelConfigs = {
'i2v-14b': {
repoId: 'Wan-AI/Wan2.2-I2V-A14B-Diffusers',
supportedLoras: [{ id: 'distill', path: 'lightx2v/Wan2.2-Distill-Loras' }],
},
't2v-14b': {
repoId: 'Wan-AI/Wan2.2-T2V-A14B-Diffusers',
supportedLoras: [{ id: 'arcane', path: 'Cseti/wan2.2-14B-Arcane_Jinx-lora-v1' }],
},
'ti2v-5b': {
repoId: 'Wan-AI/Wan2.2-TI2V-5B-Diffusers',
supportedLoras: [],
},
};
const getInitialState = () => ({
hardware: 'b200',
task: 't2v',
modelsize: '14b',
bestPractice: 'off',
selectedLoraPath: 'none',
});
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode = html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, { attributes: true, attributeFilter: ['class', 'data-theme', 'style'] });
return () => observer.disconnect();
}, []);
const availableLoras = (() => {
const configKey = `${values.task}-${values.modelsize}`;
return modelConfigs[configKey]?.supportedLoras || [];
})();
const handleRadioChange = (optionName, itemId) => {
setValues((prev) => {
const next = { ...prev, [optionName]: itemId };
if (optionName === 'task') {
next.modelsize = itemId === 'ti2v' ? '5b' : '14b';
}
const configKey = `${next.task}-${next.modelsize}`;
const nextSupported = modelConfigs[configKey]?.supportedLoras || [];
const isValid = nextSupported.some((lora) => lora.path === prev.selectedLoraPath);
if (!isValid) {
next.selectedLoraPath = 'none';
}
return next;
});
};
const handleLoraToggle = (path) => {
setValues((prev) => ({
...prev,
selectedLoraPath: prev.selectedLoraPath === path ? 'none' : path,
}));
};
const generateCommand = () => {
const { task, modelsize, selectedLoraPath, bestPractice } = values;
const configKey = `${task}-${modelsize}`;
const config = modelConfigs[configKey];
if (!config) {
return '# Error: Invalid configuration';
}
let command = `sglang serve \\\n --model-path ${config.repoId} \\\n --dit-layerwise-offload true`;
if (bestPractice === 'on') {
command += ` \\\n --num-gpus 4 \\\n --ulysses-degree 2 \\\n --enable-cfg-parallel`;
}
if (selectedLoraPath && selectedLoraPath !== 'none') {
command += ` \\\n --lora-path ${selectedLoraPath}`;
}
return command;
};
const containerStyle = { maxWidth: '900px', margin: '0 auto', display: 'flex', flexDirection: 'column', gap: '4px' };
const cardStyle = { padding: '8px 12px', border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`, borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`, borderRadius: '4px', display: 'flex', alignItems: 'center', gap: '12px', background: isDark ? '#1f2937' : '#fff' };
const titleStyle = { fontSize: '13px', fontWeight: '600', minWidth: '140px', flexShrink: 0, color: isDark ? '#e5e7eb' : 'inherit' };
const itemsStyle = { display: 'flex', rowGap: '2px', columnGap: '6px', flexWrap: 'wrap', alignItems: 'center', flex: 1 };
const labelBaseStyle = { padding: '4px 10px', border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`, borderRadius: '3px', cursor: 'pointer', display: 'inline-flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', fontWeight: '500', fontSize: '13px', transition: 'all 0.2s', userSelect: 'none', minWidth: '45px', textAlign: 'center', flex: 1, background: isDark ? '#374151' : '#fff', color: isDark ? '#e5e7eb' : 'inherit' };
const checkedStyle = { background: '#D45D44', color: 'white', borderColor: '#D45D44' };
const subtitleStyle = { display: 'block', fontSize: '9px', marginTop: '1px', lineHeight: '1.1', opacity: 0.7 };
const commandDisplayStyle = { flex: 1, padding: '12px 16px', background: isDark ? '#111827' : '#f5f5f5', borderRadius: '6px', fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace", fontSize: '12px', lineHeight: '1.5', color: isDark ? '#e5e7eb' : '#374151', whiteSpace: 'pre-wrap', overflowX: 'auto', margin: 0, border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}` };
return (
<div style={containerStyle} className="not-prose">
{Object.entries(options).map(([key, option]) => {
const itemsToDisplay = key === 'modelsize'
? option.items.filter((item) => item.validTasks.includes(values.task))
: option.items;
return (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{itemsToDisplay.map((item) => {
const isChecked = values[option.name] === item.id;
return (
<label key={item.id} style={{ ...labelBaseStyle, ...(isChecked ? checkedStyle : {}) }}>
<input
type="radio"
name={option.name}
checked={isChecked}
onChange={() => handleRadioChange(key, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small style={{ ...subtitleStyle, color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit' }}>
{item.subtitle}
</small>
)}
</label>
);
})}
</div>
</div>
);
})}
<div style={cardStyle}>
<div style={titleStyle}>Select LoRA Model (Only some of the supported LoRAs are listed here)</div>
<div style={itemsStyle}>
{availableLoras.length === 0 && (
<div style={{ color: isDark ? '#999' : '#666', fontSize: '12px', padding: '8px' }}>
No LoRA models available for this model.
</div>
)}
{availableLoras.map((lora) => {
const isSelected = values.selectedLoraPath === lora.path;
return (
<label
key={lora.id}
style={{ ...labelBaseStyle, ...(isSelected ? checkedStyle : {}) }}
onClick={(event) => {
event.preventDefault();
handleLoraToggle(lora.path);
}}
>
<input
type="radio"
name="loraModelSelection"
checked={isSelected}
readOnly
style={{ display: 'none' }}
/>
{lora.id}
<small style={{ ...subtitleStyle, color: isSelected ? 'rgba(255,255,255,0.85)' : 'inherit' }}>
{lora.path}
</small>
</label>
);
})}
</div>
</div>
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{generateCommand()}</pre>
</div>
</div>
);
};
@@ -0,0 +1,319 @@
export const ZImageTurboDeployment = () => {
const config = {
modelFamily: 'Z-Image-Turbo',
options: {
hardware: {
name: 'hardware',
title: 'Hardware Platform',
items: [
{ id: 'mi300x', label: 'MI300X', default: true },
{ id: 'mi325x', label: 'MI325X', default: false },
{ id: 'mi355x', label: 'MI355X', default: false },
{ id: 'b200', label: 'B200', default: true },
{ id: 'h200', label: 'H200', default: false },
{ id: 'h100', label: 'H100', default: false }
]
}
},
generateCommand: function(values) {
return `sglang serve \\
--model-path Tongyi-MAI/Z-Image-Turbo \\
--ulysses-degree=1 \\
--ring-degree=1`;
}
};
if (!config || !config.options) {
return <div>Error: Invalid configuration provided</div>;
}
const getInitialState = () => {
const initialState = {};
Object.entries(config.options).forEach(([key, option]) => {
if (option.type === 'checkbox') {
initialState[key] = (option.items || [])
.filter((item) => item.default)
.map((item) => item.id);
return;
}
if (option.type === 'text') {
initialState[key] = option.default || '';
return;
}
let items = option.items || [];
if (option.getDynamicItems) {
const defaultValues = {};
Object.entries(config.options).forEach(([innerKey, innerOption]) => {
if (innerOption.type === 'checkbox') {
defaultValues[innerKey] = (innerOption.items || [])
.filter((item) => item.default)
.map((item) => item.id);
} else if (innerOption.type === 'text') {
defaultValues[innerKey] = innerOption.default || '';
} else if (innerOption.items && innerOption.items.length > 0) {
const defaultItem = innerOption.items.find((item) => item.default);
defaultValues[innerKey] = defaultItem ? defaultItem.id : innerOption.items[0].id;
}
});
items = option.getDynamicItems(defaultValues);
}
const defaultItem = items && items.find((item) => item.default);
initialState[key] = defaultItem ? defaultItem.id : items && items[0] ? items[0].id : '';
});
return initialState;
};
const [values, setValues] = useState(getInitialState);
const [isDark, setIsDark] = useState(false);
useEffect(() => {
const checkDarkMode = () => {
const html = document.documentElement;
const isDarkMode =
html.classList.contains('dark') ||
html.getAttribute('data-theme') === 'dark' ||
html.style.colorScheme === 'dark';
setIsDark(isDarkMode);
};
checkDarkMode();
const observer = new MutationObserver(checkDarkMode);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ['class', 'data-theme', 'style'],
});
return () => observer.disconnect();
}, []);
const handleRadioChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const handleCheckboxChange = (optionName, itemId, isChecked) => {
setValues((prev) => {
const currentValues = prev[optionName] || [];
if (isChecked) {
return { ...prev, [optionName]: [...currentValues, itemId] };
}
return {
...prev,
[optionName]: currentValues.filter((id) => id !== itemId),
};
});
};
const handleTextChange = (optionName, value) => {
setValues((prev) => ({ ...prev, [optionName]: value }));
};
const command = config.generateCommand ? config.generateCommand.call(config, values) : '';
const containerStyle = {
maxWidth: '900px',
margin: '0 auto',
display: 'flex',
flexDirection: 'column',
gap: '4px',
};
const cardStyle = {
padding: '8px 12px',
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
borderLeft: `3px solid ${isDark ? '#E85D4D' : '#D45D44'}`,
borderRadius: '4px',
display: 'flex',
alignItems: 'center',
gap: '12px',
background: isDark ? '#1f2937' : '#fff',
};
const titleStyle = {
fontSize: '13px',
fontWeight: '600',
minWidth: '140px',
flexShrink: 0,
color: isDark ? '#e5e7eb' : 'inherit',
};
const itemsStyle = {
display: 'flex',
rowGap: '2px',
columnGap: '6px',
flexWrap: 'wrap',
alignItems: 'center',
flex: 1,
};
const labelBaseStyle = {
padding: '4px 10px',
border: `1px solid ${isDark ? '#9ca3af' : '#d1d5db'}`,
borderRadius: '3px',
cursor: 'pointer',
display: 'inline-flex',
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
fontWeight: '500',
fontSize: '13px',
transition: 'all 0.2s',
userSelect: 'none',
minWidth: '45px',
textAlign: 'center',
flex: 1,
background: isDark ? '#374151' : '#fff',
color: isDark ? '#e5e7eb' : 'inherit',
};
const checkedStyle = {
background: '#D45D44',
color: 'white',
borderColor: '#D45D44',
};
const disabledStyle = {
cursor: 'not-allowed',
opacity: 0.5,
};
const subtitleStyle = {
display: 'block',
fontSize: '9px',
marginTop: '1px',
lineHeight: '1.1',
opacity: 0.7,
};
const textInputStyle = {
flex: 1,
padding: '8px 10px',
borderRadius: '4px',
border: `1px solid ${isDark ? '#4b5563' : '#d1d5db'}`,
background: isDark ? '#111827' : '#fff',
color: isDark ? '#e5e7eb' : '#111827',
fontSize: '13px',
};
const commandDisplayStyle = {
flex: 1,
padding: '12px 16px',
background: isDark ? '#111827' : '#f5f5f5',
borderRadius: '6px',
fontFamily: "'Menlo', 'Monaco', 'Courier New', monospace",
fontSize: '12px',
lineHeight: '1.5',
color: isDark ? '#e5e7eb' : '#374151',
whiteSpace: 'pre-wrap',
overflowX: 'auto',
margin: 0,
border: `1px solid ${isDark ? '#374151' : '#e5e7eb'}`,
};
return (
<div style={containerStyle} className="not-prose">
{Object.entries(config.options).map(([key, option]) => {
if (option.condition && !option.condition(values)) {
return null;
}
const items = option.getDynamicItems ? option.getDynamicItems(values) : option.items || [];
return (
<div key={key} style={cardStyle}>
<div style={titleStyle}>{option.title}</div>
<div style={itemsStyle}>
{option.type === 'text' ? (
<input
type="text"
value={values[option.name] || ''}
placeholder={option.placeholder || ''}
onChange={(event) => handleTextChange(option.name, event.target.value)}
style={textInputStyle}
/>
) : option.type === 'checkbox' ? (
(option.items || []).map((item) => {
const isChecked = (values[option.name] || []).includes(item.id);
const isDisabled =
item.required ||
(typeof item.disabledWhen === 'function' && item.disabledWhen(values));
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="checkbox"
checked={isChecked}
disabled={isDisabled}
onChange={(event) =>
handleCheckboxChange(option.name, item.id, event.target.checked)
}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
) : (
items.map((item) => {
const isChecked = values[option.name] === item.id;
const isDisabled = Boolean(item.disabled);
return (
<label
key={item.id}
title={item.disabledReason || ''}
style={{
...labelBaseStyle,
...(isChecked ? checkedStyle : {}),
...(isDisabled ? disabledStyle : {}),
}}
>
<input
type="radio"
name={option.name}
value={item.id}
checked={isChecked}
disabled={isDisabled}
onChange={() => !isDisabled && handleRadioChange(option.name, item.id)}
style={{ display: 'none' }}
/>
{item.label}
{item.subtitle && (
<small
style={{
...subtitleStyle,
color: isChecked ? 'rgba(255,255,255,0.85)' : 'inherit',
}}
>
{item.subtitle}
</small>
)}
</label>
);
})
)}
</div>
</div>
);
})}
<div style={cardStyle}>
<div style={titleStyle}>Run this Command:</div>
<pre style={commandDisplayStyle}>{command}</pre>
</div>
</div>
);
};