AI Host Optimizer

io.github.williamdoring-prog由 GitHub 账号 williamdoring-prog 发布v1.2.0更新于 Nov 17, 2026

Profile a host and get an evidence-graded checklist of AI-model optimizations.

发布方自己的服务:Host.al: .al domains and servers in Albania

概览

AI 生成的概览

分析本机配置,给出带证据分级的本地 AI 模型推理优化清单、方案与基准测试。

可以做什么
  • 分析主机:操作系统、CPU、内存、GPU 与已检测到的工具,只读
  • 列出优化选项及其预估收益、置信等级与资源占用
  • 为所选选项生成无冲突方案并给出综合预估
  • 对本地推理的每秒解码 token 数做基准测试,并给出噪声下限
  • 校验注册表一致性(开发辅助)
适用场景
适合在本地运行模型(Ollama、llama.cpp、vLLM、Hugging Face)时,判断哪些调优项在你这台机器上真正有效,或希望得到实测的前后对比而非通用建议。
运行要求
通过 npx 以 stdio 在本地运行(需要 Node.js)。未声明账号、API 密钥或环境变量。基准测试会调用本地运行时的 HTTP API,因此测量时需要有一个正在运行的本地推理服务。
安装前请注意
应用更改会向受管配置目录写入环境变量文件和激活脚本;默认先试运行,可用 revert 回滚。在 Linux 上某个选项还会写入 systemd drop-in,并打印需你自行执行的 root 安装命令。低于 A 级的估计并非实测,微小差异可能落在本机噪声下限之内。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AI Host Optimizer,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

ai-host-optimizer

[npm] [CI] [license: MIT] [MCP Registry]

Profile a host, plan AI-model optimizations, and apply them — reversibly, with consent.

Every "speed up your local LLM" guide lists the same tweaks (Flash Attention, KV-cache quantization, keep-alive, NUMA). The lists are mostly right — they just never tell you which of them helps on your machine, or by how much.

This tool profiles the host, presents the checklist with an honest confidence tier on every number, resolves a conflict-free plan, and — the part that matters — measures the options you apply, with a noise floor, so a null result is reported as a null result instead of a fake win.

It is an MCP server and a CLI. Applying is dry-run by default, writes only into a managed config directory, and is reversible.

Status: 1.2. Profiling and planning are read-only. The applier writes only inside ~/.config/ai-host-optimizer (platform-appropriate), never touches system files, never runs a shell, and never escalates privilege.

Quickstart

bash
npx -y ai-host-optimizer --cli

That prints a read-only profile and the checklist for your machine (trimmed):

Host profile (read-only)  role     : workstation  platform : windows — x64  cpu      : Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 cores)  memory   : 16 GiB total, 8 GiB free  gpu      : nvidia NVIDIA GeForce RTX 3080 (10240 MiB VRAM)  cluster  : 1 GPU(s)  tooling  : ollama, python3, docker
Optimization checklist (read-only)
[ ] Enable Flash Attention  (flash-attention)      improves decode tokens/s: qualitative (tier C)      risk low; fully-reversible; privilege false      stackable: throughput-stack      synergy: kv-cache-quant-q8
[ ] Quantize KV cache to q8_0  (kv-cache-quant-q8)      improves KV cache memory: 50% (tier B)      risk low; fully-reversible; privilege false      ...

Then measure whether a change actually helped:

bash
ai-host-optimizer --benchmark --save-baseline --samples 5   # beforeai-host-optimizer --apply --select flash-attention --yes    # then restart the runtimeai-host-optimizer --calibrate --select flash-attention       # after → tier A, or "no change"

Why

Running local models well depends on host configuration (KV-cache size, Flash Attention, prefix caching, memory/NUMA/swap behaviour, provider prompt caching). The knowledge is scattered across guides. This tool profiles your host and tells you what is worth doing — honestly, labelling each estimate by confidence.

Install

bash
# zero-install (downloads and runs)npx -y ai-host-optimizer --cli
# or globallynpm install -g ai-host-optimizerai-host-optimizer --cli        # or the short alias:  aiho --cli

Usage

bash
# report (read-only)ai-host-optimizer --cliai-host-optimizer --cli --role container
# plan and applyai-host-optimizer --plan  --select kv-cache-quant-q8,keep-alive-preloadai-host-optimizer --apply --select kv-cache-quant-q8,keep-alive-preload          # dry-runai-host-optimizer --apply --select kv-cache-quant-q8,keep-alive-preload --yes    # applyai-host-optimizer --revert
# measure (tier A)ai-host-optimizer --benchmark --save-baseline   # beforeai-host-optimizer --benchmark                   # after (compares to baseline)
# calibrate: measure an option's real effect on THIS host and promote it to tier Aai-host-optimizer --benchmark --save-baseline --samples 5ai-host-optimizer --apply --select flash-attention --yes     # then restart the runtimeai-host-optimizer --calibrate --select flash-attention --samples 5ai-host-optimizer --plan --select flash-attention            # now shows [measured]
# generate declarative accessories from the same registryai-host-optimizer --generate ansibleai-host-optimizer --generate dockerfileai-host-optimizer --generate checklist
# interfacesai-host-optimizer --mcpai-host-optimizer --browser     # browser UI (not yet)ai-host-optimizer --desktop     # desktop UI (not yet)

