1. 模型选择改为两步式:先搜索选择基模型,再选择量化版本 - 自动选中默认量化版本(Q4_K_M),后台可配置 - 模型新增 base_model 字段,按基模型分组 - 后台模型管理增加基模型字段 2. 参数搜索改为全局搜索 - 搜索时跨所有分类显示匹配参数 - 隐藏分类标签页,显示匹配数量 3. 自然语言支持 LLM 接口 - 后台可配置 LLM API (URL/Key/Model/System Prompt) - 启用后优先调用 LLM 解析,失败自动回退正则解析 - 兼容 OpenAI API 格式
135 lines
5.9 KiB
HTML
135 lines
5.9 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>llama.cpp 命令生成器</title>
|
|
<link rel="stylesheet" href="/css/style.css">
|
|
</head>
|
|
<body>
|
|
<div id="app">
|
|
<header>
|
|
<h1>🦙 llama.cpp 命令生成器</h1>
|
|
</header>
|
|
|
|
<!-- Version & Mode Selection -->
|
|
<section class="top-controls">
|
|
<div class="control-group">
|
|
<label>llama.cpp 版本</label>
|
|
<select id="version-select" onchange="onVersionChange()"></select>
|
|
</div>
|
|
<div class="control-group">
|
|
<label>运行模式</label>
|
|
<div class="mode-switch">
|
|
<button class="mode-btn active" data-mode="gpu" onclick="switchMode('gpu')">🎮 GPU 模式</button>
|
|
<button class="mode-btn" data-mode="gpu_cpu" onclick="switchMode('gpu_cpu')">🎮+💻 GPU+CPU 模式</button>
|
|
</div>
|
|
</div>
|
|
<div class="control-group">
|
|
<label>二进制程序</label>
|
|
<select id="binary-select">
|
|
<option value="llama-server">llama-server</option>
|
|
<option value="llama-cli">llama-cli</option>
|
|
</select>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- GPU Configuration -->
|
|
<section class="panel" id="gpu-panel">
|
|
<h2>🖥️ GPU 配置</h2>
|
|
<div id="gpu-slots"></div>
|
|
<button class="btn-add" id="btn-add-gpu" onclick="addGpuSlot()">+ 添加显卡</button>
|
|
<div class="vram-display" id="vram-display">
|
|
<div class="vram-bar-container">
|
|
<div class="vram-bar" id="vram-bar"></div>
|
|
<div class="vram-label" id="vram-label">VRAM: 等待配置...</div>
|
|
</div>
|
|
<div class="vram-breakdown" id="vram-breakdown"></div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- System Memory (for GPU+CPU mode) -->
|
|
<section class="panel hidden" id="memory-panel">
|
|
<h2>💾 系统内存配置</h2>
|
|
<div class="control-group">
|
|
<label>系统内存上限</label>
|
|
<input type="number" id="sys-memory" value="0" min="0" step="1" onchange="updateEstimate()">
|
|
<select id="sys-memory-unit" onchange="updateEstimate()">
|
|
<option value="0">无限制</option>
|
|
<option value="1">GB</option>
|
|
<option value="2">MB</option>
|
|
</select>
|
|
</div>
|
|
<div class="vram-display" id="ram-display">
|
|
<div class="vram-bar-container">
|
|
<div class="vram-bar ram-bar" id="ram-bar"></div>
|
|
<div class="vram-label" id="ram-label">内存: 等待配置...</div>
|
|
</div>
|
|
<div class="vram-breakdown" id="ram-breakdown"></div>
|
|
</div>
|
|
</section>
|
|
|
|
<!-- Model Selection (two-step) -->
|
|
<section class="panel">
|
|
<h2>📦 选择模型</h2>
|
|
<!-- Step 1: Select base model -->
|
|
<div class="model-step">
|
|
<label class="model-step-label">第1步:选择模型</label>
|
|
<div class="model-select-container">
|
|
<input type="text" id="model-search" placeholder="搜索模型名称..." oninput="filterBaseModels()" autocomplete="off" onfocus="this.select()">
|
|
<div class="model-dropdown" id="model-dropdown"></div>
|
|
</div>
|
|
</div>
|
|
<!-- Step 2: Select quant -->
|
|
<div class="model-step hidden" id="quant-step">
|
|
<label class="model-step-label">第2步:选择量化版本</label>
|
|
<div id="quant-options"></div>
|
|
</div>
|
|
<!-- Selected model info -->
|
|
<div id="model-selected-info" class="model-selected-info"></div>
|
|
</section>
|
|
|
|
<!-- Natural Language Input -->
|
|
<section class="panel">
|
|
<h2>💬 自然语言生成</h2>
|
|
<div class="nl-input-container">
|
|
<input type="text" id="nl-input" placeholder="例如: 用RTX 4090跑70B模型, 上下文8192, 温度0.7, flash attention" />
|
|
<button onclick="parseNaturalLanguage()">解析</button>
|
|
</div>
|
|
<div id="nl-result" class="nl-result"></div>
|
|
</section>
|
|
|
|
<!-- Parameters -->
|
|
<section class="panel">
|
|
<h2>⚙️ 参数配置</h2>
|
|
<div class="param-search-container">
|
|
<input type="text" id="param-search" placeholder="搜索全部参数..." oninput="onParamSearch()" autocomplete="off">
|
|
<span id="search-hint" class="search-hint"></span>
|
|
</div>
|
|
<div class="param-tabs" id="param-tabs">
|
|
<button class="tab-btn active" data-cat="common" onclick="switchTab('common')">通用参数</button>
|
|
<button class="tab-btn" data-cat="sampling" onclick="switchTab('sampling')">采样参数</button>
|
|
<button class="tab-btn" data-cat="server" onclick="switchTab('server')">服务器参数</button>
|
|
<button class="tab-btn" data-cat="model_source" onclick="switchTab('model_source')">模型来源</button>
|
|
<button class="tab-btn" data-cat="lora" onclick="switchTab('lora')">LoRA</button>
|
|
<button class="tab-btn" data-cat="logging" onclick="switchTab('logging')">日志</button>
|
|
<button class="tab-btn" data-cat="advanced" onclick="switchTab('advanced')">高级</button>
|
|
</div>
|
|
<div id="param-container"></div>
|
|
<button class="btn-toggle-advanced" onclick="toggleHiddenParams()" id="toggle-advanced-btn">▼ 显示更多参数</button>
|
|
</section>
|
|
|
|
<!-- Generated Command -->
|
|
<section class="panel command-panel">
|
|
<h2>📋 生成命令</h2>
|
|
<div class="command-output" id="command-output">请在上方配置参数...</div>
|
|
<div class="command-actions">
|
|
<button onclick="copyCommand()" class="btn-copy">📋 复制命令</button>
|
|
<button onclick="generateCommand()" class="btn-gen">🔄 重新生成</button>
|
|
</div>
|
|
</section>
|
|
</div>
|
|
<script src="/js/main.js"></script>
|
|
</body>
|
|
</html>
|