gemma4-local-deploy

Deploy Gemma 4 12B locally on macOS with llama.cpp and an OpenAI-compatible API.

258|26|Updated Dec 9, 2025
One-click install
npx skills add https://github.com/majiayu000/spellbook --skill gemma4-local-deploy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: gemma4-local-deploy
Source: https://github.com/majiayu000/spellbook/tree/main/skills/gemma4-local-deploy
Command: npx skills add https://github.com/majiayu000/spellbook --skill gemma4-local-deploy

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

在本机 Mac 或 Apple Silicon 上实现 Gemma 4 12B 的本地部署与服务暴露,避免云端依赖并提升隐私和响应速度。

Core Features & Use Cases

  • 本地安装/升级 llama.cpp,下载 GGUF 量化模型并通过 llama-server 或 Ollama 暴露 OpenAI 兼容 API。
  • 根据用户需求在默认 Q4_K_M、64K/128K 长上下文、QAT Q4_0 @ 256K 之间灵活切换,提供 tmux 后台运行与健康检查。
  • 支持在本地工作流中进行健康验证、问答接口测试、资源占用监控和故障排查,降低部署门槛并提高可控性。

Quick Start

在你的 Mac 上运行 gemma4-local-deploy,安装或验证 Gemma 4 12B 的本地服务并选择默认配置档。

Frequently Asked Questions about gemma4-local-deploy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I deploy Gemma 4 12B locally on macOS using llama.cpp?

Deploy Gemma 4 12B locally on macOS by provisioning llama.cpp, downloading GGUF quantized models, and exposing an OpenAI-compatible API via llama-server or Ollama. The workflow uses tmux orchestration, explicit model paths, and port configurations for end-to-end setup.

Can I configure different context window sizes for local Gemma 4 deployment?

Yes, local Gemma 4 deployment supports flexible context window sizes through configuration profiles. You can switch between daily-q4km-32k, long-q4km-128k, and qat-q4_0-256k profiles to balance context length and resource usage based on your specific needs.

What is the best way to run a GGUF quantized model as an OpenAI-compatible API?

The best way to expose a GGUF quantized model as an OpenAI-compatible API is using llama-server or Ollama. This approach provisions local inference, provides tmux orchestration for background execution, and includes health checks and response validation.

Do I need tmux to run Gemma 4 12B in the background on macOS?

Using tmux is the recommended method for running Gemma 4 12B in the background on macOS. Tmux orchestration manages the persistent local deployment of the GGUF model, allowing you to detach sessions while the OpenAI-compatible API continues running.

How do I troubleshoot and validate responses from a local llama-server deployment?

Validate responses from a local llama-server deployment by running built-in health checks and question-answer interface tests. The deployment workflow includes resource monitoring and explicit command-line configurations to identify issues and verify the local environment.

Does local deployment of Gemma 4 12B eliminate cloud API dependencies?

Yes, local deployment of Gemma 4 12B eliminates cloud API dependencies by running the GGUF quantized model directly on your machine. This approach enhances privacy and improves response speed by exposing a local OpenAI-compatible API.