Applying writes only into the managed directory and prints the source line to activate it. Undo any time with --revert.

What is automated: options with an applyOp. The applier writes one <runtime>.env file per target — ollama.env, llama.cpp.env, huggingface.env, vllm.env — plus a single activate.sh / activate.ps1. On Linux, the ollama-systemd-dropin option additionally writes a systemd drop-in (so the Ollama service actually reads that environment) and prints the root install commands rather than running them. Everything else is advisory: --apply says so plainly rather than doing nothing silently.

Use as an MCP server

Add to your MCP client (e.g. Claude Desktop):

json
{  "mcpServers": {    "ai-host-optimizer": {      "command": "npx",      "args": ["-y", "ai-host-optimizer", "--mcp"]    }  }}

Tools exposed:

ToolPurpose
profileRead-only host profile (OS, CPU, memory, GPU, detected tooling)
checklistOptimization options with estimated improvement + resource footprint
planConflict-free plan for selected ids, with a combined estimate (uses tier-A calibrations when present)
benchmarkMeasure local inference rate (decode tokens/s) + the noise floor — tier-A evidence
validate-registryRegistry consistency check (development aid)

Published to the official MCP Registry as io.github.williamdoring-prog/ai-host-optimizer (see server.json).

Honesty contract

Every estimate carries a confidence tier:

  • A — measured on your host (via --benchmark / --calibrate).
  • B — labelled estimate with a cited method.
  • C — qualitative (direction only, no number).

Tier B/C estimates are never presented as measurements. A combined estimate is only shown once its inputs are trustworthy (see the project plan).

Calibration is honest about noise. --benchmark takes several samples and reports their spread; --calibrate compares before/after and only promotes an option to tier A when the change exceeds the host's own noise floor (the combined run-to-run range). A null result is reported as a null result and records nothing — a small difference inside the noise is not claimed as a win. Use --samples <n> to lower the noise floor when you need to detect a small effect.

What the benchmark measures

--benchmark measures decode tokens/second (and the prefill rate) by calling the local runtime's HTTP API (/api/generate with stream: false), which returns exact token counts and durations rather than a wall-clock guess. It takes several samples, discards a warm-up model load, and reports the median plus the run-to-run spread.

That spread is the whole point. Inference timing on a desktop is noisy — on a test host the spread was ±7% run-to-run, so a single before/after comparison can show a "15% improvement" that is pure noise. So --calibrate refuses to claim a change smaller than the combined spread of the two measurements, and prints a null result as a null result:

  baseline: qwen2.5-coder:14b, 10.29 tok/s, 2638.9 ms, 5549 MiB free  current : qwen2.5-coder:14b, 10.16 tok/s, 2860.5 ms, 5541 MiB free  noise floor: ±13.9%
No significant change: decode tokens/s -1.3% is within the ±13.9% noise floorof this host.Nothing recorded — a null result is not evidence of an improvement.

A tool that will tell you "this didn't help" is more useful than one that always claims a win.

Safety

  • Read-only by default. Profiling and planning never change anything.
  • The applier writes only into the managed config directory (~/.config/ai-host-optimizer, or the platform equivalent) — never system files — runs no shell, and escalates no privilege.
  • Applying is dry-run first: --apply shows the change; --yes performs it.
  • Everything applied is reversible with --revert (and --revert is idempotent).
  • Options are tagged with risk, reversibility and privilege needs.
  • Mutually exclusive options (e.g. KV-cache q8_0 vs q4_0; zram vs disk swap) are one-of groups; stackable options are marked stackable.
  • Role-aware: a container cannot tune the host kernel; a cluster-node is advisory-only.

Roadmap

  • M0 — read-only profiler, registry, checklist, CLI + MCP. ✅
  • M1 — reversible applier (user-space), plan/apply/revert, on-host benchmark. ✅
  • M1b — measured tier-A calibration (median-of-samples benchmark, noise floor, per-option promotion). ✅
  • M1c — multi-runtime applier: one <runtime>.env per target (Ollama, llama.cpp, Hugging Face), 8 applyable options, idempotent revert. ✅
  • M1d — more apply ops: a systemd-dropin op (Ollama service env on Linux, install commands printed not run) and the vllm runtime. 32 options, 11 applyable. ✅
  • M2 — accessory generation (Ansible/Dockerfile/checklist). ✅ (generation)
  • M2b — distribution: official MCP Registry entry live (io.github.williamdoring-prog/[email protected]) + CI publish workflow; directory listings next. 🚧
  • M4 — browser UI and Tauri desktop UI. (planned)

Documentation

Contributing

Contributions are welcome — especially new optimization options and corrections to unsupported claims. See CONTRIBUTING.md for the dev setup and the registry contribution rules. Participation is governed by CODE_OF_CONDUCT.md.

Licence

MIT. See LICENSE.

来源:README.md,提交 b8ae19f

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

1
  1. v1.2.0最新Nov 17, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Host 集成