vahapogut/antigravity-add-model
Sobre
Proxy patch for Google Antigravity that intercepts internal Cloud Code API and adds support for OpenAI, Claude, Ollama, Gemini and any custom LLM provider.
Sistemas e infraestruturaO que você pode fazer
- Manage models - Provider groups, search, edit, duplicate, enable/disable, model discovery, and keyboard search in the standalone model dropdown.
- Connect your providers - OpenAI, Anthropic, Gemini, OpenRouter, Cloudflare Workers AI, and other compatible APIs; local services such as Ollama, LM Studio, and vLLM.
- Tune requests - Protocol selection, reasoning settings, context/output limits, custom headers, timeouts, retries, fallbacks, and circuit breakers.
- Choose subagent models - Clients with invoke_subagent support custom child models with isolated routing. Antigravity IDE can delegate independent text tasks through the custom-model MCP tools.
Crescimento medido de estrelas
- em 24 h
- +5
- em 7 dias
- +49
- em 15 dias
- +74
- em 1 mês
- Coletando histórico
Variações líquidas em períodos sobrepostos, não totais diários. Medições ausentes ficam em branco. Estrelas indicam interesse, não qualidade.
README.md
Original
Antigravity Custom Model Enabler
Your providers. Your local models. Inside Antigravity.
Model management for the desktop app, Antigravity IDE, and an optional gateway.
English · 简体中文 · Español · Türkçe · Русский · हिन्दी · العربية
Quick start · Quick links · Screenshots · Documentation · Report an issue
Add external API providers and local models alongside Antigravity's built-in models. Configure them in Settings, switch models from the chat picker, and optionally route requests through a gateway with history, fallback providers, and a browser dashboard.
[!IMPORTANT] The standalone Electron desktop agent uses the additive installer below. The separate VS Code-based Antigravity IDE uses its own settings adapter and local web manager. Windows IDE 2.5.5 sign-in, native model selection and streamed chat were verified with a local OpenAI-compatible provider; see the validation results. Custom-model routing applies to local sessions; the vendor's WSL routing is preserved. Check compatibility before installing.
Quick links
What you can do
| Capability | Included |
|---|---|
| Manage models | Provider groups, search, edit, duplicate, enable/disable, model discovery, and keyboard search in the standalone model dropdown. |
| Connect your providers | OpenAI, Anthropic, Gemini, OpenRouter, Cloudflare Workers AI, and other compatible APIs; local services such as Ollama, LM Studio, and vLLM. |
| Tune requests | Protocol selection, reasoning settings, context/output limits, custom headers, timeouts, retries, fallbacks, and circuit breakers. |
| Choose subagent models | Clients with invoke_subagent support custom child models with isolated routing. Antigravity IDE can delegate independent text tasks through the custom-model MCP tools. |
| Use Google account pools | Antigravity account sign-in, collapsible account cards, enable/disable, label editing, removal, and Preferred/Automatic controls. Each pool retains its own project, credentials and visible quotas; plan badges use provider-reported tiers only. The native fallback switch uses an exact-model Cloud Code pool, with no public Gemini API fallback. Account controls. |
| Estimate visible chat context | A read-only ring beside a recognized native model selector marks transcript estimates with ~ and unavailable usage with ?. Hidden prompts, tool definitions and images are excluded. Configured context limits take priority; clicking can look up a missing limit in the bounded public models.dev catalog without saving configuration. Scope and limits. |
| Inspect direct requests | Diagnostics with recent requests, measured latency/token usage, and an explicit small generation test. |
| Connect Antigravity IDE | Reversible settings adapter, owned proxy launcher and browser model manager; native picker and streamed chat verified on Windows IDE 2.5.5 with a local OpenAI-compatible provider. Setup. |
| Keep native model selections stable | Persistent collision-free IDs for model aliases and effort variants, with explicit native picker capacity. |
| Share configuration | Validated JSON/base64 import and exports that omit stored credentials. |
| Add a web dashboard | Optional gateway with provider routing, request/session history, replay, charts, and cost estimates. |
| Connect remotely | Authenticated gateway access through a tunnel or a configured network endpoint. |
The installer preserves the installed application's runtime and adds validated hooks. It keeps version-specific backups and rolls back failed deployments. See the feature comparison for implementation details and scope.
Screenshots
Model management
Search your models, organize them by provider, and edit, duplicate, or enable connections from one place.
Current addon controls rendered in an isolated browser demo with illustrative model settings. Click an image to view it at full size.
Model editor
Configure a provider and model, choose an API format, or discover available models.
Remote gateway
Save a gateway connection, import model aliases, and open its management dashboard.
Gateway dashboard
Map model aliases to providers and configure fallback models and context limits in the optional web panel.
Current gateway interface in a local test profile; the displayed model mapping is illustrative.
Desktop chat picker — earlier build
Example from an earlier desktop build. Model names and availability depend on your provider and configuration.
Installation
1. Get the project and build
You need the standalone Antigravity desktop app, Git, and Node.js 22.13 or newer. This Node version covers both the desktop addon and the optional gateway.
git clone https://github.com/vahapogut/antigravity-add-model.git
cd antigravity-add-model
npm ci --ignore-scripts
npm run build
Already have the repository? Update your checkout, then run the dependency and build commands again.
Using the Google Antigravity extension in VS Code? No installer is needed:
start the proxy and open VS Code with CLOUD_CODE_URL set, as described in
VS Code extension.
Using Antigravity IDE? Continue with IDE setup instead of the standalone installer below. Its basic flow is:
npm run ide:check -- --resources "/path/to/Antigravity IDE/resources"
npm run ide:apply -- --resources "/path/to/Antigravity IDE/resources"
npm run proxy:start -- --open
npm run ide:launch -- --resources "/path/to/Antigravity IDE/resources"
2. Check and patch the installed app
Close Antigravity and its language server first. From the repository directory, run:
node scripts/deploy.mjs --check
node scripts/deploy.mjs
The first command checks compatibility without changing the installation. The second applies the addon. Reopen Antigravity after a successful deployment.
If automatic detection cannot find your app, use the same explicit path for both commands:
node scripts/deploy.mjs --check --resources "/path/to/Antigravity/resources"
node scripts/deploy.mjs --resources "/path/to/Antigravity/resources"
--resources accepts a Resources directory, an installation directory, or a macOS .app directory. Unknown layouts are rejected before application files are replaced.
Platform wrappers and the optional Windows endpoint patch
The wrappers call the same installer and accept the same arguments.
| Platform | Wrapper |
|---|---|
| Windows / PowerShell | ./deploy.ps1 |
| macOS standalone app | bash deploy.sh |
| Linux | bash deploy_linux.sh |
Some recognized Windows language-server binaries bypass the configurable model-list endpoint. For those builds, check and apply the optional binary patch:
.\deploy.ps1 --check --patch-language-server
.\deploy.ps1 --patch-language-server
This option requires port 50999 and participates in backup/rollback. It is specific to recognized Windows binaries. See Windows endpoint patching.
Add your first model
- Open Settings → Models & Usage (Models in older layouts).
- In Custom Models, select Add model and choose a provider.
- Enter the API URL and API key when required.
- Add models using either of the options below, then select a saved model from the chat picker.
| Method | Steps |
|---|---|
| Enter a model manually | Enter the exact Provider model ID, optionally set a display name, then choose Test connection → Save model. |
| Choose from the provider catalog | Choose Fetch provider models, search by name or ID, check models or Select filtered, then Add selected. |
Running models locally? Start your local server first, then choose Discover local. Discovery checks common ports only when requested.
Using Cloudflare Workers AI? Run npm run workers-ai:setup -- wizard for
guided account selection, scoped-token creation or an existing token, and model
selection. The optional helper encrypts saved credentials and can rotate entries
for one account. See setup, permissions and verification limits.
Moving settings between machines? Use Export and Import. Exported configurations omit API keys, custom headers, and Google tokens/client secrets; enter credentials on the receiving machine.
[!NOTE] A successful connection test verifies model listing and authentication. It does not generate a completion or prove that an account has generation quota. Providers without a listing endpoint can still be configured manually.
Providers and advanced options
| Connection | Examples available in the preset catalog |
|---|---|
| Multi-model services | OpenRouter, Together AI, Hugging Face Inference Providers, Fireworks AI, SiliconFlow, Novita AI |
| Direct hosted APIs | OpenAI, Anthropic, Google Gemini, DeepSeek, Groq, Mistral, xAI, Cerebras, SambaNova, Alibaba Cloud Model Studio, NVIDIA NIM |
| Local servers | Ollama, LM Studio, llama.cpp, vLLM, LocalAI, TabbyAPI, Text Generation WebUI |
| Other endpoints | LiteLLM, compatible custom endpoints, or an authenticated model gateway |
Presets fill in defaults; API format determines how requests are translated. Model IDs and access depend on the provider. The provider catalog is the full list.
Want hundreds of model choices? OpenRouter and other multi-model services supply live catalogs through Fetch provider models. Search and select the models you need; the addon imports available context/output limits and image/reasoning metadata while preserving your explicit overrides. Catalogs change over time, and a listed model still needs account access and the capabilities your task requires. See provider setup and model discovery.
Using a vision model? The desktop proxy forwards image inputs to OpenAI-compatible and Anthropic-compatible endpoints, including compatible DeepSeek vision models. See image input setup for capability overrides, supported formats and endpoint requirements.
Open Advanced settings for request limits, reasoning, headers, fallback models, and other overrides. See the configuration reference for field definitions and a sample import.
Compaction reasoning effort lets recognized IDE context summaries use low or none while ordinary chat keeps its own effort. The gateway also has a separate summary-effort setting. See configuration and model support.
Compaction threshold (%) lets you tune the native IDE's checkpoint threshold while reserving space for model output. Leave it blank to keep the IDE default; see the 85k context example.
For Google account pooling, choose Google Cloud Code account pool and follow the account setup guide. Sign in with Antigravity account using a recognized IDE 2.5.5 installation, or select My Desktop OAuth client to use your own client. Account and service eligibility remain provider-controlled.
Optional gateway and web dashboard
The desktop addon can connect directly to your providers. Add the gateway when you want centralized routing, browser management, request history, or a remote endpoint.
npm run gateway:install
npm run gateway:build
npm run gateway -- setup --non-interactive
npm run gateway -- start
Setup prints the generated gateway token and dashboard login locally. Open http://127.0.0.1:51001, sign in, configure provider credentials and model aliases, then save.
In the desktop's Remote gateway dialog, enter:
| Field | Local setup |
|---|---|
| Gateway URL | http://127.0.0.1:51000 |
| Gateway token | The token printed by setup |
| Dashboard URL | http://127.0.0.1:51001 |
Choose Test gateway, then Import model aliases. The imported models appear in the desktop picker. Open dashboard opens the saved dashboard URL.
Gateway commands
npm run gateway -- status
npm run gateway -- logs
npm run gateway -- stop
Provider/model changes saved in the dashboard reload immediately. Listening address and port changes require a restart. History includes prompts, responses, and tool arguments; cost totals are estimates.
Connect from another computer
Run the gateway on the host with access to your providers. On the client, forward both ports over SSH:
ssh -N -L 51000:127.0.0.1:51000 -L 51001:127.0.0.1:51001 user@gateway-host
Keep the tunnel open and use the local URLs from the table above. Both gateway listeners bind to loopback by default. For an explicit network listener or HTTPS reverse proxy, see the remote access guide.
How it fits together
flowchart LR
Desktop["Antigravity desktop"] --> Proxy["Local model proxy"]
Proxy --> Builtin["Built-in Google models"]
Proxy --> Providers["External APIs / local models"]
Proxy --> Gateway["Optional gateway"]
Gateway --> Providers
Dashboard["Web dashboard + history"] --- Gateway
The addon appends its Settings controls and preserves the installed vendor runtime. The gateway runs as a separate Node process and uses its own data directory.
Updates, diagnostics, and recovery
After an Antigravity update, rebuild the addon and run the compatibility check again before redeploying.
| Need | Command |
|---|---|
| Check the build, model configuration, and local services | npm run doctor |
| Get diagnostics as JSON | npm run doctor -- --json |
| Check an explicit installation | npm run patch:check -- --resources "/path/to/Resources" |
| Reapply the addon to a supported installation | npm run doctor:repair -- --resources "/path/to/Resources" |
| Restore this installer's backup | npm run patch:restore -- --resources "/path/to/Resources" |
| Inspect a Windows installation before updating | node scripts/update-preflight.mjs check --resources "C:\path\to\Antigravity\resources" --json |
| Restore managed changes and stop the owned proxy before updating | node scripts/update-preflight.mjs prepare --resources "C:\path\to\Antigravity\resources" |
Close the app before repair or restore. Use the Windows endpoint option when applicable. Restore refuses to overwrite an installation changed by a later upstream update.
| Symptom | Start here |
|---|---|
Installer reports NOT_SUPPORTED or UNSUPPORTED_RUNTIME |
Confirm you have the standalone app and check the supported layouts. |
| Black screen after an app update | Follow startup recovery; avoid restoring an arbitrary older archive. |
| Windows installer keeps asking to close Antigravity | Follow update preparation; collect the exact installer error if it persists. |
| A model is missing | Check that it is enabled, saved, and using the correct provider model ID. |
| Windows standalone 2.0.6: models missing from the native picker | Check the actual Language Server request path and the fixed-port endpoint patch; see the verified Windows case. |
| Provider returns 401, 403, or 404 | Check credentials, account access/location, API URL, and model availability. |
| Port 50999 is occupied | A binary-patched Windows install needs that fixed port; ordinary unpatched operation can choose another port. |
| TLS connection fails | Check the endpoint certificate and your trusted CA configuration. |
More details: compatibility and recovery · Windows 2.0.6 picker verification · model configuration
Credentials and data
| Component | Stored data and behavior |
|---|---|
| Desktop addon | Models live in ~/.gemini/antigravity/custom_models.json. Saved API keys, headers, gateway tokens, and Google credentials are encrypted and masked in the editor. |
| Encryption fallback | When OS-backed storage is unavailable, local AES-256-GCM uses ~/.gemini/antigravity/.model-credentials-key. Keep that key with private backups. |
| Model exports | Stored API keys, custom headers, and Google tokens/client secrets are omitted. Ordinary configuration fields are retained. |
| Optional gateway | Uses its own ~/.gemini/antigravity/gateway profile. Its credential configuration is separate from Electron storage; history contains request and response content. |
Use Export to share model settings. See data handling and gateway storage before copying local profiles.
Documentation
| Guide | What it covers |
|---|---|
| Configuration reference | Model fields, import format, Google accounts, and credentials |
| Providers and model catalogs | Popular services, API endpoints, large-catalog discovery, and account requirements |
| Cloudflare setup wizard | Account selection, scoped tokens, encrypted model import and account-specific rotation |
| Gateway guide | Setup, routing, dashboard, lifecycle, and remote access |
| Compatibility and recovery | Supported layouts, updates, backups, and troubleshooting |
| Feature comparison | Reference repositories, implemented features, and remaining differences |
| Changelog | Current changes and historical release notes |
| Gateway provenance | Source revision and retained license notices |
Development and contributing
The desktop addon is TypeScript in src/, compiled to the tracked dist/ directory. The optional gateway has its own package in gateway/.
npm ci --ignore-scripts
npm run build
npm test
npm run lint
For gateway or integration changes:
npm run gateway:install
npm run gateway:build
npm run gateway:test
npm run test:integration
CI runs on Windows, macOS, and Linux using local provider fixtures and isolated installation packages. It does not validate live provider credentials or every future Antigravity release.
For a new provider, start with the desktop preset catalog, protocol registry, and gateway provider catalog. Changes should include relevant tests and rebuilt desktop output. Pull requests are welcome; open an issue for reproducible bugs, with your app type/version, OS, and diagnostics.
License and credits
Apache License 2.0. Adapted gateway components retain their MIT license and upstream attribution.
Antigravity logo from Google's official press assets.
Explore projetos relacionados
Carregando…



