docs: correct setup instructions to use uv
This commit is contained in:
parent
15d849cc03
commit
3185e9f6a7
1 changed files with 19 additions and 7 deletions
26
README.md
26
README.md
|
|
@ -12,6 +12,8 @@ A proxy server that lets you use Anthropic clients with Gemini or OpenAI models
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- OpenAI API key 🔑
|
- 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 🛠️
|
### Setup 🛠️
|
||||||
|
|
||||||
|
|
@ -22,10 +24,17 @@ A proxy server that lets you use Anthropic clients with Gemini or OpenAI models
|
||||||
```
|
```
|
||||||
|
|
||||||
2. **Install dependencies**:
|
2. **Install dependencies**:
|
||||||
|
Using uv (recommended):
|
||||||
```bash
|
```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**:
|
3. **Configure Environment Variables**:
|
||||||
Copy the example environment file:
|
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/`.
|
- 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**:
|
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
|
```bash
|
||||||
uvicorn server:app --host 0.0.0.0 --port 8082 --reload
|
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:
|
Or set them directly when running the server:
|
||||||
```bash
|
```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
|
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
|
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:
|
# Mix and match (with uv)
|
||||||
```bash
|
|
||||||
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
|
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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue