feat: GPU capability display in UI + GTX 1060 6GB SDXL fix
Model selection: - Add sdxl_offload tier (eff_vram ≥ 4.0 GB) for GTX 1060 6GB and Quadro 6GB cards that were falling through to SD 2.1 despite SDXL fitting with model_cpu_offload. Cards with 5.3 GB effective VRAM now get SDXL quality. - Update _tier_label(), _caps(), _build_warnings() for new tier. Frontend GPU display: - api.js: add getGpuStatus() fetching /api/gpu/status - capabilities.js: add getGpuStatus() export with own LRU cache; refreshCapabilities() now also resets GPU status cache - provider-badge.js: when AI_PROVIDER=local_gpu show green badge with GPU name, tier, VRAM, CC, feature flags, and capabilities in tooltip. Strip "NVIDIA GeForce" prefix so "GTX 1060 6GB" fits in badge. - ai_provider_settings.js: add local_gpu to all provider dropdowns; show GPU info panel (device, VRAM, CC, features, tier, model table per operation) in the settings dialog when a GPU is detected. https://claude.ai/code/session_01WVDg7amsy1TTtxvpku7bcM
This commit is contained in:
@@ -19,6 +19,8 @@ const DEFAULT_CAPS = {
|
||||
|
||||
let _caps = null;
|
||||
let _fetchPromise = null;
|
||||
let _gpuStatus = null;
|
||||
let _gpuFetchPromise = null;
|
||||
|
||||
/**
|
||||
* Return capabilities (fetched lazily, cached thereafter).
|
||||
@@ -48,12 +50,29 @@ export function hasRemote() {
|
||||
return !!(_caps?.remote?.healthy);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch and cache detailed GPU status (hardware, feature flags, model selection per op).
|
||||
* Calls /api/gpu/status — only meaningful when AI_PROVIDER=local_gpu.
|
||||
* Returns null on error.
|
||||
*/
|
||||
export async function getGpuStatus() {
|
||||
if (_gpuStatus !== null) return _gpuStatus;
|
||||
if (!_gpuFetchPromise) {
|
||||
_gpuFetchPromise = apiService.getGpuStatus()
|
||||
.then(data => { _gpuStatus = data; return _gpuStatus; })
|
||||
.catch(() => { _gpuStatus = null; return null; });
|
||||
}
|
||||
return _gpuFetchPromise;
|
||||
}
|
||||
|
||||
/**
|
||||
* Invalidate cache and re-fetch (call after saving provider settings).
|
||||
*/
|
||||
export async function refreshCapabilities() {
|
||||
_caps = null;
|
||||
_fetchPromise = null;
|
||||
_gpuStatus = null;
|
||||
_gpuFetchPromise = null;
|
||||
return getCapabilities();
|
||||
}
|
||||
|
||||
@@ -62,4 +81,4 @@ export async function refreshCapabilities() {
|
||||
*/
|
||||
getCapabilities();
|
||||
|
||||
export default { getCapabilities, getCachedCapabilities, hasRemote, refreshCapabilities };
|
||||
export default { getCapabilities, getCachedCapabilities, hasRemote, refreshCapabilities, getGpuStatus };
|
||||
|
||||
Reference in New Issue
Block a user