litellm-vertex-gemini-local-gateway

litellm-vertex-gemini-local-gateway is a skill for Claude Code, Codex from davidtoby/agent-skills. It costs 105 tokens per session (2,448 once invoked), scanned D, original, MIT.

A guide for building a local LiteLLM gateway that connects Google Vertex AI Gemini to tools such as Claude Code and OpenClaw. A gateway is a local service that receives requests and forwards them to an AI model.

In plain words
What is it for?
Setting up the gateway, connecting it to Vertex AI, configuring Claude Code or OpenClaw, starting it automatically, and verifying its API endpoints.
Why use it?
It provides one local endpoint for Gemini and can keep that service running after macOS login without disturbing existing configurations.

Skill for Claude CodeCodex

Which agent this was written for is unclear — built for openclaw. Also seen: reads .claude/ paths; mentions Claude Code; built for openclaw.

Good fit Setting up the gateway, connecting it to Vertex AI, configuring Claude Code or OpenClaw, starting it automatically, and verifying its API endpoints.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add davidtoby/agent-skills --skill litellm-vertex-gemini-local-gateway
Clone the repo
git clone --depth 1 https://github.com/davidtoby/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for litellm-vertex-gemini-local-gateway

README.md
[![agentmods](https://agentmods.dev/badge/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway/github.svg)](https://agentmods.dev/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway)
Your own site
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for litellm-vertex-gemini-local-gateway

Your own site · 80×15
<a href="https://agentmods.dev/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway"><img src="https://agentmods.dev/badge/skills/davidtoby/agent-skills/litellm-vertex-gemini-local-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 105 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,448 The whole file, excluding the scripts and references it only reads on demand.
Security scan D 3 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00105 $0.02448
Opus 5 $0.00053 $0.01224
Sonnet 5 $0.00021 $0.00490
Haiku 4.5 $0.00011 $0.00245

Measured 8d ago against content hash 57aec89c2762, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade D, and why

litellm-vertex-gemini-local-gateway scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/claude-direct-wrapper.sh, scripts/claude-gemini-wrapper.sh, scripts/claude-sonnet-direct-wrapper.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential fileshighPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

- `~/.config/gcloud/application_default_credentials.json`

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

Back up `~/.claude/settings.json`, then set:

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -sS -H "Authorization: Bearer $LITELLM_MASTER_KEY" http://127.0.0.1:4000/v1/models
skills/litellm-vertex-gemini-local-gateway/SKILL.md · 270 lines

How it starts

The opening of the file, as written. The whole thing — 270 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LiteLLM Vertex Gemini Local Gateway

Build a local LiteLLM deployment on macOS that:

  • uses Vertex AI ADC for Gemini
  • exposes an Anthropic-compatible endpoint such as http://127.0.0.1:4000
  • auto-starts after login via LaunchAgent and stays resident in the background
  • lets Claude Code use Gemini through LiteLLM
  • lets OpenClaw use the same local gateway as a model option without disturbing the existing default unless requested

Quick start

  1. Confirm prerequisites:
    • macOS
    • uv
    • python3
    • Vertex AI ADC already available or obtainable
    • claude installed if Claude Code integration is requested
    • openclaw installed if OpenClaw integration is requested
  2. Read references/fresh-macos-runbook.md first.
  3. Install LiteLLM with Google support:
    • uv tool install 'litellm[proxy,google]'
  4. Generate or hand-write the gateway project files using scripts/render_gateway_bundle.py or references/config-templates.md.
  5. Put secrets only in .env and never echo them back to the user.
  6. Install/load the LaunchAgent and verify port listening.
  7. Verify both /v1/models and /v1/messages.
  8. Wire Claude Code.
  9. Wire OpenClaw.
  10. Report changed files, test commands, rollback paths, and any provider-specific caveats.

What makes this setup fragile

The most important pitfalls are:

  • LiteLLM can appear healthy on /v1/models but still fail real inference until google extras are installed.
  • Claude Code must point ANTHROPIC_BASE_URL at the LiteLLM root, not /v1.
  • Python/system proxy settings can break loopback traffic unless NO_PROXY=127.0.0.1,localhost,::1 is forced.
  • OpenClaw per-run gateway --model overrides may be unauthorized in some local setups; in that case use --local with the explicit provider/model id or switch the default with openclaw models set.

Read references/troubleshooting.md before improvising.

Workflow

1. Confirm prerequisites and choose paths

Choose or confirm:

  • PROXY_DIR — local project directory, e.g. ~/GitHub-Codebase/litellm-vertex-proxy
  • LITELLM_HOST — usually 127.0.0.1
  • LITELLM_PORT — usually 4000
  • LaunchAgent label — e.g. com.example.litellm-vertex-proxy
  • Vertex project id
  • Vertex location, usually global
  • LiteLLM model alias, e.g. gemini-3.1-pro-preview

Read the full file on GitHub · 270 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 270 lines · 105 tokens per session scan D 57aec89c2762

Subscribe to this mod's changes

litellm-vertex-gemini-local-gateway is a skill published in the GitHub repository davidtoby/agent-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 105 tokens to every session and 2,448 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it D with 3 findings (reaches for credential files, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

azure-data-factory

Expert knowledge for Azure Data Factory development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when building ADF pipelines, mapping data flows, SSIS IR/SHIR, CI/CD deployments…

MicrosoftDocs/Agent-Skills · 127 tokens

azure-databricks

Expert knowledge for Azure Databricks development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when using Unity Catalog, Lakeflow pipelines, Genie/AI Runtime, Delta…

MicrosoftDocs/Agent-Skills · 124 tokens

azure-hdinsight

Expert knowledge for Azure HDInsight development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when working with HDInsight Spark/Hive/Kafka/HBase clusters, Ambari/Oozie pipelines…

MicrosoftDocs/Agent-Skills · 119 tokens

azure-microsoft-discovery

Expert knowledge for Azure Microsoft Discovery development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when building Discovery Engine shared sessions, ACR tool images, REST…

MicrosoftDocs/Agent-Skills · 78 tokens

azure-data-science-vm

Expert knowledge for Azure Data Science Virtual Machines development including troubleshooting, decision making, architecture & design patterns, security, configuration, integrations & coding patterns, and deployment. Use when managing DSVM images/tools, IaC deployment (Bicep/ARM), Key Vault secrets, MLflow, or…

MicrosoftDocs/Agent-Skills · 126 tokens

ehr-analysis

End-to-end EHR predictive modeling pipeline with PyHealth, covering dataset loading, task definition, model training, evaluation, calibration, and clinical interpretation.

zongtingwei/Bioclaw_Skills_Hub · 33 tokens