mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-06-15 17:25:26 -04:00
Cookbook deps: drop the manual vLLM install block + Run handlers
This commit is contained in:
@@ -915,65 +915,6 @@ async function _fetchDependencies() {
|
||||
});
|
||||
});
|
||||
|
||||
// Wire the alternative-install "Run" buttons in the Manual block.
|
||||
// Each action launches the underlying command as a tmux task on the
|
||||
// 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 => {
|
||||
if (btn._wired) return;
|
||||
btn._wired = true;
|
||||
btn.addEventListener('click', (e) => {
|
||||
e.stopPropagation();
|
||||
const action = btn.dataset.depsAction;
|
||||
const sel = document.getElementById('hwfit-deps-server');
|
||||
if (sel) _applyServerSelection(sel.value);
|
||||
const host = _envState.remoteHost || '';
|
||||
const where = host || 'this server';
|
||||
const backend = _detectedBackend();
|
||||
const cmd = _depsCmdFor(action, backend);
|
||||
if (!cmd) return;
|
||||
const tag = backend === 'rocm' ? 'AMD ROCm' : 'NVIDIA CUDA';
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
// Wire the ⋮ menu on installed packages — currently just "Update".
|
||||
function _showDepMenu(anchor) {
|
||||
@@ -2123,32 +2064,6 @@ function _renderRecipes() {
|
||||
html += '</select>';
|
||||
html += '</div>';
|
||||
html += '<p class="memory-desc doclib-desc">Optional packages that extend Odysseus capabilities.</p>';
|
||||
// Alternative install methods — Odysseus runs each in a tmux task on
|
||||
// the selected server (watch in the Running tab). Wired to event
|
||||
// delegation below; no need for per-button click handlers.
|
||||
html += '<details class="cookbook-deps-manual" style="margin:4px 0 8px;font-size:11px;">';
|
||||
html += '<summary style="cursor:pointer;opacity:0.75;user-select:none;">Install vLLM (alternatives): uv venv · Docker</summary>';
|
||||
html += '<div style="margin-top:6px;display:flex;flex-direction:column;gap:8px;">';
|
||||
const _depRunBlock = (label, body, action) =>
|
||||
`<div class="cookbook-deps-cmd-block" style="display:flex;flex-direction:column;gap:3px;">`
|
||||
+ `<div style="display:flex;align-items:center;gap:6px;">`
|
||||
+ `<div style="font-size:10px;opacity:0.6;text-transform:uppercase;letter-spacing:0.5px;flex:1;">${label}</div>`
|
||||
+ `<button type="button" class="cookbook-btn cookbook-deps-run-btn" data-deps-action="${esc(action)}" style="padding:3px 9px;font-size:11px;">Run</button>`
|
||||
+ `</div>`
|
||||
+ `<pre class="cookbook-deps-cmd" style="margin:0;padding:6px 8px;border:1px solid var(--border);border-radius:4px;background:color-mix(in srgb, var(--fg) 4%, transparent);overflow-x:auto;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre;">${esc(body)}</pre>`
|
||||
+ `</div>`;
|
||||
html += _depRunBlock(
|
||||
'uv (recommended — fast, isolated venv)',
|
||||
'uv venv && source .venv/bin/activate && uv pip install -U vllm --torch-backend auto',
|
||||
'vllm-uv'
|
||||
);
|
||||
html += _depRunBlock(
|
||||
'Docker',
|
||||
'docker pull vllm/vllm-openai:latest',
|
||||
'vllm-docker'
|
||||
);
|
||||
html += '</div>';
|
||||
html += '</details>';
|
||||
html += '<div class="doclib-grid" id="cookbook-deps-list"></div>';
|
||||
html += '</div></div>';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user