[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-109154":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":23,"topics":26,"createdAt":10,"pushedAt":46,"updatedAt":47,"readmeContent":48,"aiSummary":49,"trendingCount":16,"starSnapshotCount":16,"syncStatus":50,"lastSyncTime":51,"discoverSource":52},109154,"antiglaude","sksarvesh007\u002Fantiglaude","sksarvesh007","Production compatibility gateway bridge & observability platform connecting Claude Code CLI with Google Antigravity & Gemini inference models via Anthropic Messages API","https:\u002F\u002Fgithub.com\u002Fsksarvesh007\u002Fantiglaude-bridge#readme",null,"Python",183,27,84,1,0,6,10,70,19,68.34,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],"ai-agent","anthropic","anthropic-api","antigravity","antigravity-proxy","claude","claude-code","claude-code-router","claude-proxy","claude-sonnet","code-assistant","coding-agent","developer-tools","gemini","gemini-api","google-antigravity","llm-gateway","observability","reverse-proxy","2026-11-21 08:08:20","2026-11-23 19:33:27","# Antiglaude\n\n[![PyPI](https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fantiglaude?label=pypi&color=111111)](https:\u002F\u002Fpypi.org\u002Fproject\u002Fantiglaude\u002F)\n[![CI](https:\u002F\u002Fgithub.com\u002Fsksarvesh007\u002Fantiglaude\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fsksarvesh007\u002Fantiglaude\u002Factions\u002Fworkflows\u002Fci.yml)\n[![Release](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fv\u002Frelease\u002Fsksarvesh007\u002Fantiglaude?color=111111)](https:\u002F\u002Fgithub.com\u002Fsksarvesh007\u002Fantiglaude\u002Freleases)\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.10+-111111.svg)](https:\u002F\u002Fwww.python.org\u002Fdownloads\u002F)\n[![uv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpackaging-uv-111111.svg)](https:\u002F\u002Fgithub.com\u002Fastral-sh\u002Fuv)\n[![FastAPI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FFastAPI-0.110+-111111.svg)](https:\u002F\u002Ffastapi.tiangolo.com)\n[![Claude Code](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FClaude%20Code-Compatible-111111.svg)](https:\u002F\u002Fcode.claude.com)\n[![OpenAI Compatible](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FOpenAI%20API-Compatible-111111.svg)](https:\u002F\u002Fplatform.openai.com)\n[![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-MIT-111111.svg)](https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT)\n\nA high-performance local protocol gateway and inference server. Antiglaude translates Anthropic Messages and OpenAI Chat Completions requests into Google Cloud Code and Gemini execution formats, enabling Claude Code CLI and standard AI toolchains to operate against upstream models including `claude-sonnet-4-6`, `claude-opus-4-6-thinking`, `gemini-3-flash`, and `gemini-2.5-pro`.\n\n> [!WARNING]\n> **Use at your own risk**: Google has been actively detecting, suspending, and banning accounts using automated gateways and unofficial protocol proxies. Do not connect your primary personal or workplace Google account. Always use a dedicated burner account. You assume full responsibility for any account actions, quota limits, or service terminations.\n\n---\n\n## Contents\n\n- [Overview](#overview)\n- [Quick Start](#quick-start)\n- [Terminal Control Panel](#terminal-control-panel)\n- [Claude Code Integration](#claude-code-integration)\n  - [In-Session Model Picker (\u002Fmodel)](#in-session-model-picker-model)\n  - [System-Wide Persistence](#system-wide-persistence)\n  - [Auto Mode Classifier Billing Protocol](#auto-mode-classifier-billing-protocol)\n- [Background Service (macOS launchd)](#background-service-macos-launchd)\n- [OpenAI Compatible API](#openai-compatible-api)\n  - [Python SDK](#python-sdk)\n  - [Streaming](#streaming)\n  - [HTTP Request](#http-request)\n  - [Model Directory](#model-directory)\n  - [Third-Party Integrations](#third-party-integrations)\n- [Architecture](#architecture)\n- [Makefile Reference](#makefile-reference)\n- [Testing](#testing)\n- [Security and Privacy](#security-and-privacy)\n- [License](#license)\n\n---\n\n## Overview\n\nInterfacing external developer tooling with enterprise cloud backends introduces protocol impedance mismatches:\n\n- **Token Expiration**: Upstream access tokens expire after 60 minutes. Antiglaude Bridge extracts permanent refresh credentials from local application state and transparently renews access tokens in the background.\n- **Protobuf Schema Incompatibilities**: Advanced JSON Schema keywords emitted by agentic runtimes (`propertyNames`, `anyOf`, `const`) cause HTTP 400 rejection in Google protobuf serializers. The bridge applies bidirectional AST normalizations to guarantee full tool calling compatibility.\n- **Header & Identity Filtering**: Third-party billing headers and self-identification banners trip strict upstream quota filters. The gateway neutralizes identity markers and scrubs unsupported metadata.\n- **Keep-Alive Resilience**: Long reasoning turns can trigger client connection drops. The gateway emits periodic SSE keep-alive heartbeats and handles TCP resets with pooled connection limits and instant retry failover.\n\n---\n\n## Quick Start\n\n### Option A: Install from PyPI\n\nInstall the CLI toolchain via `pip` or Astral's `uv`:\n\n```bash\n# Using pip\npip install antiglaude\n\n# Or using uv tool\nuv tool install antiglaude\n\n# Or run instantly without installing\nuvx antiglaude start\n```\n\nOnce installed, use the `antiglaude` CLI directly:\n\n```bash\n# Start the gateway server\nantiglaude start\n\n# Launch the live Terminal Control Panel\nantiglaude tui\n\n# Configure Claude Code system-wide (\u002Fmodel picker + default bridge)\nantiglaude setup-claude\n\n# Install macOS LaunchAgent daemon (auto-starts on boot)\nantiglaude daemon install\n```\n\n### TUI \n\u003Cimg width=\"1280\" height=\"802\" alt=\"image\" src=\"https:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002F5ca37c25-7bf8-43fc-a2ce-d2e779bc7801\" \u002F>\n\n### Option B: Clone from Source\n\nFor development or direct Makefile execution via Astral's `uv`:\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fsksarvesh007\u002Fantiglaude.git\ncd antiglaude\n\n# Bootstrap virtual environment and start gateway on port 8080\nmake start\n\n# Configure Claude Code system-wide and install macOS background daemon\nmake setup-claude\nmake daemon-install\n```\n\n---\n\n## Terminal Control Panel\n\nAntiglaude Bridge includes a terminal-based dashboard for real-time monitoring of daily request quotas, account identity, upstream latency, and inference logs.\n\n```bash\nmake tui\n```\n\n```\n+--------------------------------------------------------------------------------------------------------+\n| ANTIGLAUDE BRIDGE  |  ONLINE (http:\u002F\u002F127.0.0.1:8080)  |  Default: claude-sonnet-4-6  |  2026-11-04   |\n+--------------------------------------------------------------------------------------------------------+\n| Upstream Authentication                    | Rate Limits & Quota Meter                                 |\n| Account:        user@antigravity           | Daily Limit:        1,500 reqs\u002Fday                        |\n| Project ID:     aicode-consumers           | Requests Today:     14 [==......................] 0.9%    |\n| Tier:           Google AI Pro              | Requests Remaining: 1,486                                 |\n| Service:        Active (launchd)           | Lifetime Requests:  248                                   |\n| Uptime:         1,840 seconds              | Tokens (In \u002F Out):  104,200 \u002F 14,800                      |\n+--------------------------------------------+-----------------------------------------------------------+\n| Routing Matrix & Supported Models                                                                      |\n| Model Identifier           Target Backend                 Status      Requests  Description            |\n| > claude-sonnet-4-6        Claude 3.7 Sonnet (Thinking)   Active            12  Primary agentic engine |\n|   claude-opus-4-6-thinking Claude 3 Opus (Thinking)       Active             2  Deep reasoning & arch  |\n|   gemini-3-flash           Gemini 3 Flash                 Active             0  Low-latency throughput |\n|   gemini-2.5-pro           Gemini 2.5 Pro                 Active             0  Large context analysis |\n+--------------------------------------------------------------------------------------------------------+\n| Request Journal & Latency Log                                                                          |\n| Time      Client       Endpoint             Model              Tokens    Latency  Status               |\n| 02:49:09  claude-code  \u002Fv1\u002Fmessages         claude-sonnet-4-6  23,609    1820 ms  200                  |\n+--------------------------------------------------------------------------------------------------------+\n| [r] Refresh   [m] Switch Model   [c] Run Claude   [s] Restart Server   [d] Daemon Manager   [q] Quit   |\n+--------------------------------------------------------------------------------------------------------+\n```\n\n### Keybindings\n\n| Key | Action |\n| :--- | :--- |\n| `r` | Force refresh account tier, token status, and quota metrics |\n| `m` | Switch active default model in `~\u002F.claude\u002Fsettings.json` |\n| `c` | Launch interactive Claude Code session within the terminal |\n| `s` | Restart local gateway process and clear stale network sockets |\n| `d` | Open macOS LaunchAgent daemon management dialog |\n| `q` | Exit the dashboard |\n\n---\n\n## Claude Code Integration\n\n### In-Session Model Picker (\u002Fmodel)\n\nClaude Code supports native model switching via the `\u002Fmodel` command when configured with a valid `modelPicker` manifest. Run:\n\n```bash\nmake setup-claude\n```\n\nThis writes the required schema to `~\u002F.claude\u002Fsettings.json`:\n\n```json\n{\n  \"env\": {\n    \"ANTHROPIC_BASE_URL\": \"http:\u002F\u002F127.0.0.1:8080\",\n    \"ANTHROPIC_API_KEY\": \"test\",\n    \"CLAUDE_CODE_AUTO_MODE_SERVER\": \"0\",\n    \"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY\": \"1\"\n  },\n  \"model\": \"claude-sonnet-4-6\",\n  \"modelPicker\": {\n    \"replaceBuiltInOptions\": false,\n    \"options\": [\n      {\n        \"model\": \"claude-sonnet-4-6\",\n        \"label\": \"Claude Sonnet 4.6 (Thinking)\",\n        \"description\": \"Fast agentic reasoning via Antiglaude Bridge\",\n        \"behavesAs\": \"claude-3-7-sonnet\"\n      },\n      {\n        \"model\": \"claude-opus-4-6-thinking\",\n        \"label\": \"Claude Opus 4.6 (Thinking)\",\n        \"description\": \"Deep reasoning with extended thinking via Antiglaude Bridge\",\n        \"behavesAs\": \"claude-3-opus\"\n      },\n      {\n        \"model\": \"gemini-3-flash\",\n        \"label\": \"Gemini 3 Flash\",\n        \"description\": \"High-speed completions via Antiglaude Bridge\",\n        \"behavesAs\": \"claude-3-5-haiku\"\n      },\n      {\n        \"model\": \"gemini-2.5-pro\",\n        \"label\": \"Gemini 2.5 Pro\",\n        \"description\": \"Analytical large-context model via Antiglaude Bridge\",\n        \"behavesAs\": \"claude-3-7-sonnet\"\n      }\n    ]\n  }\n}\n```\n\nTyping `\u002Fmodel` inside any Claude Code session displays the interactive selection menu with full keyboard navigation.\n\n### System-Wide Persistence\n\nThe `make setup-claude` command sets configurations in `~\u002F.claude\u002Fsettings.json` and exports environment variables to `~\u002F.zshrc`. After setup, you can launch Claude Code from any terminal or process without passing flags:\n\n```bash\nclaude\n```\n\n### Auto Mode Classifier Billing Protocol\n\nClaude Code versions 2.1+ include an auto-mode classifier protocol. Local gateways that do not return structured safeguard evaluations trigger billing fallback warnings.\n\nAntiglaude Bridge resolves this through two complementary mechanisms:\n1. **Safeguard Protocol Handling**: The bridge parses the `safeguards` request parameter and returns structured `safeguard_results` matching Claude Code's internal schema (`dangerous_tool_use`, status `available`, outcome `not_flagged`).\n2. **Local Classifier Delegation**: `CLAUDE_CODE_AUTO_MODE_SERVER=\"0\"` instructs the CLI harness to perform classifications locally without external billing queries.\n\n---\n\n## Background Service (macOS launchd)\n\nTo run Antiglaude Bridge permanently in the background:\n\n```bash\n# Register and start launchd daemon\nmake daemon-install\n```\n\n### Operational Characteristics\n- Installed to `~\u002FLibrary\u002FLaunchAgents\u002Fcom.antiglaude.bridge.plist`.\n- Automatically loads on macOS login and runs continuously with `KeepAlive: true`.\n- Starts before Antigravity IDE or Claude Code CLI sessions open; port 8080 is always available.\n- Logs are written to `~\u002F.antiglaude\u002Fbridge.stdout.log` and `~\u002F.antiglaude\u002Fbridge.stderr.log`.\n\n```bash\n# Check status or inspect logs\nmake daemon-status\n\n# Stop and unregister daemon\nmake daemon-uninstall\n```\n\n---\n\n## OpenAI Compatible API\n\nAntiglaude Bridge provides a drop-in `\u002Fv1\u002Fchat\u002Fcompletions` endpoint for standard OpenAI SDKs and third-party AI frameworks.\n\n### Python SDK\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http:\u002F\u002F127.0.0.1:8080\u002Fv1\",\n    api_key=\"sk-antiglaude\",\n)\n\nresponse = client.chat.completions.create(\n    model=\"claude-sonnet-4-6\",\n    messages=[\n        {\"role\": \"system\", \"content\": \"You are a systems engineer.\"},\n        {\"role\": \"user\", \"content\": \"Describe memory paging in one sentence.\"},\n    ],\n)\n\nprint(response.choices[0].message.content)\n```\n\n### Streaming\n\n```python\nfrom openai import OpenAI\n\nclient = OpenAI(\n    base_url=\"http:\u002F\u002F127.0.0.1:8080\u002Fv1\",\n    api_key=\"sk-antiglaude\",\n)\n\nstream = client.chat.completions.create(\n    model=\"claude-opus-4-6-thinking\",\n    messages=[{\"role\": \"user\", \"content\": \"Write a quicksort implementation in C.\"}],\n    stream=True,\n)\n\nfor chunk in stream:\n    content = chunk.choices[0].delta.content or \"\"\n    print(content, end=\"\", flush=True)\n```\n\n### HTTP Request\n\n```bash\n# Non-streaming\ncurl -X POST http:\u002F\u002F127.0.0.1:8080\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Authorization: Bearer test\" \\\n  -d '{\n    \"model\": \"claude-sonnet-4-6\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Ping\"}]\n  }'\n\n# Streaming\ncurl -N -X POST http:\u002F\u002F127.0.0.1:8080\u002Fv1\u002Fchat\u002Fcompletions \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -H \"Authorization: Bearer test\" \\\n  -d '{\n    \"model\": \"gemini-3-flash\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Count from 1 to 5\"}],\n    \"stream\": true\n  }'\n```\n\n### Model Directory\n\n| Model Identifier | Target Backend | Optimized Workload |\n| :--- | :--- | :--- |\n| `claude-sonnet-4-6` *(default)* | Claude 3.7 Sonnet | Agentic workflows, coding, tool calling |\n| `claude-opus-4-6-thinking` | Claude 3 Opus (Thinking) | Complex reasoning, mathematical analysis, architecture |\n| `gemini-3-flash` | Gemini 3 Flash | Low-latency completions, summaries, high concurrency |\n| `gemini-2.5-pro` | Gemini 2.5 Pro | Deep analytical processing, large-context windows |\n| `claude-3-7-sonnet-latest` | `claude-sonnet-4-6` | Anthropic alias fallback |\n| `claude-3-5-haiku-latest` | `gemini-3-flash` | Lightweight Anthropic alias fallback |\n\n*Heuristic Fallback: Any arbitrary model identifier requested by a client (such as `gpt-4o` or legacy strings) is mapped to the most capable active upstream model while returning the requested ID in the completion response.*\n\n### Third-Party Integrations\n\nConfigure your environment or client configuration:\n\n- **LangChain \u002F LlamaIndex**: Set `base_url=\"http:\u002F\u002F127.0.0.1:8080\u002Fv1\"`, `api_key=\"test\"`.\n- **Cursor \u002F Continue.dev**: Add custom OpenAI provider pointing to `http:\u002F\u002F127.0.0.1:8080\u002Fv1`.\n- **AutoGen \u002F CrewAI**: Set `base_url=\"http:\u002F\u002F127.0.0.1:8080\u002Fv1\"`.\n\n---\n\n## Architecture\n\n```\n+----------------------------------+     +----------------------------------+\n|         Claude Code CLI          |     |      OpenAI Compatible SDKs      |\n|    Anthropic Messages Protocol   |     |    LangChain, Cursor, Continue   |\n+-----------------+----------------+     +-----------------+----------------+\n                  |                                        |\n                  | POST \u002Fv1\u002Fmessages                      | POST \u002Fv1\u002Fchat\u002Fcompletions\n                  +-------------------+--------------------+\n                                      |\n                                      v\n+---------------------------------------------------------------------------+\n|                         Antiglaude Bridge Gateway                         |\n|                                                                           |\n|   [Anthropic SSE Parser]                 [OpenAI Request\u002FResponse Bridge] |\n|   - Stream chunk normalizer              - SSE event-to-chunk mapper      |\n|   - Safeguard result emitter             - Token usage synthesizer        |\n|                                                                           |\n|   [Protocol & Schema Transformation]                                      |\n|   - OpenAPI-to-Protobuf schema sanitizer (strips propertyNames, anyOf)    |\n|   - System turn extraction & identity scrubber                            |\n|                                                                           |\n|   [Authentication & Reliability]                                          |\n|   - Zero-touch OAuth token auto-refresher (permanent refresh credentials) |\n|   - Rate-limit backoff engine & TCP keep-alive heartbeat watchdog         |\n|   - Live telemetry journal & 1,500 daily quota tracking meter             |\n+-------------------------------------+-------------------------------------+\n                                      |\n                                      | Cloud Code REST \u002F Protobuf\n                                      v\n+---------------------------------------------------------------------------+\n|                  Google Cloud Code \u002F Gemini Inference API                 |\n|   Claude Sonnet 4.6 (Thinking)         Gemini 3 Flash                     |\n|   Claude Opus 4.6 (Thinking)           Gemini 2.5 Pro                     |\n+---------------------------------------------------------------------------+\n```\n\n---\n\n## Makefile Reference\n\n| Target | Description | Example |\n| :--- | :--- | :--- |\n| `make start` | Installs dependencies with `uv` and starts the gateway | `make start` |\n| `make serve` | Alias for `make start` | `make serve PORT=8080` |\n| `make tui` | Opens the terminal control panel | `make tui` |\n| `make setup-claude` | Configures `~\u002F.claude\u002Fsettings.json` and `\u002Fmodel` menu | `make setup-claude` |\n| `make daemon-install` | Installs and loads macOS LaunchAgent service | `make daemon-install` |\n| `make daemon-status` | Displays LaunchAgent process status and log output | `make daemon-status` |\n| `make daemon-uninstall` | Stops and unregisters the LaunchAgent service | `make daemon-uninstall` |\n| `make claude` | Starts Claude Code CLI routed through the local bridge | `make claude` |\n| `make status` | Verifies token validity and upstream account resolution | `make status` |\n| `make test` | Executes the test harness | `make test` |\n| `make stop` | Terminates processes listening on the configured port | `make stop PORT=8080` |\n| `make clean` | Removes virtual environment, build artifacts, and cache | `make clean` |\n\n---\n\n## Testing\n\nThe test harness validates protocol conversions, schema sanitization, streaming event framing, and endpoint compatibility:\n\n```bash\nmake test\n```\n\nAll 18 unit tests execute in isolated test environments without consuming upstream inference quota.\n\n---\n\n## Security and Privacy\n\n- **Local Execution**: The gateway binds exclusively to loopback (`127.0.0.1`).\n- **No Third-Party Telemetry**: Traffic flows directly between local clients and the configured Google infrastructure.\n- **Credential Hygiene**: Local state databases, OAuth tokens, and log directories are excluded from version control via `.gitignore`.\n\n---\n\n## License\n\nMIT License. See [LICENSE](LICENSE) for details.\n","Antiglaude 是一个本地运行的协议网关与可观测性服务，用于桥接 Claude Code CLI 等客户端工具与 Google Antigravity（Cloud Code）及 Gemini 模型后端。它通过 Anthropic Messages API 和 OpenAI 兼容接口，实现实时请求格式转换、多模型路由（如 claude-sonnet-4-6、gemini-2.5-pro）、自动 Token 刷新与会话级模型切换，并提供终端控制面板和后台服务支持。适用于需要在本地开发环境统一接入 Anthropic 与 Google AI 模型的开发者，尤其适合构建私有化 AI 编程助手或混合 LLM 工具链。",2,"2026-11-24 04:36:02","CREATED_QUERY"]