A local development environment that sends Gemini CLI requests to a LiteLLM Proxy, which then forwards traffic to the Google Gemini API. Request/response logs can be viewed in Phoenix.
- LiteLLM Proxy: OpenAI-compatible proxy that routes requests to Google Gemini.
- Phoenix: LLM observability UI.
- Postgres: Stores proxy metadata.
- gemini-cli: CLI used by developers.
docker-compose.yml– Runs Proxy / Phoenix / Postgreslitellm_config.yaml– Defines model aliases and actual Gemini model IDs.env– Google API Key + Proxy Master Keyenv.sh– Environment variables for gemini-cli
- Go to https://aistudio.google.com/api-keys
- Insert the key into
GEMINI_API_KEYin.env
docker compose up -dsource env.shgemini
# Enter /auth, type sk-1234567890, then exit
gemini --model="gemini-2.5-flash-lite" -p "hello"Phoenix UI: 👉 http://localhost:6006
curl -X POST "http://localhost:4000/v1beta/models/gemini-2.5-flash-lite:generateContent" \
-H "Authorization: Bearer $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"contents":[{"parts":[{"text":"hi"}],"role":"user"}]}'-
If the gemini-cli model name ≠
model_name, a 404/500 may occur. -
Ensure
GEMINI_API_KEYin.envis a valid Google API key. -
Check LiteLLM logs:
docker logs -f litellm