Google 開發者部落格:Antigravity SDK 支援本地模型,Gemma 4 離線跑 agent
Introducing Support for Local AI Models in the Antigravity SDK
摘要分析
Google 2026-09-23 宣布 Antigravity SDK(Gemini CLI 的後繼 agent 工具鏈)支援本地模型,首波是 Gemma 4 26B A4B 透過 LiteRT 執行,可離線、無 API 費用與速率限制、程式碼不出本機;也支援 Ollama、LM Studio、vLLM 等 OpenAI 相容伺服器,並示範雲端規劃、本地執行的混合模式。步驟:pip install google-antigravity litert-lm → litert-lm import 下載模型 → LiteRTAgentConfig 建 Agent 呼叫 agent.chat()。建議 24GB 以上記憶體。
- python3 -m venv .venv && source .venv/bin/activate
- pip install google-antigravity litert-lm
- litert-lm import --from-huggingface-repo=litert-community/gemma-4-26B-A4B-it-litert-lm ... gemma4-26b
- LiteRTAgentConfig(model_path=...).lightweight() → async with Agent(config) → agent.chat()
- 要寫檔案時傳 workspaces=[...] 與 policies=[policy.allow_all()]
On 2026-09-23 Google announced that the Antigravity SDK, the agent toolchain succeeding Gemini CLI, supports local models, starting with Gemma 4 26B A4B running on Google AI Edge's LiteRT. Developers can run agentic workflows offline with no API cost or rate limits while keeping code on their own machines. The SDK also works with OpenAI-compatible local servers such as Ollama, LM Studio and vLLM via LocalOpenAIAgentConfig, and the post describes a hybrid pattern where a cloud model plans and local models do the bulk of the work. Steps: create a virtual environment, pip install google-antigravity litert-lm, import Gemma 4 with litert-lm import from the Hugging Face repo, then build an Agent with LiteRTAgentConfig(model_path).lightweight() and stream agent.chat() tokens; pass workspaces and policies for file-writing tasks. A machine with more than 24GB of VRAM or unified memory is recommended.
- Create and activate a venv
- pip install google-antigravity litert-lm
- Import Gemma 4 with litert-lm import
- LiteRTAgentConfig(...).lightweight() then agent.chat()
- Pass workspaces and policies for file writes
關鍵字:Antigravity SDKGemma 4本地模型LiteRT離線 agent
來源原文:https://developers.googleblog.com/introducing-support-for-local-ai-models-in-the-antigravity-sdk/
本頁為報導內容的摘要與分析,版權屬原媒體所有;請以原文為準。
