← 返回 Skills 市场
stevojarvisai-star

Local Model Optimizer

作者 stevojarvisai-star · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
90
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install local-model-optimizer
功能描述
Auto-detect hardware (GPU VRAM, system RAM, CPU), recommend optimal local models from Ollama registry, configure Ollama with tuned parameters, and set up hyb...
使用说明 (SKILL.md)

Local Model Optimizer

Auto-detect hardware → recommend models → configure Ollama → set up hybrid cloud/local routing.

Quick Start

# Full auto-setup: detect hardware, install Ollama, recommend + pull model, configure routing
python3 scripts/local-model-optimizer.py auto

# Hardware detection only
python3 scripts/local-model-optimizer.py detect

# Recommend models for your hardware (no install)
python3 scripts/local-model-optimizer.py recommend

# Set up hybrid routing (cloud for complex tasks, local for simple ones)
python3 scripts/local-model-optimizer.py routing

# Cost comparison: local vs cloud
python3 scripts/local-model-optimizer.py cost

Commands

auto — Full Automated Setup

  1. Detects GPU (NVIDIA/AMD/Apple Silicon), VRAM, RAM, CPU cores
  2. Queries Ollama model registry for compatible models
  3. Recommends top 3 models ranked by benchmark/size ratio
  4. Installs Ollama if not present
  5. Pulls recommended model
  6. Configures OpenClaw provider entry
  7. Sets up hybrid routing rules
  8. Runs verification test

detect — Hardware Detection

Reports:

  • GPU model, VRAM, driver version (NVIDIA/AMD/Apple)
  • System RAM (total/available)
  • CPU model, core count, architecture
  • Estimated model size capacity
  • Compatibility tier: Tiny (≤4GB) / Small (4-8GB) / Medium (8-16GB) / Large (16-32GB) / XL (32GB+)

recommend — Model Recommendations

Based on hardware tier, recommends from:

Tier VRAM Models
Tiny ≤4GB Gemma 4 E2B, Phi-3.5 Mini, Qwen2.5-3B
Small 4-8GB Gemma 4 E4B, Llama 3.1 8B, Mistral 7B
Medium 8-16GB Gemma 4 12B, Llama 3.1 8B Q8, CodeGemma
Large 16-32GB Gemma 4 27B, Llama 3.1 70B Q4, Mixtral 8x7B
XL 32GB+ Gemma 4 27B Q8, Llama 3.1 70B Q8, DeepSeek V2

See references/model-matrix.md for full benchmark comparisons.

routing — Hybrid Cloud/Local Routing

Configures OpenClaw to route requests intelligently:

  • Local: Simple Q&A, summarization, code completion, memory operations
  • Cloud: Complex reasoning, multi-step planning, code generation, creative writing

Options:

  • --strategy cost — minimize API spend (prefer local)
  • --strategy quality — maximize output quality (prefer cloud)
  • --strategy balanced — default, smart routing based on task complexity
  • --cloud-provider \x3Cname> — which cloud provider for fallback (default: anthropic)

cost — Cost Analysis

Calculates monthly savings based on:

  • Current API usage pattern (reads from OpenClaw logs if available)
  • Estimated electricity cost for local inference
  • Token throughput comparison
  • Break-even analysis for hardware investment

Configuration

The optimizer writes to ~/.openclaw/local-model-config.json:

