mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-17 10:15:27 -04:00
Cookbook deps: NVIDIA vs AMD ROCm-aware vLLM install commands
Reads the last hwfit scan's backend (window._hwfitSystemCache.backend) and picks the right vLLM install path per vendor: - NVIDIA/CUDA (default) - uv: uv pip install -U vllm --torch-backend auto - docker: docker pull vllm/vllm-openai:latest - AMD/ROCm - uv: uv pip install -U vllm --torch-backend rocm - docker: docker pull rocm/vllm-dev:main The <pre> previews are re-painted on render to match what Run will actually launch, and the confirm dialog tags the backend so the user knows what they're committing to.
This commit is contained in:
+44
-8
@@ -917,7 +917,45 @@ async function _fetchDependencies() {
|
|||||||
|
|
||||||
// Wire the alternative-install "Run" buttons in the Manual block.
|
// Wire the alternative-install "Run" buttons in the Manual block.
|
||||||
// Each action launches the underlying command as a tmux task on the
|
// Each action launches the underlying command as a tmux task on the
|
||||||
// currently selected deps server, same as Reinstall does.
|
// currently selected deps server, same as Reinstall does. The exact
|
||||||
|
// command varies by detected GPU vendor — NVIDIA gets the standard
|
||||||
|
// vllm package + vllm/vllm-openai docker image; AMD gets the ROCm
|
||||||
|
// index/wheel + rocm/vllm-dev docker image.
|
||||||
|
const _detectedBackend = () => {
|
||||||
|
try {
|
||||||
|
const sys = window._hwfitSystemCache || {};
|
||||||
|
const b = String(sys.backend || '').toLowerCase();
|
||||||
|
if (b === 'rocm' || b === 'amd' || b === 'hip') return 'rocm';
|
||||||
|
return 'cuda';
|
||||||
|
} catch { return 'cuda'; }
|
||||||
|
};
|
||||||
|
const _depsCmdFor = (action, backend) => {
|
||||||
|
if (backend === 'rocm') {
|
||||||
|
if (action === 'vllm-uv') {
|
||||||
|
return 'uv venv && . .venv/bin/activate && uv pip install -U vllm --torch-backend rocm';
|
||||||
|
}
|
||||||
|
if (action === 'vllm-docker') {
|
||||||
|
return 'docker pull rocm/vllm-dev:main';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// NVIDIA / CUDA default
|
||||||
|
if (action === 'vllm-uv') {
|
||||||
|
return 'uv venv && . .venv/bin/activate && uv pip install -U vllm --torch-backend auto';
|
||||||
|
}
|
||||||
|
if (action === 'vllm-docker') {
|
||||||
|
return 'docker pull vllm/vllm-openai:latest';
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
};
|
||||||
|
// Re-paint the <pre> blocks with the backend-appropriate command so
|
||||||
|
// the preview matches what Run will actually launch.
|
||||||
|
const _backend = _detectedBackend();
|
||||||
|
document.querySelectorAll('.cookbook-deps-run-btn').forEach(btn => {
|
||||||
|
const block = btn.closest('.cookbook-deps-cmd-block');
|
||||||
|
const pre = block && block.querySelector('.cookbook-deps-cmd');
|
||||||
|
const cmd = _depsCmdFor(btn.dataset.depsAction, _backend);
|
||||||
|
if (pre && cmd) pre.textContent = cmd;
|
||||||
|
});
|
||||||
document.querySelectorAll('.cookbook-deps-run-btn').forEach(btn => {
|
document.querySelectorAll('.cookbook-deps-run-btn').forEach(btn => {
|
||||||
if (btn._wired) return;
|
if (btn._wired) return;
|
||||||
btn._wired = true;
|
btn._wired = true;
|
||||||
@@ -928,14 +966,12 @@ async function _fetchDependencies() {
|
|||||||
if (sel) _applyServerSelection(sel.value);
|
if (sel) _applyServerSelection(sel.value);
|
||||||
const host = _envState.remoteHost || '';
|
const host = _envState.remoteHost || '';
|
||||||
const where = host || 'this server';
|
const where = host || 'this server';
|
||||||
const cmds = {
|
const backend = _detectedBackend();
|
||||||
'vllm-uv': 'uv venv && . .venv/bin/activate && uv pip install -U vllm --torch-backend auto',
|
const cmd = _depsCmdFor(action, backend);
|
||||||
'vllm-docker': 'docker pull vllm/vllm-openai:latest',
|
|
||||||
};
|
|
||||||
const cmd = cmds[action];
|
|
||||||
if (!cmd) return;
|
if (!cmd) return;
|
||||||
if (!confirm(`Run on ${where}?\n\n${cmd}\n\nLaunches as a tmux task — watch progress in the Active tab.`)) return;
|
const tag = backend === 'rocm' ? 'AMD ROCm' : 'NVIDIA CUDA';
|
||||||
_launchServeTask(`deps-${action}`, 'deps-install', cmd);
|
if (!confirm(`Run on ${where} (${tag})?\n\n${cmd}\n\nLaunches as a tmux task — watch progress in the Active tab.`)) return;
|
||||||
|
_launchServeTask(`deps-${action}-${backend}`, 'deps-install', cmd);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user