From 329f8ec7a60aace412080ded1e64ce4dd9bcc005 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 25 Jun 2025 22:39:50 -0700 Subject: [PATCH] docs gemini cli --- .../docs/tutorials/litellm_gemini_cli.md | 52 ++++++++++++++++--- 1 file changed, 45 insertions(+), 7 deletions(-) diff --git a/docs/my-website/docs/tutorials/litellm_gemini_cli.md b/docs/my-website/docs/tutorials/litellm_gemini_cli.md index df484b9df5..ff638e4de9 100644 --- a/docs/my-website/docs/tutorials/litellm_gemini_cli.md +++ b/docs/my-website/docs/tutorials/litellm_gemini_cli.md @@ -1,30 +1,68 @@ # Use LiteLLM with Gemini CLI -Quickstart +This tutorial shows you how to integrate the Gemini CLI with LiteLLM Proxy, allowing you to route requests through LiteLLM's unified interface. +## Prerequisites -### 1. Install Gemini CLI +Before you begin, ensure you have: +- Node.js and npm installed on your system +- A running LiteLLM Proxy instance +- A valid LiteLLM Proxy API key +- Git installed for cloning the repository + +## Quick Start Guide + +### Step 1: Install Gemini CLI + +Clone the Gemini CLI repository and navigate to the project directory: ```bash git clone https://github.com/ishaan-jaff/gemini-cli.git cd gemini-cli ``` -### 2. Point Gemini CLI to LiteLLM Proxy +Install the required dependencies: -Set `BASE_URL` to the LiteLLM Proxy URL and set `GEMINI_API_KEY` to your LiteLLM Proxy API key. +```bash +npm install +``` + +### Step 2: Configure Gemini CLI for LiteLLM Proxy + +Configure the Gemini CLI to point to your LiteLLM Proxy instance by setting the required environment variables: ```bash export BASE_URL=http://localhost:4000 export GEMINI_API_KEY=sk-1234567890 ``` -### 3. Run Gemini CLI +**Note:** Replace the values with your actual LiteLLM Proxy configuration: +- `BASE_URL`: The URL where your LiteLLM Proxy is running +- `GEMINI_API_KEY`: Your LiteLLM Proxy API key + +### Step 3: Build and Start Gemini CLI + +Build the project and start the CLI: ```bash npm run build && npm start ``` -### 4. Test it +### Step 4: Test the Integration + +Once the CLI is running, you can send test requests. These requests will be automatically routed through LiteLLM Proxy to the configured Gemini model. + +The CLI will now use LiteLLM Proxy as the backend, giving you access to LiteLLM's features like: +- Request/response logging +- Rate limiting +- Cost tracking +- Model routing and fallbacks + +## Troubleshooting + +If you encounter issues: + +1. **Connection errors**: Verify that your LiteLLM Proxy is running and accessible at the configured `BASE_URL` +2. **Authentication errors**: Ensure your `GEMINI_API_KEY` is valid and has the necessary permissions +3. **Build failures**: Make sure all dependencies are installed with `npm install` -Send a test request on Gemini CLI, this will get routed to LiteLLM Proxy and then to Gemini.