Skip to main content

Gravitron SDK

Run Google Antigravity SDK agents on your personal Antigravity quota.

The official google-antigravity SDK only talks to the Gemini API (GEMINI_API_KEY) or Vertex AI. If you already use the Antigravity IDE or CLI, you have model quota sitting on your machine that the SDK can't reach. Gravitron SDK adds a connection strategy that routes your agent through the local agentapi binary that ships with Antigravity, so the same agent code runs on that quota. You don't need an API key or a GCP project.

pip install gravitron-sdk

Migrating: change one import

# Before: needs GEMINI_API_KEY or Vertex AI billing
# from google.antigravity import Agent, LocalAgentConfig

# After: runs on your Antigravity IDE quota
from gravitron_sdk import Agent, LocalAgentConfig, policy

config = LocalAgentConfig(
    model="gemini-2.5-pro",          # mapped to the agentapi "pro" tier
    workspaces=["."],
    system_instructions="You are a careful code reviewer.",
    policies=[policy.allow_all()],
)

async with Agent(config) as agent:
    response = await agent.chat("Summarize the open TODOs in this repo.")
    print(await response.text())

Everything else stays the same: tools, hooks, policies, triggers and Conversation. gravitron_sdk re-exports the full google.antigravity public API, so import gravitron_sdk as antigravity also works.

Other ways to switch

# Keep your existing upstream config and swap only Agent:
import google.antigravity as upstream
from gravitron_sdk import Agent

agent = Agent(upstream.LocalAgentConfig(model="gemini-2.5-flash", workspaces=["."]))

# Explicit names:
from gravitron_sdk import GravitronAgent, GravitronAgentConfig
agent = GravitronAgent(GravitronAgentConfig(model="pro", title="Nightly audit"))

# Keyword shorthand:
agent = GravitronAgent(model="flash")

Model mapping

agentapi exposes three tiers. Model names are mapped as follows:

You pass Tier
"flash_lite", "flash-lite", anything containing lite flash_lite
"pro", or a name containing pro / argon / opus / sonnet / ultra pro
"flash", any other name, or nothing flash

types.ModelTarget objects and models=[...] lists are also accepted.

Cloud-only LocalAgentConfig arguments (api_key, vertex, project, location, env) are accepted so that existing code doesn't break, but they have no effect.

Reactive background agents

import asyncio
from gravitron_sdk import Agent, LocalAgentConfig, every, on_file_change, on_ipc_message

async def nightly(ctx):
    await ctx.send("Scan the workspace for circular imports and report findings.")

async def on_ui_command(cmd, ctx):
    if cmd.get("action") == "reindex":
        await ctx.send("Rebuild the architecture summary.")

config = LocalAgentConfig(
    model="flash",
    triggers=[
        every("15m", nightly),
        on_file_change("src/**/*.py", lambda change, ctx: ctx.send(f"{change.path} changed; re-check types.")),
        on_ipc_message(on_ui_command, socket_path="/tmp/my-agent.sock"),
    ],
)

async def main():
    async with Agent(config):
        await asyncio.Event().wait()

asyncio.run(main())

on_ipc_message listens on a Unix domain socket for newline-delimited JSON commands. It needs Linux, macOS or WSL.

Configuration

Option Default Description
model flash Tier or model name (see mapping above).
title None Conversation title shown in Antigravity.
profile None agentapi execution profile.
timeout_seconds 120 Per-turn subprocess timeout (5–600).
binary_path auto Path to agentapi.
app_data_dir auto Antigravity data dir that contains brain/ transcripts.
enable_telemetry True Record local token estimates and turn history.
Environment variable Purpose
AGENTAPI_BINARY_PATH Explicit agentapi location. Otherwise $PATH, ~/.gemini/antigravity/bin, ~/.gemini/antigravity-ide/bin are searched.
ANTIGRAVITY_APP_DATA_DIR Explicit app data dir. Otherwise ~/.gemini/antigravity or ~/.gemini/antigravity-ide, whichever has a brain/ folder.
GRAVITRON_DATA_DIR Where telemetry (telemetry.db) and history are written. Default ~/.gemini/gravitron/data.
DISABLE_AGENTAPI=1 Block real agentapi calls (useful in tests).

Requirements

  • Python 3.10+
  • An installed, signed-in Antigravity IDE that provides the agentapi binary

Development

uv venv && uv pip install -e ".[dev]"
uv run pytest
uv build

License

MIT

Metadata

Release files for gravitron-sdk 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gravitron-sdk 0.1.0
File Size Uploaded Provenance Actions
gravitron_sdk-0.1.0.tar.gz 30.8 kB Without provenance Details for gravitron_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for gravitron-sdk 0.1.0
File Interpreter ABI Platform Actions
gravitron_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for gravitron_sdk-0.1.0-py3-none-any.whl

Total release size: 65.8 kB

Release files / gravitron_sdk-0.1.0.tar.gz

Download URL gravitron_sdk-0.1.0.tar.gz
Size 30.8 kB
Tags Source
SHA-256 checksum
How to use checksums
490ff490fb99cbb0c18b7ed4b158f97f2a4ae2a73bc37911ac502524cbdb6e82
BLAKE2b-256 checksum
How to use checksums
b3a1e34a7d6f212807244c03413cb52817f92586bb7ccc6913ef227fbe858425
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / gravitron_sdk-0.1.0-py3-none-any.whl

Download URL gravitron_sdk-0.1.0-py3-none-any.whl
Size 35.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
759c133c9e3944f7d3f0e260243772f41e430a3aeb69630d670b3a2c02a85639
BLAKE2b-256 checksum
How to use checksums
ce56c798cea93e9f82363e412c4a0a13b8070a66d06bb6ef85a2187a925e2ecc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for gravitron-sdk 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page