From 3185e9f6a7240c76806e9d7c96b2d14de0df9321 Mon Sep 17 00:00:00 2001 From: Rahul Sengottuvelu Date: Wed, 9 Apr 2025 16:29:21 -0400 Subject: [PATCH] docs: correct setup instructions to use uv --- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 71df2ef..219c911 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,8 @@ A proxy server that lets you use Anthropic clients with Gemini or OpenAI models ### Prerequisites - OpenAI API key 🔑 +- Google AI Studio (Gemini) API key (if using default provider) 🔑 +- [uv](https://github.com/astral-sh/uv) (recommended) or pip installed. ### Setup 🛠️ @@ -22,10 +24,17 @@ A proxy server that lets you use Anthropic clients with Gemini or OpenAI models ``` 2. **Install dependencies**: + Using uv (recommended): ```bash - pip install -r requirements.txt + uv venv # Create virtual environment (optional but recommended) + uv pip install fastapi uvicorn litellm python-dotenv httpx # Install main packages + ``` + Or using pip: + ```bash + python -m venv .venv + source .venv/bin/activate # Or .\venv\Scripts\activate on Windows + pip install fastapi uvicorn litellm python-dotenv httpx ``` - *(Ensure `requirements.txt` includes FastAPI, Uvicorn, LiteLLM, python-dotenv, httpx)* 3. **Configure Environment Variables**: Copy the example environment file: @@ -46,6 +55,11 @@ A proxy server that lets you use Anthropic clients with Gemini or OpenAI models - Otherwise (if `PREFERRED_PROVIDER=openai` or the specified Google model isn't known), they map to `SMALL_MODEL`/`BIG_MODEL` prefixed with `openai/`. 4. **Run the server**: + Using uv: + ```bash + uv run uvicorn server:app --host 0.0.0.0 --port 8082 --reload + ``` + Or directly with uvicorn (if installed globally or in activated venv): ```bash uvicorn server:app --host 0.0.0.0 --port 8082 --reload ``` @@ -125,15 +139,13 @@ SMALL_MODEL=gpt-4o-mini Or set them directly when running the server: ```bash -# Using OpenAI models +# Using OpenAI models (with uv) BIG_MODEL=gpt-4o SMALL_MODEL=gpt-4o-mini uv run uvicorn server:app --host 0.0.0.0 --port 8082 -# Using Gemini models +# Using Gemini models (with uv) BIG_MODEL=gemini-2.5-pro-preview-03-25 SMALL_MODEL=gemini-2.0-flash uv run uvicorn server:app --host 0.0.0.0 --port 8082 -``` -To use a mix of OpenAI and Gemini models: -```bash +# Mix and match (with uv) BIG_MODEL=gemini-2.5-pro-preview-03-25 SMALL_MODEL=gpt-4o-mini uv run uvicorn server:app --host 0.0.0.0 --port 8082 ```