{
  "hardware": { "gpu": "...", "vram_gb": 16, "ram_gb": 32, "tier": "Large" },
  "model": { "name": "gemma4:27b", "quantization": "Q4_K_M", "size_gb": 15.2 },
  "routing": { "strategy": "balanced", "local_tasks": [...], "cloud_tasks": [...] },
  "performance": { "tokens_per_sec": 42, "first_token_ms": 180 }
}
安全使用建议
What to check before installing/using this skill: - Backup ~/.openclaw/openclaw.json (and any OpenClaw logs) before running — the script will write global config files. - Inspect the included script (scripts/local-model-optimizer.py) yourself; it will call nvidia-smi/rocm-smi/sysctl, run 'ollama pull', and may modify OpenClaw settings. - Do not run the automatic 'auto' flow on a production machine without review. Start with 'detect' and 'recommend' to see what the tool finds and suggests. - The script may install Ollama via 'curl https://ollama.com/install.sh | sh' on Linux — review that installer script on ollama.com before allowing execution, or install Ollama manually. - Be aware model pulls will download potentially large files and use network/disk; check model licenses and disk space. - If you store cloud provider credentials or other secrets in OpenClaw config or logs, verify the skill will not overwrite or transmit them (script does not declare external exfil endpoints, but it reads/writes the OpenClaw config). Consider running in a sandbox or VM first. - If uncertain, ask the skill author for an explicit list of file edits and a dry-run mode that only reports changes without applying them.
功能分析
Type: OpenClaw Skill Name: local-model-optimizer Version: 1.0.0 The skill bundle automates the setup of local LLMs using Ollama, but it performs several high-risk actions in `scripts/local-model-optimizer.py`. Specifically, it uses a 'curl|sh' pattern to download and execute the Ollama installer from a remote URL (https://ollama.com/install.sh) and directly modifies the OpenClaw configuration file (`~/.openclaw/openclaw.json`) to inject new model providers. While these actions are consistent with the skill's stated purpose, the use of remote script execution and automated configuration tampering are high-risk behaviors that lack sufficient safeguards, warranting a suspicious classification.
能力评估
Purpose & Capability
Name/description match the code and SKILL.md: the script detects GPU/RAM/CPU, recommends Ollama-compatible models, can pull models and configure OpenClaw routing. The requested capabilities are consistent with the stated purpose.
Instruction Scope
Runtime instructions ask the agent to run the included Python script which executes system utilities (nvidia-smi/rocm-smi/sysctl), may read OpenClaw logs/config, install Ollama, pull models, and write ~/.openclaw/local-model-config.json and update ~/.openclaw/openclaw.json. Reading OpenClaw logs for cost analysis and writing the OpenClaw config are within the claimed scope, but these are sensitive operations (global config/log access) that should be expected and reviewed by the user before running.
Install Mechanism
The skill itself has no install spec, but the script will install Ollama on Linux by executing a remote shell script via 'curl -fsSL https://ollama.com/install.sh | sh' (and uses brew on macOS). Executing a remote installer via a pipe to sh is higher-risk even when the URL is an official domain; users should inspect the installer before execution.
Credentials
The skill declares no required env vars or credentials, but it reads and writes user-local OpenClaw files (~/.openclaw/openclaw.json and logs) and may examine system state and driver details. Those accesses can expose sensitive configuration or credentials stored in the agent config. No explicit credential handling is declared, so this implicit access is disproportionate unless the user expects the tool to modify their OpenClaw global config.
Persistence & Privilege
The skill modifies/writes a global OpenClaw config file (~/.openclaw/openclaw.json and local-model-config.json). This is expected for configuring routing/providers, but it does change global agent settings rather than only creating a per-skill artifact. It does not set always:true and does not autonomously enable itself beyond normal skill invocation rules.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install local-model-optimizer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /local-model-optimizer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release — Auto-detect hardware and configure optimal local models
元数据
Slug local-model-optimizer
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Local Model Optimizer 是什么?

Auto-detect hardware (GPU VRAM, system RAM, CPU), recommend optimal local models from Ollama registry, configure Ollama with tuned parameters, and set up hyb... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 90 次。

如何安装 Local Model Optimizer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install local-model-optimizer」即可一键安装,无需额外配置。

Local Model Optimizer 是免费的吗?

是的,Local Model Optimizer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Local Model Optimizer 支持哪些平台?

Local Model Optimizer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Local Model Optimizer?

由 stevojarvisai-star(@stevojarvisai-star)开发并维护,当前版本 v1.0.0。

💬 留言讨论