This release updates the default model for new agents to `gemini-3.8-flash` for higher quality and reasoning capabilities, alongside improving agent configuration expressiveness, performance for small and local models, and platform connectivity. Developers can now easily configure lightweight agents optimized for local environments via a new fluent method, connect to Vertex AI with API keys in Express mode, and benefit from expanded support for custom tool implementations (functors, dataclasses).
This release updates the default model for new agents to gemini-3.8-flash for higher quality and reasoning capabilities, alongside improving agent configuration expressiveness, performance for small and local models, and platform connectivity. Developers can now easily configure lightweight agents optimized for local environments via a new fluent method, connect to Vertex AI with API keys in Express mode, and benefit from expanded support for custom tool implementations (functors, dataclasses).
🌟 Key Highlights
-
Default Model Update to Gemini 3.8 Flash: The default model for new agents and configurations has been updated to
gemini-3.8-flash, delivering higher reasoning quality and stronger task performance. Developers can override this default by specifyingmodelin their configuration:from antigravity.connections.local import LocalAgentConfig config = LocalAgentConfig(model="gemini-3.7-flash") -
Optimized Lightweight Agent Configuration: New
.lightweight()method on agent configurations (includingLocalAgentConfig) and its subclasses applies preset optimizations for smaller, local-running models. This configures a minimal tool set, minimal system prompting, and disables background subagents to reduce context exhaustion and latency.import os from antigravity.connections.local import LiteRTAgentConfig config = LiteRTAgentConfig( model_path=os.path.expanduser( "~/.litert-lm/models/gemma4-26b/model.litertlm" ) ).lightweight() -
Vertex AI Express Mode (API Key Support): Developers can now connect to Vertex AI using Express mode by providing an API key directly on
LocalAgentConfig(vertex=True, api_key="..."), simplifying authentication without needing full GCP project/location ADC setup.from antigravity.connections.local import LocalAgentConfig # Express Mode using API Key config = LocalAgentConfig(vertex=True, api_key="AIza...") -
Support for Callable Class and Dataclass Tools: The SDK's tool runner,
ToolRunner, now correctly inspects and executes tools defined as callable class instances (functors) and dataclass methods, enhancing flexibility for custom tool implementation.class MyTool: def __call__(self, context: ToolContext, *args): # ... tool logic pass agent.config.add_tool(MyTool()) -
Stop Hook Integration: Agents now support the
StopHooklifecycle hook, which is triggered when an agent's execution is externally requested to stop. This enables developers to implement custom cleanup, messaging, or resource logging actions upon termination.class CleanupHook(hooks.StopHook): def on_stop(self, agent: Agent): print("Agent stopped. Performing cleanup.")
📋 Detailed Changes
Model & Default Changes
- Default Model Update: The default model for new agents and configurations is now
gemini-3.8-flash. This change provides higher output quality and reasoning capabilities. To override this default, simply specify themodelparameter during agent configuration:from antigravity.connections.local import LocalAgentConfig config = LocalAgentConfig(model="gemini-3.7-flash")
Features & Enhancements
- OS Sandbox Opt-in for Commands: Added an
enable_sandboxfield toRunCommandConfigto allow developers to optionally execute terminal commands within an OS-level sandbox environment for enhanced security.from antigravity.types import RunCommandConfig config.capabilities.run_command_config = RunCommandConfig( enable_sandbox=True ) - Tool Invocation Argument Flexibility:
ToolWithSchemaand public callable proxies now accept both positional (*args) and keyword arguments (**kwargs) when called, matching standard Python function calling conventions. - Support for
genai.ContentMedia: Introduced a structconverter to support media blocks fromgenai.Contentobjects within the SDK, enabling richer multimodal interactions. - MCP Compatibility Widening: The SDK now supports both
mcp>=1.0andmcp<3.0dependencies, ensuring compatibility with new and existing MCP environments.
Originally posted by @karmel in https://github.com/google-antigravity/antigravity-sdk-python/discussions/199
?