在本机 Mac 或 Apple Silicon 上部署 Gemma 4 12B。本地安装/升级 llama.cpp,下载 GGUF 量化模型,用 llama-server 暴露 OpenAI-compatible API,或用 Ollama 暴露本地模型服务;按用户需求在默认 Q4_K_M、64K/128K 长上下文、QAT Q4_0 @ 256K、左右对比演示之间选择,配置 tmux 后台运行,验证健康检查、问答接口、资源占用和常见故障。当用户说部署 Gemma 4、Gemma 4 12B、本地大模型、长上下文、QAT、量化、llama-server、Ollama、GGUF、Mac 本地模型服务时使用。
npx skills add https://github.com/majiayu000/spellbook --skill gemma4-local-deploy
把 Gemma 4 12B 的 GGUF 版本部署成本机模型服务。默认使用 llama.cpp / llama-server、Apple Metal、Q4_K_M 和 tmux,只监听 loopback;用户明确要求 QAT、256K、对比演示或 Ollama 时才切换路线。
127.0.0.1。ggml-org/gemma-4-12B-it-GGUFQ4_K_Mgemma-4-12b-ithttp://127.0.0.1:80803276865536 或 131072google/gemma-4-12B-it-qat-q4_0-ggufQ4_0、262144 上下文gemma4-12b--reasoning off,避免 OpenAI API 的 message.content 为空QAT 是训练时模拟量化,不等于无损。关键任务仍要用当前会话的真实响应验证。用户明确要更高质量时,优先建议 Q6_K 或 Q8_0;除非用户接受更高内存和更慢加载,不默认使用 bf16。
| Profile | 适用场景 | Model / quant | Context | Port / alias |
|---|---|---|---:|---|
| daily-q4km-32k | 默认日常聊天、编码、低风险本地 API | ggml-org/...:Q4_K_M | 32768 | 8080 / gemma-4-12b-it |
| long-q4km-128k | 明确需要更长上下文,但保留默认 GGUF 路线 | ggml-org/...:Q4_K_M | 65536 或 131072 | 8080 / gemma-4-12b-it |
| qat-q4_0-256k | 明确要求 QAT、Q4_0、256K 或低内存长上下文 | google/...qat-q4_0-gguf:Q4_0 | 262144 | 8080 / gemma-4-12b-it-qat-q4_0 |
| compare-32k-vs-256k | 录屏、演示或 A/B 比较资源与速度 | 左 Q4_K_M,右 QAT Q4_0 | 32768 + 262144 | 8080 + 8081 |
最终回复必须说明选定 profile、端口、上下文和选择依据。不要把 256K 当作日常默认值。
先检查已有安装、进程、端口、缓存、硬件和磁盘,避免重复部署:
command -v llama-server || true
llama-server --version || true
tmux has-session -t gemma4-12b 2>/dev/null && tmux display-message -p -t gemma4-12b '#S #{pane_pid}' || true
lsof -nP -iTCP:8080 -sTCP:LISTEN || true
ls -lh "$HOME/Library/Caches/llama.cpp/"*gemma-4-12B-it*Q4_K_M*.gguf 2>/dev/null || true
find "$HOME/Library/Caches/llama.cpp" "$HOME/Models" \( -name '*gemma-4-12b-it-qat-q4_0*.gguf' -o -name '*gemma-4-12B-it-qat-q4_0*.gguf' \) 2>/dev/null || true
system_profiler SPHardwareDataType | sed -n '1,30p'
df -h "$HOME"
这些 || true 只用于允许“尚未安装/尚未运行”这一预期发现结果;必须展示实际输出,不能把查询失败描述成部署成功。
daily-q4km-32k、long-q4km-128k、qat-q4_0-256k 或 compare-32k-vs-256k:先读并执行 llama.cpp 部署路线。部署后必须读取并执行 验证、资源与排障。成功至少需要当前会话证明:
/health 返回健康状态/v1/models 或 Ollama 模型列表包含选定模型n_ctx默认用中文回答,并包含:
没有验证数据时写“未验证”,不能用计划值代替运行值。
部署计划涉及超出默认 profile 的模型、上下文或资源判断时,使用
agents/openai.yaml 做独立复核;复核不能替代当前会话的本机验证。
Assess Kubernetes workloads and cluster configuration for AKS Automatic compatibility. Identifies incompatibilities, generates fixes, and guides migration from AKS Standard to AKS Automatic. WHEN: migrate to AKS Automatic, check AKS Automatic readiness, validate manifests for Automatic, assess cluster for Automatic compatibility, fix deployment for Automatic compatibility, identify AKS Automatic migration blockers, is my cluster ready for AKS Automatic.
Discovers available Azure OpenAI model capacity across regions and projects. Analyzes quota limits, compares availability, and recommends optimal deployment locations based on capacity requirements. USE FOR: find capacity, check quota, where can I deploy, capacity discovery, best region for capacity, multi-project capacity search, quota analysis, model availability, region comparison, check TPM availability. DO NOT USE FOR: actual deployment (hand off to preset or customize after discovery), quota increase requests (direct user to Azure Portal), listing existing deployments.
Interactive guided deployment flow for Azure OpenAI models with full customization control. Step-by-step selection of model version, SKU (GlobalStandard/Standard/ProvisionedManaged), capacity, RAI policy (content filter), and advanced options (dynamic quota, priority processing, spillover). USE FOR: custom deployment, customize model deployment, choose version, select SKU, set capacity, configure content filter, RAI policy, deployment options, detailed deployment, advanced deployment, PTU deployment, provisioned throughput. DO NOT USE FOR: quick deployment to optimal region (use preset).
Unified Azure OpenAI model deployment skill with intelligent intent-based routing. Handles quick preset deployments, fully customized deployments (version/SKU/capacity/RAI policy), and capacity discovery across regions and projects. USE FOR: deploy model, deploy gpt, create deployment, model deployment, deploy openai model, set up model, provision model, find capacity, check model availability, where can I deploy, best region for model, capacity analysis. DO NOT USE FOR: listing existing deployments (use foundry_models_deployments_list MCP tool), deleting deployments, agent creation (use agent/create), project creation (use project/create).
Intelligently deploys Azure OpenAI models to optimal regions by analyzing capacity across all available regions. Automatically checks current region first and shows alternatives if needed. USE FOR: quick deployment, optimal region, best region, automatic region selection, fast setup, multi-region capacity check, high availability deployment, deploy to best location. DO NOT USE FOR: custom SKU selection (use customize), specific version selection (use customize), custom capacity configuration (use customize), PTU deployments (use customize).
This skill should be used when working with LaminDB, an open-source data framework for biology that makes data queryable, traceable, reproducible, and FAIR. Use when managing biological datasets (scRNA-seq, spatial, flow cytometry, etc.), tracking computational workflows, curating and validating data with biological ontologies, building data lakehouses, or ensuring data lineage and reproducibility in biological research. Covers data management, annotation, ontologies (genes, cell types, diseases, tissues), schema validation, integrations with workflow managers (Nextflow, Snakemake) and MLOps platforms (W&B, MLflow), and deployment strategies.
Latch platform for bioinformatics workflows. Build pipelines with Latch SDK, @workflow/@task decorators, deploy serverless workflows, LatchFile/LatchDir, Nextflow/Snakemake integration.
Run Python code in the cloud with serverless containers, GPUs, and autoscaling. Use when deploying ML models, running batch processing jobs, scheduling compute-intensive tasks, or serving APIs that require GPU acceleration or dynamic scaling.
Take majiayu000/gemma4-local-deploy from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.