Self-hosted AI workspace.
Python
Clarify cookbook conda env support
pewdiepie-archdaemon6f10e07ef5b8
diff --git a/static/js/cookbook.js b/static/js/cookbook.jsindex 972f38014..d59b3adc0 100644--- a/static/js/cookbook.js+++ b/static/js/cookbook.js@@ -2511,7 +2511,7 @@ function _wireTabEvents(body) {// (a new server's host is empty, which would otherwise read as "Local").export function _serverEntryHtml(s, i, defaultServer, forceRemote, isNew) {const isLocal = (forceRemote || isNew) ? false : (!s.host || s.host === 'local');- const envOpts = ['none', 'venv'].map(e => `<option value="${e}"${s.env === e ? ' selected' : ''}>${e === 'none' ? 'None' : e}</option>`).join('');+ const envOpts = [['none', 'None'], ['venv', 'venv'], ['conda', 'conda']].map(([value, label]) => `<option value="${value}"${s.env === value ? ' selected' : ''}>${label}</option>`).join('');let html = '';html += `<div class="cookbook-server-entry" data-idx="${i}" data-platform="${esc(s.platform || '')}">`;const _srvTitle = s.name || (isLocal ? 'Local' : (s.host || `Server ${i + 1}`));@@ -2537,7 +2537,7 @@ export function _serverEntryHtml(s, i, defaultServer, forceRemote, isNew) {html += `<input type="text" class="hwfit-sf cookbook-srv-host" value="${isLocal ? '' : esc(s.host || '')}" placeholder="e.g. user@ip" style="width:214.5px;flex-shrink:0;box-sizing:border-box;" ${isLocal ? 'readonly' : ''} />`;html += `<input type="text" class="hwfit-sf cookbook-srv-port" value="${esc(s.port || '')}" placeholder="Port" title="SSH port (default 22)" style="width:48px;flex-shrink:0;" ${isLocal ? 'readonly' : ''} />`;html += `<select class="hwfit-sf cookbook-srv-env">${envOpts}</select>`;- html += `<input type="text" class="hwfit-sf cookbook-srv-path" value="${esc(s.envPath || '')}" placeholder="${s.platform === 'windows' ? 'venv path' : '~/venv'}" />`;+ html += `<input type="text" class="hwfit-sf cookbook-srv-path" value="${esc(s.envPath || '')}" placeholder="${s.platform === 'windows' ? 'venv/conda env' : '~/venv or conda-env'}" />`;html += `<span class="cookbook-dep-tag cookbook-dep-target" style="font-size:8px;flex-shrink:0;min-width:46px;text-align:center;visibility:hidden;">placeholder</span>`;html += `<span class="cookbook-srv-actions" style="display:inline-flex;gap:4px;align-items:center;width:78px;flex-shrink:0;justify-content:flex-end;"></span>`;html += `</div>`;diff --git a/static/js/cookbookServe.js b/static/js/cookbookServe.jsindex dcb7cc854..5a5d6dfc1 100644--- a/static/js/cookbookServe.js+++ b/static/js/cookbookServe.js@@ -1284,7 +1284,7 @@ function _rerenderCachedModels() {const _llamaMode = _savedUnified && _llamaModeRaw !== 'cpu' ? 'unified' : _llamaModeRaw;panelHtml += `<label class="hwfit-backend-llamacpp">${_l('Inference','CPU = -ngl 0. GPU = -ngl 99. Unified = GPU offload plus GGML_CUDA_ENABLE_UNIFIED_MEMORY=1 for unified-memory CUDA systems.')}<div class="mode-toggle mode-toggle-three${_llamaMode === 'gpu' ? ' mode-mid' : (_llamaMode === 'unified' ? ' mode-third' : '')}" data-llama-mode-toggle style="display:flex;width:100%;height:32px;position:relative;top:2px;"><button type="button" class="mode-toggle-btn${_llamaMode === 'cpu' ? ' active' : ''}" data-llama-mode="cpu" aria-pressed="${_llamaMode === 'cpu'}" style="flex:1;"><span style="position:relative;top:-7px;">CPU</span></button><button type="button" class="mode-toggle-btn${_llamaMode === 'gpu' ? ' active' : ''}" data-llama-mode="gpu" aria-pressed="${_llamaMode === 'gpu'}" style="flex:1;"><span style="position:relative;top:-7px;">GPU</span></button><button type="button" class="mode-toggle-btn${_llamaMode === 'unified' ? ' active' : ''}" data-llama-mode="unified" aria-pressed="${_llamaMode === 'unified'}" style="flex:1;"><span style="position:relative;top:-7px;">Unified</span></button></div><input type="hidden" class="hwfit-sf" data-field="llama_mode" value="${esc(_llamaMode)}" /><input type="hidden" class="hwfit-sf" data-field="unified_mem" value="${_llamaMode === 'unified' ? '1' : ''}" /></label>`;}- panelHtml += `<label>${_l('venv','Path to Python venv or conda env activate script')}<input type="text" class="hwfit-sf hwfit-sf-wide" data-field="venv" value="${esc(sv('venv', _es.envPath || _srvVenv || ''))}" placeholder="~/venv" /></label>`;+ panelHtml += `<label>${_l('venv / conda','Path to a Python venv, or a Conda env name/path when the selected server uses Conda.')}<input type="text" class="hwfit-sf hwfit-sf-wide" data-field="venv" value="${esc(sv('venv', _es.envPath || _srvVenv || ''))}" placeholder="~/venv or conda-env" /></label>`;const defaultPort = defaultBackend === 'ollama' ? '11434' : _nextAvailablePort();panelHtml += `<label>${_l('Port','HTTP port for the API server')}<input type="text" class="hwfit-sf" data-field="port" value="${esc(sv('port', defaultPort))}" /></label>`;const _activeGpus = (defaultGpus || '').split(',').map(s => s.trim()).filter(Boolean);@@ -3297,7 +3297,7 @@ function _rerenderCachedModels() {// The venv field wins; otherwise fall back to the env configured for the// selected server in Settings, so the activation isn't silently dropped// when the field is left blank (the per-server venv wasn't being applied).- if (venvVal) { _envState.env = 'venv'; _envState.envPath = venvVal; }+ if (venvVal) { _envState.env = (_srvEnv === 'conda' ? 'conda' : 'venv'); _envState.envPath = venvVal; }else if (_srvEnvPath) { _envState.env = (_srvEnv === 'conda' ? 'conda' : 'venv'); _envState.envPath = _srvEnvPath; }if (gpusVal) _envState.gpus = gpusVal;// Preflight: launching a GPU engine (llama.cpp / vLLM / SGLang)diff --git a/static/style.css b/static/style.cssindex 98d048c96..7b6bdab0a 100644--- a/static/style.css+++ b/static/style.css@@ -20145,7 +20145,7 @@ body.gallery-selecting .gallery-dl-btn,}.hwfit-serve-row-core label:has(.hwfit-sf[data-field="max_seqs"]) {position: relative;- left: -64px;+ left: -68px;}.hwfit-serve-row-core label:has(.hwfit-sf[data-field="gpu_mem"]) {position: relative;@@ -22314,6 +22314,8 @@ body.gallery-selecting .gallery-dl-btn,font: inherit;cursor: pointer;text-align: left;+ position: relative;+ top: -2px;}.hwfit-engine-btn-icon,.hwfit-engine-item-icon {