Local Model Deployment Advisor
Use this skill to turn a device profile and deployment requirements into a practical local LLM deployment recommendation. It supports NVIDIA GPUs, Apple Silicon unified memory, and CPU-only systems.
Inputs to collect
- Run
python scripts/detect_hardware.pyto obtain CPU, RAM, GPU, VRAM, and installed runtime commands. - Ask for missing deployment requirements only when they materially affect the result: use case (
chat,code,multilingual, orreasoning), concurrent requests, average/maximum input tokens, maximum output tokens, target TTFT, target output speed, and preferred runtime. - Use the YAML catalogues in
data/as the source of model architecture, formats, licenses, quantizations, runtimes, hardware constraints, and workload profiles.
Recommendation procedure
- Reserve at least 10–20% of accelerator memory for runtime overhead and operating-system use.
- Estimate weights, KV cache, and overhead with
scripts/estimate_memory.py. For GQA/MQA models, use the catalogue's KV head count and head dimension; never approximate KV cache from hidden size when architecture data exists. - Use
scripts/recommend_models.pywith a workload profile to hard-filter unsupported runtime, platform, format, license, and memory combinations. Present its minimum, balanced, and quality-first plans, including rejection reasons. - Select a runtime: Ollama for the simplest single-user setup; llama.cpp for CPU/Apple Silicon and GGUF; vLLM or SGLang for NVIDIA multi-user serving; Transformers for custom Python integration.
- State the exact model, quantization, expected resource use, limitations, launch command, and verification steps. Do not claim measured performance unless
benchmark_model.pyhas been run. Save its local history and pass--calibration-historyto a later recommendation when matching hardware/workload observations exist. - Create a repeatable deployment directory with
scripts/generate_deployment.py, then usescripts/preflight_deployment.pybefore starting it. The preflight checks the selected GPU's free VRAM, disk capacity, local port, Docker daemon, driver/CUDA visibility, immutable model revision, and (when requested) registry access and Docker GPU passthrough. - For Ollama, run
scripts/calibrate_ollama.pyafter the model is loaded. It records/api/psquantization, VRAM usage, and context length against the generated lock-file prediction. For vLLM, benchmark with--metrics-url .../metrics; only enable--enable-per-request-metricsafter evaluating its CPU overhead.
Commands
python scripts/detect_hardware.py --output hardware.json
python scripts/recommend_models.py --vram-gb 24 --runtime vllm --task chat --workload team-api
python scripts/generate_deployment.py --model qwen2.5-7b-instruct --runtime vllm --workload team-api --output ./deployment
python scripts/preflight_deployment.py --model qwen2.5-7b-instruct --runtime vllm --workload team-api --gpu-device-id 0 --output ./deployment
python scripts/benchmark_model.py --url http://localhost:8000/v1/chat/completions --model Qwen/Qwen2.5-7B-Instruct --catalog-model qwen2.5-7b-instruct --runtime vllm --metrics-url http://localhost:8000/metrics
python scripts/calibrate_ollama.py --model qwen2.5:7b
Guardrails
- Treat estimates as planning values, not a guarantee. Driver, backend, context length, concurrency, and model architecture affect actual memory use.
- Treat TTFT and output-speed targets as benchmark acceptance criteria until the target hardware has been measured; do not present them as predicted performance.
- Prefer a smaller quantized model with headroom over an oversized model that risks out-of-memory failures.
- Require a network-enabled model download only when the user explicitly asks to install or start the deployment.
- Generate Docker deployments with
127.0.0.1binding and explicit GPU device IDs by default. Use0.0.0.0only when remote access is intentional and separately secured. - Keep credentials in local environment variables such as
HF_TOKEN; never place them in a report, lock file, catalogue, or command history. Run--verify-docker-gpuand--check-model-accessonly when the user authorizes their image pull or registry request. - Do not infer cold-start time from a warmed server.
benchmark_model.pymeasures actual startup only when the user explicitly supplies--startup-command; otherwise it labels the first request as a cold-request sample. Keep calibration history local and hardware-scoped.
Scan to join WeChat group