mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-09 03:18:44 +00:00
docs: update install and deployment guidance for uv
This commit is contained in:
parent
c124963812
commit
1ef1c5a6dd
111 changed files with 259 additions and 281 deletions
19
AGENTS.md
19
AGENTS.md
|
|
@ -121,7 +121,7 @@ LiteLLM supports MCP for agent workflows:
|
|||
|
||||
## RUNNING SCRIPTS
|
||||
|
||||
Use `poetry run python script.py` to run Python scripts in the project environment (for non-test files).
|
||||
Use `uv run python script.py` to run Python scripts in the project environment (for non-test files).
|
||||
|
||||
## GITHUB TEMPLATES
|
||||
|
||||
|
|
@ -232,16 +232,16 @@ When opening issues or pull requests, follow these templates:
|
|||
|
||||
### Environment
|
||||
|
||||
- Poetry is installed in `~/.local/bin`; the update script ensures it is on `PATH`.
|
||||
- uv is installed in `~/.local/bin`; the update script ensures it is on `PATH`.
|
||||
- Python 3.12, Node 22 are pre-installed.
|
||||
- The virtual environment lives under `~/.cache/pypoetry/virtualenvs/`.
|
||||
- The project virtual environment lives under `.venv/`.
|
||||
|
||||
### Running the proxy server
|
||||
|
||||
Start the proxy with a config file:
|
||||
|
||||
```bash
|
||||
poetry run litellm --config dev_config.yaml --port 4000
|
||||
uv run litellm --config dev_config.yaml --port 4000
|
||||
```
|
||||
|
||||
The proxy takes ~15-20 seconds to fully start (it runs Prisma migrations on boot). Wait for `/health` to return before sending requests. Without a PostgreSQL `DATABASE_URL`, the proxy connects to a default Neon dev database embedded in the `litellm-proxy-extras` package.
|
||||
|
|
@ -250,17 +250,16 @@ The proxy takes ~15-20 seconds to fully start (it runs Prisma migrations on boot
|
|||
|
||||
See `CLAUDE.md` and the `Makefile` for standard commands. Key notes:
|
||||
|
||||
- `psycopg-binary` must be installed (`poetry run pip install psycopg-binary`) because the pytest-postgresql plugin requires it and the lock file only includes `psycopg` (no binary).
|
||||
- `openapi-core` must be installed (`poetry run pip install openapi-core`) for the OpenAPI compliance tests in `tests/test_litellm/interactions/`.
|
||||
- `uv sync --group proxy-dev --extra proxy` installs the Prisma and proxy-side test dependencies used by the standard local workflow.
|
||||
- The `--timeout` pytest flag is NOT available; don't pass it.
|
||||
- Unit tests: `poetry run pytest tests/test_litellm/ -x -vv -n 4`
|
||||
- Unit tests: `uv run pytest tests/test_litellm/ -x -vv -n 4`
|
||||
- Black `--check` may report pre-existing formatting issues; this does not block test runs.
|
||||
- If `poetry install` fails with "pyproject.toml changed significantly since poetry.lock was last generated", run `poetry lock` first to regenerate the lock file.
|
||||
- If `uv sync` fails because the lockfile is outdated, run `uv lock` and retry.
|
||||
|
||||
### Lint
|
||||
|
||||
```bash
|
||||
cd litellm && poetry run ruff check .
|
||||
cd litellm && uv run ruff check .
|
||||
```
|
||||
|
||||
Ruff is the primary fast linter. For the full lint suite (including mypy, black, circular imports), run `make lint` per `CLAUDE.md`.
|
||||
|
|
@ -271,4 +270,4 @@ Ruff is the primary fast linter. For the full lint suite (including mypy, black,
|
|||
- The proxy at port 4000 serves a **pre-built** static UI from `litellm/proxy/_experimental/out/`. After making UI code changes, you must run `npm run build` in the dashboard directory and copy the output: `cp -r ui/litellm-dashboard/out/* litellm/proxy/_experimental/out/` for the proxy to serve the updated UI.
|
||||
- SVGs used as provider logos (loaded via `<img>` tags) must NOT use `fill="currentColor"` — replace with an explicit color like `#000000` or use the `-color` variant from lobehub icons, since CSS color inheritance does not work inside `<img>` elements.
|
||||
- Provider logos live in `ui/litellm-dashboard/public/assets/logos/` (source) and `litellm/proxy/_experimental/out/assets/logos/` (pre-built). Both locations must have the file for it to work in dev and proxy-served modes.
|
||||
- UI Vitest tests: `cd ui/litellm-dashboard && npx vitest run`
|
||||
- UI Vitest tests: `cd ui/litellm-dashboard && npx vitest run`
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|||
### Installation
|
||||
- `make install-dev` - Install core development dependencies
|
||||
- `make install-proxy-dev` - Install proxy development dependencies with full feature set
|
||||
- `make install-test-deps` - Install all test dependencies
|
||||
- `make install-test-deps` - Install the full local test environment and generate the Prisma client
|
||||
|
||||
### Testing
|
||||
- `make test` - Run all tests
|
||||
|
|
@ -22,11 +22,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
|
|||
- `make lint-mypy` - Run MyPy type checking only
|
||||
|
||||
### Single Test Files
|
||||
- `poetry run pytest tests/path/to/test_file.py -v` - Run specific test file
|
||||
- `poetry run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
|
||||
- `uv run pytest tests/path/to/test_file.py -v` - Run specific test file
|
||||
- `uv run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
|
||||
|
||||
### Running Scripts
|
||||
- `poetry run python script.py` - Run Python scripts (use for non-test files)
|
||||
- `uv run python script.py` - Run Python scripts (use for non-test files)
|
||||
|
||||
### GitHub Issue & PR Templates
|
||||
When contributing to the project, use the appropriate templates:
|
||||
|
|
|
|||
|
|
@ -122,9 +122,17 @@ Run all unit tests (uses parallel execution for speed):
|
|||
make test-unit
|
||||
```
|
||||
|
||||
If you're running broader test suites, proxy tests, or anything that touches PostgreSQL-backed fixtures/plugins, install the full local test environment first:
|
||||
|
||||
```bash
|
||||
make install-test-deps
|
||||
```
|
||||
|
||||
This syncs the locked test environment used across the repo, including `psycopg` v3 plus `psycopg-binary` (used by `pytest-postgresql`), `psycopg2-binary` (used by some proxy E2E tests), and a generated Prisma client for DB-backed proxy tests, so pytest startup matches CI without manual package installs.
|
||||
|
||||
Run specific test files:
|
||||
```bash
|
||||
poetry run pytest tests/test_litellm/test_your_file.py -v
|
||||
uv run pytest tests/test_litellm/test_your_file.py -v
|
||||
```
|
||||
|
||||
### Running Linting and Formatting Checks
|
||||
|
|
@ -172,7 +180,7 @@ Run `make help` to see all available commands:
|
|||
make help # Show all available commands
|
||||
make install-dev # Install development dependencies
|
||||
make install-proxy-dev # Install proxy development dependencies
|
||||
make install-test-deps # Install test dependencies (for running tests)
|
||||
make install-test-deps # Install the full local test environment
|
||||
make format # Apply Black code formatting
|
||||
make format-check # Check Black formatting (matches CI)
|
||||
make lint # Run all linting checks
|
||||
|
|
@ -234,7 +242,7 @@ To run the proxy server locally:
|
|||
make install-proxy-dev
|
||||
|
||||
# Start the proxy server
|
||||
poetry run litellm --config your_config.yaml
|
||||
uv run litellm --config your_config.yaml
|
||||
```
|
||||
|
||||
### Docker Development
|
||||
|
|
@ -319,4 +327,4 @@ Looking for ideas? Check out:
|
|||
- 🧪 Test coverage improvements
|
||||
- 🔌 New LLM provider integrations
|
||||
|
||||
Thank you for contributing to LiteLLM! 🚀
|
||||
Thank you for contributing to LiteLLM! 🚀
|
||||
|
|
|
|||
|
|
@ -22,11 +22,11 @@ This file provides guidance to Gemini when working with code in this repository.
|
|||
- `make lint-mypy` - Run MyPy type checking only
|
||||
|
||||
### Single Test Files
|
||||
- `poetry run pytest tests/path/to/test_file.py -v` - Run specific test file
|
||||
- `poetry run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
|
||||
- `uv run pytest tests/path/to/test_file.py -v` - Run specific test file
|
||||
- `uv run pytest tests/path/to/test_file.py::test_function -v` - Run specific test
|
||||
|
||||
### Running Scripts
|
||||
- `poetry run python script.py` - Run Python scripts (use for non-test files)
|
||||
- `uv run python script.py` - Run Python scripts (use for non-test files)
|
||||
|
||||
### GitHub Issue & PR Templates
|
||||
When contributing to the project, use the appropriate templates:
|
||||
|
|
@ -105,4 +105,4 @@ LiteLLM is a unified interface for 100+ LLM providers with two main components:
|
|||
### Enterprise Features
|
||||
- Enterprise-specific code in `enterprise/` directory
|
||||
- Optional features enabled via environment variables
|
||||
- Separate licensing and authentication for enterprise features
|
||||
- Separate licensing and authentication for enterprise features
|
||||
|
|
|
|||
11
README.md
11
README.md
|
|
@ -46,7 +46,7 @@
|
|||
### Python SDK
|
||||
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -68,7 +68,7 @@ response = completion(model="anthropic/claude-sonnet-4-20250514", messages=[{"ro
|
|||
[**Getting Started - E2E Tutorial**](https://docs.litellm.ai/docs/proxy/docker_quick_start) - Setup virtual keys, make your first request
|
||||
|
||||
```shell
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
litellm --model gpt-4o
|
||||
```
|
||||
|
||||
|
|
@ -390,8 +390,8 @@ Support for more providers. Missing a provider or LLM Platform, raise a [feature
|
|||
### Backend
|
||||
1. (In root) create virtual environment `python -m venv .venv`
|
||||
2. Activate virtual environment `source .venv/bin/activate`
|
||||
3. Install dependencies `pip install -e ".[all]"`
|
||||
4. `pip install prisma`
|
||||
3. Install dependencies `uv sync --all-extras --group proxy-dev`
|
||||
4. `uv run prisma generate`
|
||||
5. `prisma generate`
|
||||
6. Start proxy backend `python litellm/proxy/proxy_cli.py`
|
||||
|
||||
|
|
@ -419,7 +419,7 @@ We welcome contributions to LiteLLM! Whether you're fixing bugs, adding features
|
|||
|
||||
## Quick Start for Contributors
|
||||
|
||||
This requires poetry to be installed.
|
||||
This requires uv to be installed.
|
||||
|
||||
```bash
|
||||
git clone https://github.com/BerriAI/litellm.git
|
||||
|
|
@ -473,4 +473,3 @@ All these checks must pass before your PR can be merged.
|
|||
<a href="https://github.com/BerriAI/litellm/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=BerriAI/litellm" />
|
||||
</a>
|
||||
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ if __name__ == "__main__":
|
|||
|
||||
1. Install dependencies:
|
||||
```bash
|
||||
pip install fastapi uvicorn
|
||||
uv add fastapi uvicorn
|
||||
```
|
||||
|
||||
2. Save the code above to `prompt_server.py`
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import TabItem from '@theme/TabItem';
|
|||
|
||||
Install redis
|
||||
```shell
|
||||
pip install redis
|
||||
uv add redis
|
||||
```
|
||||
|
||||
For the hosted version you can setup your own Redis DB here: https://redis.io/try-free/
|
||||
|
|
@ -55,7 +55,7 @@ response2 = completion(
|
|||
For GCP Memorystore Redis with IAM authentication:
|
||||
|
||||
```shell
|
||||
pip install google-cloud-iam
|
||||
uv add google-cloud-iam
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -150,7 +150,7 @@ response2 = completion(
|
|||
|
||||
Install boto3
|
||||
```shell
|
||||
pip install boto3
|
||||
uv add boto3
|
||||
```
|
||||
|
||||
Set AWS environment variables
|
||||
|
|
@ -187,7 +187,7 @@ response2 = completion(
|
|||
|
||||
Install azure-storage-blob and azure-identity
|
||||
```shell
|
||||
pip install azure-storage-blob azure-identity
|
||||
uv add azure-storage-blob azure-identity
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -219,7 +219,7 @@ response2 = completion(
|
|||
|
||||
Install redisvl client
|
||||
```shell
|
||||
pip install redisvl==0.4.1
|
||||
uv add redisvl==0.4.1
|
||||
```
|
||||
|
||||
For the hosted version you can setup your own Redis DB here: https://redis.io/try-free/
|
||||
|
|
@ -366,7 +366,7 @@ response2 = completion(
|
|||
Install the disk caching extra:
|
||||
|
||||
```shell
|
||||
pip install "litellm[caching]"
|
||||
uv add "litellm[caching]"
|
||||
```
|
||||
|
||||
Then you can use the disk cache as follows.
|
||||
|
|
|
|||
|
|
@ -401,7 +401,7 @@ response = litellm.completion(
|
|||
|
||||
3. Ensure you're using a recent version of LiteLLM:
|
||||
```bash
|
||||
pip install --upgrade litellm
|
||||
uv add --upgrade-package litellm litellm
|
||||
```
|
||||
|
||||
### Unexpected Dummy Tool Results
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ general_settings:
|
|||
Start the proxy on port 4000:
|
||||
|
||||
```bash
|
||||
poetry run litellm --config config.yaml --port 4000
|
||||
uv run litellm --config config.yaml --port 4000
|
||||
```
|
||||
|
||||
The UI comes pre-built in the repo. Access it at `http://localhost:4000/ui`
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ If you want to use the non-hosted version, [go here](https://docs.litellm.ai/doc
|
|||
|
||||
|
||||
```
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
<QueryParamReader/>
|
||||
|
|
@ -41,7 +41,7 @@ git clone https://github.com/BerriAI/litellm.git
|
|||
Step 2: Install dev dependencies
|
||||
|
||||
```shell
|
||||
poetry install --with dev --extras proxy
|
||||
uv sync --group dev --extra proxy
|
||||
```
|
||||
|
||||
### 2. Adding tests
|
||||
|
|
|
|||
|
|
@ -26,13 +26,13 @@ import Image from '@theme/IdealImage';
|
|||
## Installation
|
||||
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
To run the full Proxy Server (LLM Gateway):
|
||||
|
||||
```shell
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
---
|
||||
|
|
@ -336,7 +336,7 @@ The proxy is a self-hosted OpenAI-compatible gateway. Any client that works with
|
|||
#### Step 1 — Start the proxy
|
||||
|
||||
<Tabs>
|
||||
<TabItem value="pip" label="pip">
|
||||
<TabItem value="cli" label="LiteLLM CLI">
|
||||
|
||||
```shell
|
||||
litellm --model huggingface/bigcode/starcoder
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ Letta allows you to build LLM agents that can:
|
|||
## Prerequisites
|
||||
|
||||
```bash
|
||||
pip install letta litellm
|
||||
uv add letta litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
@ -910,7 +910,7 @@ for model in models:
|
|||
```
|
||||
|
||||
### Common SDK Issues
|
||||
- **Import errors**: Ensure `pip install litellm letta` is run
|
||||
- **Import errors**: Ensure `uv add litellm letta` is run
|
||||
- **Model format**: Use `provider/model` format (e.g., `openai/gpt-4`)
|
||||
- **API key format**: Different providers have different key formats
|
||||
- **Rate limits**: Implement exponential backoff for retries
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import TabItem from '@theme/TabItem';
|
|||
|
||||
## Pre-Requisites
|
||||
```shell
|
||||
!pip install litellm langchain
|
||||
!uv add litellm langchain
|
||||
```
|
||||
## Quick Start
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ If you need a Docker or database-first setup, use the [Docker + Database tutoria
|
|||
## 1. Install The Gateway
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
## 2. Set One Provider Key
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Use this path if you are integrating LiteLLM directly into application code.
|
|||
## 1. Install LiteLLM
|
||||
|
||||
```bash
|
||||
pip install litellm==1.82.6
|
||||
uv add 'litellm==1.82.6'
|
||||
```
|
||||
|
||||
## 2. Set Provider Credentials
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ model_list:
|
|||
api_base: https://exampleopenaiendpoint-production.up.railway.app/
|
||||
```
|
||||
|
||||
2. `pip install locust`
|
||||
2. `uv add locust`
|
||||
|
||||
3. Create a file called `locustfile.py` on your local machine. Copy the contents from the litellm load test located [here](https://github.com/BerriAI/litellm/blob/main/.github/workflows/locustfile.py)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ litellm_settings:
|
|||
callbacks: ["prometheus"] # Enterprise LiteLLM Only - use prometheus to get metrics on your load test
|
||||
```
|
||||
|
||||
2. `pip install locust`
|
||||
2. `uv add locust`
|
||||
|
||||
3. Create a file called `locustfile.py` on your local machine. Copy the contents from the litellm load test located [here](https://github.com/BerriAI/litellm/blob/main/.github/workflows/locustfile.py)
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ litellm_settings:
|
|||
callbacks: ["prometheus"] # Enterprise LiteLLM Only - use prometheus to get metrics on your load test
|
||||
```
|
||||
|
||||
2. `pip install locust`
|
||||
2. `uv add locust`
|
||||
|
||||
3. Create a file called `locustfile.py` on your local machine. Copy the contents from the litellm load test located [here](https://github.com/BerriAI/litellm/blob/main/.github/workflows/locustfile.py)
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ SigV4-authenticated MCP servers skip the standard health check on proxy startup.
|
|||
Install the `botocore` package:
|
||||
|
||||
```bash
|
||||
pip install botocore
|
||||
uv add botocore
|
||||
```
|
||||
|
||||
`botocore` is used for SigV4 credential handling and is required when using `aws_sigv4` auth.
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ sequenceDiagram
|
|||
Use [BerriAI/mock-oauth2-mcp-server](https://github.com/BerriAI/mock-oauth2-mcp-server) to test locally:
|
||||
|
||||
```bash title="Terminal 1 - Start mock server" showLineNumbers
|
||||
pip install fastapi uvicorn
|
||||
uv add fastapi uvicorn
|
||||
python mock_oauth2_mcp_server.py # starts on :8765
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';
|
|||
## Quick Start
|
||||
|
||||
```python
|
||||
# pip install braintrust
|
||||
# uv add braintrust
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ litellm.callbacks = ["lago"] # logs cost + usage of successful calls to lago
|
|||
<TabItem value="sdk" label="SDK">
|
||||
|
||||
```python
|
||||
# pip install lago
|
||||
# uv add lago
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -26,9 +26,9 @@ For Langfuse v3, we recommend using the [Langfuse OTEL](./langfuse_otel_integrat
|
|||
## Usage with LiteLLM Python SDK
|
||||
|
||||
### Pre-Requisites
|
||||
Ensure you have run `pip install langfuse` for this integration
|
||||
Ensure you have run `uv add langfuse` for this integration
|
||||
```shell
|
||||
pip install langfuse==2.59.7 litellm
|
||||
uv add langfuse==2.59.7 litellm
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
|
@ -44,7 +44,7 @@ litellm.success_callback = ["langfuse"]
|
|||
litellm.failure_callback = ["langfuse"] # logs errors to langfuse
|
||||
```
|
||||
```python
|
||||
# pip install langfuse
|
||||
# uv add langfuse
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
@ -335,7 +335,7 @@ Be aware that if you are continuing an existing trace, and you set `update_trace
|
|||
|
||||
## Troubleshooting & Errors
|
||||
### Data not getting logged to Langfuse ?
|
||||
- Ensure you're on the latest version of langfuse `pip install langfuse -U`. The latest version allows litellm to log JSON input/outputs to langfuse
|
||||
- Ensure you're on the latest version of langfuse `uv add langfuse -U`. The latest version allows litellm to log JSON input/outputs to langfuse
|
||||
- Follow [this checklist](https://langfuse.com/faq/all/missing-traces) if you don't see any traces in langfuse.
|
||||
|
||||
## Support & Talk to Founders
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ The Langfuse OpenTelemetry integration allows you to send LiteLLM traces and obs
|
|||
2. **API Keys**: Get your public and secret keys from your Langfuse project settings
|
||||
3. **Dependencies**: Install required packages:
|
||||
```bash
|
||||
pip install litellm opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
uv add litellm opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ join our [discord](https://discord.gg/wuPM9dRgDw)
|
|||
|
||||
## Pre-Requisites
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ Send all your LLM requests and responses to Levo for monitoring and analysis usi
|
|||
**1. Install OpenTelemetry dependencies:**
|
||||
|
||||
```bash
|
||||
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc
|
||||
uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc
|
||||
```
|
||||
|
||||
**2. Enable Levo callback in your LiteLLM config:**
|
||||
|
|
@ -133,7 +133,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
|
|||
```
|
||||
|
||||
4. **Check for initialization errors**: Look for errors in LiteLLM startup logs. Common issues:
|
||||
- Missing OpenTelemetry packages: Install with `pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc`
|
||||
- Missing OpenTelemetry packages: Install with `uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc`
|
||||
- Missing required environment variables: All four required variables must be set
|
||||
- Invalid collector URL: Ensure the URL is correct and reachable
|
||||
|
||||
|
|
@ -150,7 +150,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
|
|||
- Solution: Set the `LEVOAI_COLLECTOR_URL` environment variable with your collector endpoint URL from Levo support.
|
||||
|
||||
**Error: "No module named 'opentelemetry'"**
|
||||
- Solution: Install OpenTelemetry packages: `pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc`
|
||||
- Solution: Install OpenTelemetry packages: `uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-exporter-otlp-proto-grpc`
|
||||
|
||||
## Additional Resources
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import Image from '@theme/IdealImage';
|
|||
Ensure you have the `literalai` package installed:
|
||||
|
||||
```shell
|
||||
pip install literalai litellm
|
||||
uv add literalai litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ join our [discord](https://discord.gg/wuPM9dRgDw)
|
|||
Ensure you have installed the following packages to use this integration
|
||||
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
|
||||
pip install opentelemetry-api==1.25.0
|
||||
pip install opentelemetry-sdk==1.25.0
|
||||
pip install opentelemetry-exporter-otlp==1.25.0
|
||||
uv add opentelemetry-api==1.25.0
|
||||
uv add opentelemetry-sdk==1.25.0
|
||||
uv add opentelemetry-exporter-otlp==1.25.0
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
@ -33,7 +33,7 @@ litellm.callbacks = ["logfire"]
|
|||
```
|
||||
|
||||
```python
|
||||
# pip install logfire
|
||||
# uv add logfire
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ You can reach out to us anytime by [email](mailto:hello@lunary.ai) or directly [
|
|||
### Pre-Requisites
|
||||
|
||||
```shell
|
||||
pip install litellm lunary
|
||||
uv add litellm lunary
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
|
@ -124,7 +124,7 @@ my_chain("Chain input")
|
|||
### Step1: Install dependencies and set your environment variables
|
||||
Install the dependencies
|
||||
```shell
|
||||
pip install litellm lunary
|
||||
uv add litellm lunary
|
||||
```
|
||||
|
||||
Get you Lunary public key from from https://app.lunary.ai/settings
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ MLflow’s integration with LiteLLM supports advanced observability compatible w
|
|||
Install MLflow:
|
||||
|
||||
```shell
|
||||
pip install "litellm[mlflow]"
|
||||
uv add "litellm[mlflow]"
|
||||
```
|
||||
|
||||
To enable MLflow auto tracing for LiteLLM:
|
||||
|
|
@ -167,7 +167,7 @@ This approach generates a unified trace, combining your custom Python code with
|
|||
For using `mlflow` on LiteLLM Proxy Server, you need to install the `mlflow` package on your docker container.
|
||||
|
||||
```shell
|
||||
pip install "mlflow>=3.1.4"
|
||||
uv add "mlflow>=3.1.4"
|
||||
```
|
||||
|
||||
### Configuration
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ litellm.callbacks = ["openmeter"] # logs cost + usage of successful calls to ope
|
|||
<TabItem value="sdk" label="SDK">
|
||||
|
||||
```python
|
||||
# pip install openmeter
|
||||
# uv add openmeter
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ USE_OTEL_LITELLM_REQUEST_SPAN=true
|
|||
Install the OpenTelemetry SDK:
|
||||
|
||||
```
|
||||
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
```
|
||||
|
||||
Set the environment variables (different providers may require different variables):
|
||||
|
|
@ -63,7 +63,7 @@ OTEL_EXPORTER_OTLP_PROTOCOL=grpc
|
|||
OTEL_EXPORTER_OTLP_HEADERS="api-key=key,other-config-value=value"
|
||||
```
|
||||
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
</TabItem>
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ OTEL_ENDPOINT="https://api.lmnr.ai:8443"
|
|||
OTEL_HEADERS="authorization=Bearer <project-api-key>"
|
||||
```
|
||||
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
</TabItem>
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ Use just 2 lines of code, to instantly log your responses **across all providers
|
|||
You can also use the instrumentor option instead of the callback, which you can find [here](https://docs.arize.com/phoenix/tracing/integrations-tracing/litellm).
|
||||
|
||||
```bash
|
||||
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp litellm[proxy]
|
||||
uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp litellm[proxy]
|
||||
```
|
||||
```python
|
||||
litellm.callbacks = ["arize_phoenix"]
|
||||
|
|
@ -73,7 +73,7 @@ environment_variables:
|
|||
PHOENIX_COLLECTOR_HTTP_ENDPOINT: "https://app.phoenix.arize.com/s/<space-name>/v1/traces" # OPTIONAL - For setting the HTTP endpoint
|
||||
```
|
||||
|
||||
> Note: If you set the gRPC endpoint, install `grpcio` via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: If you set the gRPC endpoint, install `grpcio` via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
2. Start the proxy
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Looking for Qualifire Guardrails? Check out the [Qualifire Guardrails Integratio
|
|||
2. Get your API key and webhook URL from the Qualifire dashboard
|
||||
|
||||
```bash
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ See the raw request/response sent by LiteLLM in your logging provider (OTEL/Lang
|
|||
<TabItem value="sdk" label="SDK">
|
||||
|
||||
```python
|
||||
# pip install langfuse
|
||||
# uv add langfuse
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ litellm.callbacks = [customHandler]
|
|||
3. Test it!
|
||||
|
||||
```python
|
||||
# pip install langfuse
|
||||
# uv add langfuse
|
||||
|
||||
import os
|
||||
import litellm
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Instrumenting LiteLLM in your AI applications with telemetry ensures full observ
|
|||
- A [SigNoz Cloud account](https://signoz.io/teams/) with an active ingestion key
|
||||
- Internet access to send telemetry data to SigNoz Cloud
|
||||
- [LiteLLM](https://www.litellm.ai/) SDK or Proxy integration
|
||||
- For Python: `pip` installed for managing Python packages and _(optional but recommended)_ a Python virtual environment to isolate dependencies
|
||||
- For Python: `uv` installed for managing Python packages and _(optional but recommended)_ a Python virtual environment to isolate dependencies
|
||||
|
||||
## Monitoring LiteLLM
|
||||
|
||||
|
|
@ -37,7 +37,7 @@ No-code auto-instrumentation is recommended for quick setup with minimal code ch
|
|||
**Step 1:** Install the necessary packages in your Python environment.
|
||||
|
||||
```bash
|
||||
pip install \
|
||||
uv add \
|
||||
opentelemetry-api \
|
||||
opentelemetry-distro \
|
||||
opentelemetry-exporter-otlp \
|
||||
|
|
@ -99,7 +99,7 @@ OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=openai \
|
|||
opentelemetry-instrument <your_run_command>
|
||||
```
|
||||
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
> 📌 Note: We're using `OTEL_PYTHON_DISABLED_INSTRUMENTATIONS=openai` in the run command to disable the OpenAI instrumentor for tracing. This avoids conflicts with LiteLLM's native telemetry/instrumentation, ensuring that telemetry is captured exclusively through LiteLLM's built-in instrumentation.
|
||||
|
||||
|
|
@ -120,7 +120,7 @@ Code-based instrumentation gives you fine-grained control over your telemetry co
|
|||
**Step 1:** Install the necessary packages in your Python environment.
|
||||
|
||||
```bash
|
||||
pip install \
|
||||
uv add \
|
||||
opentelemetry-api \
|
||||
opentelemetry-sdk \
|
||||
opentelemetry-exporter-otlp \
|
||||
|
|
@ -338,7 +338,7 @@ You can also check out our custom LiteLLM SDK dashboard [here](https://signoz.i
|
|||
**Step 1:** Install the necessary packages in your Python environment.
|
||||
|
||||
```bash
|
||||
pip install opentelemetry-api \
|
||||
uv add opentelemetry-api \
|
||||
opentelemetry-sdk \
|
||||
opentelemetry-exporter-otlp \
|
||||
'litellm[proxy]'
|
||||
|
|
@ -364,7 +364,7 @@ export OTEL_METRICS_EXPORTER="otlp"
|
|||
export OTEL_LOGS_EXPORTER="otlp"
|
||||
```
|
||||
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
- Set the `<region>` to match your SigNoz Cloud [region](https://signoz.io/docs/ingestion/signoz-cloud/overview/#endpoint)
|
||||
- Replace `<your_ingestion_key>` with your SigNoz [ingestion key](https://signoz.io/docs/ingestion/signoz-cloud/keys/)
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ join our [discord](https://discord.gg/wuPM9dRgDw)
|
|||
|
||||
### Step 1
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
### Step 2
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ join our [discord](https://discord.gg/wuPM9dRgDw)
|
|||
For more details, see the [HTTP Logs & Metrics Source](https://www.sumologic.com/help/docs/send-data/hosted-collectors/http-source/logs-metrics/) documentation.
|
||||
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ join our [discord](https://discord.gg/wuPM9dRgDw)
|
|||
:::
|
||||
|
||||
## Pre-Requisites
|
||||
Ensure you have run `pip install wandb` for this integration
|
||||
Ensure you have run `uv add wandb` for this integration
|
||||
```shell
|
||||
pip install wandb litellm
|
||||
uv add wandb litellm
|
||||
```
|
||||
|
||||
## Quick Start
|
||||
|
|
@ -33,7 +33,7 @@ Use just 2 lines of code, to instantly log your responses **across all providers
|
|||
litellm.success_callback = ["wandb"]
|
||||
```
|
||||
```python
|
||||
# pip install wandb
|
||||
# uv add wandb
|
||||
import litellm
|
||||
import os
|
||||
|
||||
|
|
|
|||
|
|
@ -566,7 +566,7 @@ You can use the [LangChain AWS SDK](https://python.langchain.com/docs/integratio
|
|||
**1. Install LangChain AWS**:
|
||||
|
||||
```bash showLineNumbers
|
||||
pip install langchain-aws
|
||||
uv add langchain-aws
|
||||
```
|
||||
|
||||
**2. Setup LiteLLM Proxy**:
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
```bash
|
||||
# Install
|
||||
pip install harbor
|
||||
uv add harbor
|
||||
|
||||
# Run a benchmark with any LiteLLM-supported model
|
||||
harbor run --dataset terminal-bench@2.0 \
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ The [OpenAI Agents SDK](https://github.com/openai/openai-agents-python) is a lig
|
|||
### 1. Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install "openai-agents[litellm]"
|
||||
uv add "openai-agents[litellm]"
|
||||
```
|
||||
|
||||
### 2. Add Model to Config
|
||||
|
|
|
|||
|
|
@ -1143,7 +1143,7 @@ In production, [Router connects to a Redis Cache](#redis-queue) to track usage a
|
|||
#### Quick Start
|
||||
|
||||
```python
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ response = completion(
|
|||
See all litellm.completion supported params [here](../completion/input.md#translated-openai-params)
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ ALL Bedrock models (Anthropic, Meta, Deepseek, Mistral, Amazon, etc.) are Suppor
|
|||
|
||||
LiteLLM requires `boto3` to be installed on your system for Bedrock requests
|
||||
```shell
|
||||
pip install boto3>=1.28.57
|
||||
uv add boto3>=1.28.57
|
||||
```
|
||||
|
||||
:::info
|
||||
|
|
|
|||
|
|
@ -319,7 +319,7 @@ Complete working examples are available in the LiteLLM repository:
|
|||
## Requirements
|
||||
|
||||
```bash
|
||||
pip install litellm websockets pyaudio
|
||||
uv add litellm websockets pyaudio
|
||||
```
|
||||
|
||||
## AWS Configuration
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ If you wish to use custom formatting, please let us know via either [help@bytez.
|
|||
See all litellm.completion supported params [here](https://docs.litellm.ai/docs/completion/input)
|
||||
|
||||
```py
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
@ -160,7 +160,7 @@ Any kwarg supported by huggingface we also support! (Provided the model supports
|
|||
Example `repetition_penalty`
|
||||
|
||||
```py
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ Anthropic, OpenAI, Qwen, xAI, Gemini and most of Open soured LLMs are Supported
|
|||
## Pre-Requisites
|
||||
|
||||
```bash
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
## Required Environment Variables
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ If no credentials are provided, LiteLLM will use the Databricks SDK for automati
|
|||
from litellm import completion
|
||||
|
||||
# No environment variables needed - uses Databricks SDK unified auth
|
||||
# Requires: pip install databricks-sdk
|
||||
# Requires: uv add databricks-sdk
|
||||
response = completion(
|
||||
model="databricks/databricks-dbrx-instruct",
|
||||
messages=[{"role": "user", "content": "Hello!"}],
|
||||
|
|
@ -220,7 +220,7 @@ response = completion(
|
|||
See all litellm.completion supported params [here](../completion/input.md#translated-openai-params)
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
@ -457,7 +457,7 @@ For embedding models, databricks lets you pass in an additional param 'instructi
|
|||
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import embedding
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
|
|||
<TabItem value="python" label="python">
|
||||
|
||||
```python
|
||||
# pip install openai
|
||||
# uv add openai
|
||||
from openai import OpenAI
|
||||
|
||||
client = OpenAI(
|
||||
|
|
|
|||
|
|
@ -187,7 +187,7 @@ Before using LiteLLM with LangGraph, you need a running LangGraph server.
|
|||
### 1. Install the LangGraph CLI
|
||||
|
||||
```bash
|
||||
pip install "langgraph-cli[inmem]"
|
||||
uv add "langgraph-cli[inmem]"
|
||||
```
|
||||
|
||||
### 2. Create a new LangGraph project
|
||||
|
|
@ -200,7 +200,7 @@ cd my-agent
|
|||
### 3. Install dependencies
|
||||
|
||||
```bash
|
||||
pip install -e .
|
||||
uv add -e .
|
||||
```
|
||||
|
||||
### 4. Set your API key
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ Use an OCI SDK `Signer` object for authentication. This method:
|
|||
|
||||
To use this method, install the OCI SDK:
|
||||
```bash
|
||||
pip install oci
|
||||
uv add oci
|
||||
```
|
||||
|
||||
This method is an alternative when using the LiteLLM SDK on Oracle Cloud Infrastructure (instances or Oracle Kubernetes Engine).
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ for chunk in response:
|
|||
## Example usage - Streaming + Acompletion
|
||||
Ensure you have async_generator installed for using ollama acompletion with streaming
|
||||
```shell
|
||||
pip install async_generator
|
||||
uv add async_generator
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Petals: https://github.com/bigscience-workshop/petals
|
|||
## Pre-Requisites
|
||||
Ensure you have `petals` installed
|
||||
```shell
|
||||
pip install git+https://github.com/bigscience-workshop/petals
|
||||
uv add git+https://github.com/bigscience-workshop/petals
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ model_list:
|
|||
See all litellm.completion supported params [here](https://docs.litellm.ai/docs/completion/input)
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
@ -219,7 +219,7 @@ Send params [not supported by `litellm.completion()`](https://docs.litellm.ai/do
|
|||
Example `adapter_id`, `adapter_source` are Predibase specific param - [See List](https://github.com/BerriAI/litellm/blob/8a35354dd6dbf4c2fcefcd6e877b980fcbd68c58/litellm/llms/predibase.py#L54)
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ LiteLLM requires Pydantic AI agents to follow the [A2A (Agent-to-Agent) protocol
|
|||
#### Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install pydantic-ai fasta2a uvicorn
|
||||
uv add pydantic-ai fasta2a uvicorn
|
||||
```
|
||||
|
||||
#### Create Agent
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ Model Name | Function Call
|
|||
See all litellm.completion supported params [here](https://docs.litellm.ai/docs/completion/input)
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
@ -264,7 +264,7 @@ Send params [not supported by `litellm.completion()`](https://docs.litellm.ai/do
|
|||
Example `seed`, `min_tokens` are Replicate specific param
|
||||
|
||||
```python
|
||||
# !pip install litellm
|
||||
# !uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ The resource group is typically configured separately in your AI Core deployment
|
|||
### Step 1: Install LiteLLM
|
||||
|
||||
```bash
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
### Step 2: Set Your Credentials
|
||||
|
|
|
|||
|
|
@ -1216,7 +1216,7 @@ curl http://0.0.0.0:4000/chat/completions \
|
|||
</Tabs>
|
||||
|
||||
## Pre-requisites
|
||||
* `pip install google-cloud-aiplatform` (pre-installed on proxy docker image)
|
||||
* `uv add google-cloud-aiplatform` (pre-installed on proxy docker image)
|
||||
* Authentication:
|
||||
* run `gcloud auth application-default login` See [Google Cloud Docs](https://cloud.google.com/docs/authentication/external/set-up-adc)
|
||||
* Alternatively you can set `GOOGLE_APPLICATION_CREDENTIALS`
|
||||
|
|
|
|||
|
|
@ -517,11 +517,11 @@ curl -X POST http://0.0.0.0:4000/chat/completions \
|
|||
</Tabs>
|
||||
|
||||
|
||||
## (Deprecated) for `vllm pip package`
|
||||
## (Deprecated) for packaged `vllm` installs
|
||||
### Using - `litellm.completion`
|
||||
|
||||
```
|
||||
pip install litellm vllm
|
||||
uv add litellm vllm
|
||||
```
|
||||
```python
|
||||
import litellm
|
||||
|
|
@ -616,4 +616,3 @@ test_vllm_custom_model()
|
|||
```
|
||||
|
||||
[Implementation Code](https://github.com/BerriAI/litellm/blob/6b3cb1898382f2e4e80fd372308ea232868c78d1/litellm/utils.py#L1414)
|
||||
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ For GCP Memorystore Redis with IAM authentication, install the required dependen
|
|||
:::
|
||||
|
||||
```shell
|
||||
pip install google-cloud-iam
|
||||
uv add google-cloud-iam
|
||||
```
|
||||
|
||||
<Tabs>
|
||||
|
|
|
|||
|
|
@ -32,10 +32,10 @@ docker pull docker.litellm.ai/berriai/litellm:main-latest
|
|||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="pip" label="LiteLLM CLI (pip package)">
|
||||
<TabItem value="cli" label="LiteLLM CLI">
|
||||
|
||||
```shell
|
||||
$ pip install 'litellm[proxy]'
|
||||
$ uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
|
@ -155,33 +155,32 @@ EXPOSE 4000/tcp
|
|||
CMD ["--port", "4000", "--config", "config.yaml", "--detailed_debug"]
|
||||
```
|
||||
|
||||
### Build from litellm `pip` package
|
||||
### Build from published LiteLLM packages
|
||||
|
||||
Follow these instructions to build a docker container from the litellm pip package. If your company has a strict requirement around security / building images you can follow these steps.
|
||||
Follow these instructions to build a Docker container from published LiteLLM packages. If your company has a strict requirement around security or image provenance, you can follow these steps.
|
||||
|
||||
**Note:** You'll need to copy the `schema.prisma` file from the [litellm repository](https://github.com/BerriAI/litellm/blob/main/schema.prisma) to your build directory alongside the Dockerfile and requirements.txt.
|
||||
**Note:** Copy the `schema.prisma` file from the [LiteLLM repository](https://github.com/BerriAI/litellm/blob/main/schema.prisma) into your build directory alongside this Dockerfile.
|
||||
|
||||
Dockerfile
|
||||
|
||||
```shell
|
||||
FROM cgr.dev/chainguard/python:latest-dev
|
||||
ARG UV_IMAGE=ghcr.io/astral-sh/uv:0.10.9
|
||||
|
||||
USER root
|
||||
WORKDIR /app
|
||||
|
||||
ENV HOME=/home/litellm
|
||||
ENV PATH="${HOME}/venv/bin:$PATH"
|
||||
ENV UV_TOOL_BIN_DIR=/usr/local/bin
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk update && \
|
||||
apk add --no-cache gcc python3-dev openssl openssl-dev
|
||||
|
||||
RUN python -m venv ${HOME}/venv
|
||||
RUN ${HOME}/venv/bin/pip install --no-cache-dir --upgrade pip
|
||||
COPY --from=$UV_IMAGE /uv /usr/local/bin/uv
|
||||
COPY --from=$UV_IMAGE /uvx /usr/local/bin/uvx
|
||||
|
||||
COPY requirements.txt .
|
||||
RUN --mount=type=cache,target=${HOME}/.cache/pip \
|
||||
${HOME}/venv/bin/pip install -r requirements.txt
|
||||
RUN uv tool install 'litellm[proxy,proxy-runtime,extra_proxy]==1.57.3' \
|
||||
--python python
|
||||
|
||||
# Copy Prisma schema file
|
||||
COPY schema.prisma .
|
||||
|
|
@ -196,22 +195,12 @@ CMD ["--port", "4000"]
|
|||
```
|
||||
|
||||
|
||||
Example `requirements.txt`
|
||||
|
||||
```shell
|
||||
litellm[proxy]==1.57.3 # Specify the litellm version you want to use
|
||||
litellm-enterprise
|
||||
prometheus_client
|
||||
langfuse
|
||||
prisma
|
||||
```
|
||||
|
||||
Build the docker image
|
||||
|
||||
```shell
|
||||
docker build \
|
||||
-f Dockerfile.build_from_pip \
|
||||
-t litellm-proxy-with-pip-5 .
|
||||
-f Dockerfile \
|
||||
-t litellm-proxy-from-package-5 .
|
||||
```
|
||||
|
||||
Run the docker image
|
||||
|
|
@ -222,7 +211,7 @@ docker run \
|
|||
-e OPENAI_API_KEY="sk-1222" \
|
||||
-e DATABASE_URL="postgresql://xxxxxxxxx \
|
||||
-p 4000:4000 \
|
||||
litellm-proxy-with-pip-5 \
|
||||
litellm-proxy-from-package-5 \
|
||||
--config /app/config.yaml --detailed_debug
|
||||
```
|
||||
|
||||
|
|
@ -724,7 +713,7 @@ RUN chmod +x ./docker/entrypoint.sh
|
|||
EXPOSE 4000/tcp
|
||||
|
||||
# 👉 Key Change: Install hypercorn
|
||||
RUN pip install hypercorn
|
||||
RUN uv add hypercorn
|
||||
|
||||
# Override the CMD instruction with your desired command and arguments
|
||||
# WARNING: FOR PROD DO NOT USE `--detailed_debug` it slows down response times, instead use the following CMD
|
||||
|
|
|
|||
|
|
@ -70,15 +70,15 @@ curl -X POST 'http://0.0.0.0:4000/chat/completions' \
|
|||
}'
|
||||
```
|
||||
|
||||
:::tip Already have pip installed?
|
||||
You can skip the curl install and run `litellm --setup` directly after `pip install 'litellm[proxy]'`.
|
||||
:::tip Already have uv installed?
|
||||
You can skip the curl install and run `litellm --setup` directly after `uv tool install 'litellm[proxy]'`.
|
||||
:::
|
||||
|
||||
---
|
||||
|
||||
## Pre-Requisites
|
||||
|
||||
Choose your install method. **Docker Compose** users complete their full setup inside the tab and are done. **Docker** and **pip** users continue with the steps below the tabs.
|
||||
Choose your install method. **Docker Compose** users complete their full setup inside the tab and are done. **Docker** and **LiteLLM CLI** users continue with the steps below the tabs.
|
||||
|
||||
<Tabs>
|
||||
|
||||
|
|
@ -92,10 +92,10 @@ docker pull docker.litellm.ai/berriai/litellm:main-latest
|
|||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="pip" label="LiteLLM CLI (pip package)">
|
||||
<TabItem value="cli" label="LiteLLM CLI">
|
||||
|
||||
```shell
|
||||
$ pip install 'litellm[proxy]'
|
||||
$ uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
|
@ -269,7 +269,7 @@ Virtual keys let you track spend, set rate limits, and control model access per
|
|||
</Tabs>
|
||||
|
||||
:::note Docker Compose users
|
||||
Your setup is complete — the steps below are for **Docker** and **pip** users only.
|
||||
Your setup is complete — the steps below are for **Docker** and **LiteLLM CLI** users only.
|
||||
:::
|
||||
|
||||
---
|
||||
|
|
@ -336,7 +336,7 @@ docker run \
|
|||
|
||||
</TabItem>
|
||||
|
||||
<TabItem value="pip" label="LiteLLM CLI (pip package)">
|
||||
<TabItem value="cli" label="LiteLLM CLI">
|
||||
|
||||
```shell
|
||||
$ litellm --config /app/config.yaml --detailed_debug
|
||||
|
|
@ -463,7 +463,7 @@ Track spend and control model access via virtual keys for the proxy.
|
|||
Your Postgres container is already running — skip ahead to [Create Key w/ RPM Limit](#create-key-w-rpm-limit) below.
|
||||
:::
|
||||
|
||||
**Docker / pip users** — you need a Postgres database (e.g. [Supabase](https://supabase.com/), [Neon](https://neon.tech/), or self-hosted). Add `general_settings` to your `config.yaml`:
|
||||
**Docker / LiteLLM CLI users** — you need a Postgres database (e.g. [Supabase](https://supabase.com/), [Neon](https://neon.tech/), or self-hosted). Add `general_settings` to your `config.yaml`:
|
||||
|
||||
```yaml
|
||||
model_list:
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Use [Lasso Security](https://www.lasso.security/) to protect your LLM applicatio
|
|||
The Lasso guardrail requires the `ulid-py` package (version 1.1.0 or higher) for generating unique conversation identifiers:
|
||||
|
||||
```shell
|
||||
pip install ulid-py>=1.1.0
|
||||
uv add ulid-py>=1.1.0
|
||||
```
|
||||
|
||||
This package is used to create lexicographically sortable identifiers for tracking conversations and sessions in the Lasso Security platform.
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ We will use the `--config` to set `litellm.success_callback = ["langfuse"]` this
|
|||
**Step 1** Install langfuse
|
||||
|
||||
```shell
|
||||
pip install langfuse>=2.0.0
|
||||
uv add langfuse>=2.0.0
|
||||
```
|
||||
|
||||
**Step 2**: Create a `config.yaml` file and set `litellm_settings`: `success_callback`
|
||||
|
|
@ -982,7 +982,7 @@ OTEL_ENDPOINT="http:/0.0.0.0:4317"
|
|||
OTEL_HEADERS="x-honeycomb-team=<your-api-key>" # Optional
|
||||
```
|
||||
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `pip install "litellm[grpc]"` (or `grpcio`).
|
||||
> Note: OTLP gRPC requires `grpcio`. Install via `uv add "litellm[grpc]"` (or `grpcio`).
|
||||
|
||||
Add `otel` as a callback on your `litellm_config.yaml`
|
||||
|
||||
|
|
@ -1587,7 +1587,7 @@ curl --location 'http://0.0.0.0:4000/chat/completions' \
|
|||
#### Step1: Install dependencies and set your environment variables
|
||||
Install the dependencies
|
||||
```shell
|
||||
pip install litellm lunary
|
||||
uv add litellm lunary
|
||||
```
|
||||
|
||||
Get you Lunary public key from from https://app.lunary.ai/settings
|
||||
|
|
@ -2516,7 +2516,7 @@ If api calls fail (llm/database) you can log those to Sentry:
|
|||
**Step 1** Install Sentry
|
||||
|
||||
```shell
|
||||
pip install --upgrade sentry-sdk
|
||||
uv add --upgrade sentry-sdk
|
||||
```
|
||||
|
||||
**Step 2**: Save your Sentry_DSN and add `litellm_settings`: `failure_callback`
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ LiteLLM Exposes a `/metrics` endpoint for Prometheus to Poll
|
|||
|
||||
## Quick Start
|
||||
|
||||
If you're using the LiteLLM CLI with `litellm --config proxy_config.yaml` then you need to `pip install prometheus_client==0.20.0`. **This is already pre-installed on the litellm Docker image**
|
||||
If you're using the LiteLLM CLI with `litellm --config proxy_config.yaml` then you need to `uv add prometheus_client==0.20.0`. **This is already pre-installed on the litellm Docker image**
|
||||
|
||||
Add this to your proxy config.yaml
|
||||
```yaml
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@ LiteLLM proxy can send continuous CPU profiles to [Grafana Pyroscope](https://gr
|
|||
1. **Install the optional dependency** (required only when enabling Pyroscope):
|
||||
|
||||
```bash
|
||||
pip install pyroscope-io
|
||||
uv add pyroscope-io
|
||||
```
|
||||
|
||||
Or install the proxy extra:
|
||||
|
||||
```bash
|
||||
pip install "litellm[proxy]"
|
||||
uv add "litellm[proxy]"
|
||||
```
|
||||
|
||||
2. **Set environment variables** before starting the proxy:
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ LiteLLM Server (LLM Gateway) manages:
|
|||
* **Load Balancing**: between [Multiple Models](#multiple-models---quick-start) + [Deployments of the same model](#multiple-instances-of-1-model) - LiteLLM proxy can handle 1.5k+ requests/second during load tests.
|
||||
|
||||
```shell
|
||||
$ pip install 'litellm[proxy]'
|
||||
$ uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
## Quick Start - LiteLLM Proxy CLI
|
||||
|
|
|
|||
|
|
@ -881,7 +881,7 @@ Credits [@vividfog](https://github.com/ollama/ollama/issues/305#issuecomment-175
|
|||
<TabItem value="aider" label="Aider">
|
||||
|
||||
```shell
|
||||
$ pip install aider
|
||||
$ uv add aider
|
||||
|
||||
$ aider --openai-api-base http://0.0.0.0:4000 --openai-api-key fake-key
|
||||
```
|
||||
|
|
@ -889,7 +889,7 @@ $ aider --openai-api-base http://0.0.0.0:4000 --openai-api-key fake-key
|
|||
<TabItem value="autogen" label="AutoGen">
|
||||
|
||||
```python
|
||||
pip install pyautogen
|
||||
uv add pyautogen
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
|
|||
|
|
@ -66,16 +66,16 @@ git clone https://github.com/krrishdholakia/open-interpreter-litellm-fork
|
|||
```
|
||||
To run it do:
|
||||
```
|
||||
poetry build
|
||||
uv build
|
||||
|
||||
# call gpt-4 - always add 'litellm_proxy/' in front of the model name
|
||||
poetry run interpreter --model litellm_proxy/gpt-4
|
||||
uv run interpreter --model litellm_proxy/gpt-4
|
||||
|
||||
# call llama-70b - always add 'litellm_proxy/' in front of the model name
|
||||
poetry run interpreter --model litellm_proxy/togethercomputer/llama-2-70b-chat
|
||||
uv run interpreter --model litellm_proxy/togethercomputer/llama-2-70b-chat
|
||||
|
||||
# call claude-2 - always add 'litellm_proxy/' in front of the model name
|
||||
poetry run interpreter --model litellm_proxy/claude-2
|
||||
uv run interpreter --model litellm_proxy/claude-2
|
||||
```
|
||||
|
||||
And that's it!
|
||||
|
|
@ -83,4 +83,4 @@ And that's it!
|
|||
Now you can call any model you like!
|
||||
|
||||
|
||||
Want us to add more models? [Let us know!](https://github.com/BerriAI/litellm/issues/new/choose)
|
||||
Want us to add more models? [Let us know!](https://github.com/BerriAI/litellm/issues/new/choose)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ response = litellm.completion(
|
|||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
**Required package:** `pip install azure-identity`
|
||||
**Required package:** `uv add azure-identity`
|
||||
|
||||
### Generic OAuth2 (Okta, Auth0, Keycloak, etc.)
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ Docs outdated. New docs 👉 [here](./simple_proxy)
|
|||
|
||||
## Usage
|
||||
```shell
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
```shell
|
||||
$ litellm --model ollama/codellama
|
||||
|
|
@ -213,7 +213,7 @@ docker compose up -d
|
|||
<TabItem value="autogen" label="AutoGen">
|
||||
|
||||
```python
|
||||
pip install pyautogen
|
||||
uv add pyautogen
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -329,7 +329,7 @@ git clone https://github.com/OpenBMB/ChatDev.git
|
|||
cd ChatDev
|
||||
conda create -n ChatDev_conda_env python=3.9 -y
|
||||
conda activate ChatDev_conda_env
|
||||
pip install -r requirements.txt
|
||||
uv add -r requirements.txt
|
||||
```
|
||||
### Run ChatDev w/ Proxy
|
||||
```shell
|
||||
|
|
@ -346,7 +346,7 @@ python3 run.py --task "a script that says hello world" --name "hello world"
|
|||
<TabItem value="langroid" label="Langroid">
|
||||
|
||||
```python
|
||||
pip install langroid
|
||||
uv add langroid
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -383,7 +383,7 @@ Credits [@pchalasani](https://github.com/pchalasani) and [Langroid](https://gith
|
|||
Here's how to use the local proxy to test codellama/mistral/etc. models for different github repos
|
||||
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
```shell
|
||||
|
|
@ -440,7 +440,7 @@ Credits [@vividfog](https://github.com/ollama/ollama/issues/305#issuecomment-175
|
|||
<TabItem value="aider" label="Aider">
|
||||
|
||||
```shell
|
||||
$ pip install aider
|
||||
$ uv add aider
|
||||
|
||||
$ aider --openai-api-base http://0.0.0.0:8000 --openai-api-key fake-key
|
||||
```
|
||||
|
|
@ -448,7 +448,7 @@ $ aider --openai-api-base http://0.0.0.0:8000 --openai-api-key fake-key
|
|||
<TabItem value="autogen" label="AutoGen">
|
||||
|
||||
```python
|
||||
pip install pyautogen
|
||||
uv add pyautogen
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -564,7 +564,7 @@ git clone https://github.com/OpenBMB/ChatDev.git
|
|||
cd ChatDev
|
||||
conda create -n ChatDev_conda_env python=3.9 -y
|
||||
conda activate ChatDev_conda_env
|
||||
pip install -r requirements.txt
|
||||
uv add -r requirements.txt
|
||||
```
|
||||
### Run ChatDev w/ Proxy
|
||||
```shell
|
||||
|
|
@ -581,7 +581,7 @@ python3 run.py --task "a script that says hello world" --name "hello world"
|
|||
<TabItem value="langroid" label="Langroid">
|
||||
|
||||
```python
|
||||
pip install langroid
|
||||
uv add langroid
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
|
|||
|
|
@ -287,7 +287,7 @@ When `vector_store_id` is omitted, LiteLLM automatically creates:
|
|||
1. Create a RAG corpus in Vertex AI console or via API
|
||||
2. Create a GCS bucket for file uploads
|
||||
3. Authenticate via `gcloud auth application-default login`
|
||||
4. Install: `pip install 'google-cloud-aiplatform>=1.60.0'`
|
||||
4. Install: `uv add 'google-cloud-aiplatform>=1.60.0'`
|
||||
:::
|
||||
|
||||
### vector_store (AWS S3 Vectors)
|
||||
|
|
|
|||
|
|
@ -831,7 +831,7 @@ The system automatically selects the appropriate mode based on provider capabili
|
|||
|
||||
```python showLineNumbers title="WebSocket with Python"
|
||||
import json
|
||||
from websocket import create_connection # pip install websocket-client
|
||||
from websocket import create_connection # uv add websocket-client
|
||||
|
||||
# Connect to LiteLLM proxy WebSocket endpoint
|
||||
ws = create_connection(
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Register custom pricing for sagemaker completion model.
|
|||
For cost per second pricing, you **just** need to register `input_cost_per_second`.
|
||||
|
||||
```python
|
||||
# !pip install boto3
|
||||
# !uv add boto3
|
||||
from litellm import completion, completion_cost
|
||||
|
||||
os.environ["AWS_ACCESS_KEY_ID"] = ""
|
||||
|
|
@ -35,7 +35,7 @@ def test_completion_sagemaker():
|
|||
|
||||
|
||||
```python
|
||||
# !pip install boto3
|
||||
# !uv add boto3
|
||||
from litellm import completion, completion_cost
|
||||
|
||||
## set ENV variables
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
1. Install Proxy dependencies
|
||||
```bash
|
||||
pip install 'litellm[proxy]' 'litellm[extra_proxy]'
|
||||
uv tool install 'litellm[proxy]' 'litellm[extra_proxy]'
|
||||
```
|
||||
|
||||
2. Save Azure details in your environment
|
||||
|
|
|
|||
|
|
@ -1,21 +1,21 @@
|
|||
# Upgrading LiteLLM Proxy (pip/venv)
|
||||
# Upgrading LiteLLM Proxy (uv/venv)
|
||||
|
||||
Guide for upgrading LiteLLM Proxy when installed via pip in a virtual environment.
|
||||
Guide for upgrading LiteLLM Proxy when installed via uv in a virtual environment.
|
||||
|
||||
:::info Important
|
||||
Always activate your virtual environment before running any `litellm` or `prisma` commands. All commands in this guide assume you're working inside an activated venv.
|
||||
:::
|
||||
|
||||
## How pip/venv Upgrades Work
|
||||
## How uv/venv Upgrades Work
|
||||
|
||||
There are two pieces that need to stay in sync:
|
||||
|
||||
1. **Prisma client** - Generated Python code that talks to the DB
|
||||
2. **DB schema** - Tables/columns in PostgreSQL
|
||||
|
||||
When you upgrade via pip, the `litellm-proxy-extras` package ships with a new `schema.prisma` and a `migrations/` directory. But unlike the Docker image, pip install does NOT automatically regenerate the Prisma client or run migrations. You have to do both manually.
|
||||
When you upgrade via uv, the `litellm-proxy-extras` package ships with a new `schema.prisma` and a `migrations/` directory. But unlike the Docker image, `uv add` does not automatically regenerate the Prisma client or run migrations. You have to do both manually.
|
||||
|
||||
## Upgrade Workflow (pip/venv)
|
||||
## Upgrade Workflow (uv/venv)
|
||||
|
||||
### 1. Stop the proxy
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ pg_dump -h <host> -U <user> -d <db> -F c -f backup_$(date +%Y%m%d).dump
|
|||
### 3. Upgrade the package
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]==<version>'
|
||||
uv add 'litellm[proxy]==<version>'
|
||||
```
|
||||
|
||||
### 4. Regenerate the Prisma client
|
||||
|
|
@ -91,7 +91,7 @@ litellm --config your_config.yaml --port 4000
|
|||
|
||||
### Before applying migrations: Preview what will change
|
||||
|
||||
Run `pip install 'litellm[proxy]==<version>'` first (Step 3) so the new `schema.prisma` is available.
|
||||
Run `uv add 'litellm[proxy]==<version>'` first (Step 3) so the new `schema.prisma` is available.
|
||||
|
||||
```bash
|
||||
prisma migrate diff \
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ https://together.ai/
|
|||
|
||||
|
||||
```python
|
||||
!pip install litellm
|
||||
!uv add litellm
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ The Claude Agent SDK provides a high-level interface for building AI agents. By
|
|||
### 1. Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install claude-agent-sdk
|
||||
uv add claude-agent-sdk
|
||||
```
|
||||
|
||||
### 2. Start LiteLLM Proxy
|
||||
|
|
@ -104,7 +104,7 @@ See our [cookbook example](https://github.com/BerriAI/litellm/tree/main/cookbook
|
|||
# Clone and run the example
|
||||
git clone https://github.com/BerriAI/litellm.git
|
||||
cd litellm/cookbook/anthropic_agent_sdk
|
||||
pip install -r requirements.txt
|
||||
uv add -r requirements.txt
|
||||
python main.py
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ LiteLLM automatically translates between different provider formats, allowing yo
|
|||
First, install LiteLLM with proxy support:
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ This tutorial is based on [Anthropic's official LiteLLM configuration documentat
|
|||
First, install LiteLLM with proxy support:
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
### 1. Setup config.yaml
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ cd litellm/cookbook/benchmark
|
|||
|
||||
### Install Dependencies
|
||||
```
|
||||
pip install litellm click tqdm tabulate termcolor
|
||||
uv add litellm click tqdm tabulate termcolor
|
||||
```
|
||||
|
||||
### Configuration - Set LLM API Keys + LLMs in benchmark.py
|
||||
|
|
@ -88,7 +88,7 @@ Benchmark Results for 'When will BerriAI IPO?':
|
|||
<!--
|
||||
## Pre-requisites:
|
||||
``` python
|
||||
!pip install litellm
|
||||
!uv add litellm
|
||||
```
|
||||
|
||||
## Example Use Case 1 - Code Generator
|
||||
|
|
@ -102,7 +102,7 @@ litellm is a light package to simplify calling OpenAI, Azure, Cohere, Anthropic,
|
|||
--
|
||||
Sample Usage:
|
||||
```
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
from litellm import completion
|
||||
## set ENV variables
|
||||
os.environ["OPENAI_API_KEY"] = "openai key"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ given test set using litellm
|
|||
<div class="cell code" id="fBkbl4Qo9pvz">
|
||||
|
||||
``` python
|
||||
!pip install litellm
|
||||
!uv add litellm
|
||||
```
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ docker run -p 4317:4317 -p 4318:4318 \
|
|||
### 3. Install OpenTelemetry Dependencies
|
||||
|
||||
```bash
|
||||
pip install opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
uv add opentelemetry-api opentelemetry-sdk opentelemetry-exporter-otlp
|
||||
```
|
||||
|
||||
### 4. Configure LiteLLM
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@ MLflow provides an API `mlflow.evaluate()` to help evaluate your LLMs https://ml
|
|||
|
||||
### Pre Requisites
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
```shell
|
||||
pip install mlflow
|
||||
uv add mlflow
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -226,10 +226,10 @@ https://github.com/braintrustdata/autoevals
|
|||
|
||||
### Pre Requisites
|
||||
```shell
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
```shell
|
||||
pip install autoevals
|
||||
uv add autoevals
|
||||
```
|
||||
|
||||
### Quick Start
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ print(response.output)
|
|||
### 1. Install + set keys
|
||||
|
||||
```bash
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
export OPENAI_API_KEY="sk-..."
|
||||
export ANTHROPIC_API_KEY="sk-ant-..."
|
||||
```
|
||||
|
|
@ -135,7 +135,7 @@ flowchart TD
|
|||
## Prerequisites
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
export OPENAI_API_KEY="sk-..." # for native path
|
||||
export ANTHROPIC_API_KEY="sk-ant-..." # for emulated path
|
||||
```
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ Let's make sure our keys are working. Run this script in any environment of your
|
|||
🚨 Don't forget to replace the placeholder key values with your keys!
|
||||
|
||||
```python
|
||||
pip install litellm
|
||||
uv add litellm
|
||||
```
|
||||
|
||||
```python
|
||||
|
|
@ -169,10 +169,10 @@ Now let's run our app:
|
|||
cd litellm_playground_fe_template && streamlit run app.py
|
||||
```
|
||||
|
||||
If you're missing Streamlit - just pip install it (or check out their [installation guidelines](https://docs.streamlit.io/library/get-started/installation#install-streamlit-on-macoslinux))
|
||||
If you're missing Streamlit - just uv add it (or check out their [installation guidelines](https://docs.streamlit.io/library/get-started/installation#install-streamlit-on-macoslinux))
|
||||
|
||||
```zsh
|
||||
pip install streamlit
|
||||
uv add streamlit
|
||||
```
|
||||
|
||||
This is what you should see:
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ Before you begin, ensure you have:
|
|||
Install LiteLLM with proxy support:
|
||||
|
||||
```bash
|
||||
pip install litellm[proxy]
|
||||
uv tool install litellm[proxy]
|
||||
```
|
||||
|
||||
### Step 2: Configure LiteLLM Proxy
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ ADK (Agent Development Kit) allows you to build intelligent agents powered by LL
|
|||
## Installation
|
||||
|
||||
```bash showLineNumbers title="Install dependencies"
|
||||
pip install google-adk litellm
|
||||
uv add google-adk litellm
|
||||
```
|
||||
|
||||
## 1. Setting Up Environment
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ npm install @google/genai
|
|||
<TabItem value="python" label="Python">
|
||||
|
||||
```bash
|
||||
pip install google-genai
|
||||
uv add google-genai
|
||||
```
|
||||
|
||||
</TabItem>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ Simple tutorial for integrating LiteLLM completion calls with streaming Gradio c
|
|||
|
||||
### Install & Import Dependencies
|
||||
```python
|
||||
!pip install gradio litellm
|
||||
!uv add gradio litellm
|
||||
import gradio
|
||||
import litellm
|
||||
```
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
|
||||
|
||||
```python
|
||||
!pip install litellm python-dotenv
|
||||
!uv add litellm python-dotenv
|
||||
```
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ The LiveKit Agents framework provides tools for building real-time voice and vid
|
|||
### 1. Install Dependencies
|
||||
|
||||
```bash
|
||||
pip install livekit-agents[xai]
|
||||
uv add livekit-agents[xai]
|
||||
```
|
||||
|
||||
### 2. Start LiteLLM Proxy
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ source lmharness/bin/activate
|
|||
|
||||
Pip install openai==0.28.01 in the venv
|
||||
```shell
|
||||
pip install openai==0.28.01
|
||||
uv add openai==0.28.01
|
||||
```
|
||||
|
||||
**Step 3: Set OpenAI API Base & Key**
|
||||
|
|
@ -52,9 +52,9 @@ export OPENAI_API_SECRET_KEY=anything
|
|||
cd lm-evaluation-harness
|
||||
```
|
||||
|
||||
pip install lm harness dependencies in venv
|
||||
uv add lm harness dependencies in venv
|
||||
```
|
||||
python3 -m pip install -e .
|
||||
uv sync
|
||||
```
|
||||
|
||||
```shell
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Here's how you can implement model fallbacks across 3 LLM providers (OpenAI, Ant
|
|||
|
||||
## 1. Install LiteLLM
|
||||
```python
|
||||
!pip install litellm
|
||||
!uv add litellm
|
||||
```
|
||||
|
||||
## 2. Basic Fallbacks Code
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
### Install + Import LiteLLM
|
||||
```python
|
||||
!pip install litellm
|
||||
!uv add litellm
|
||||
from litellm import completion
|
||||
import os
|
||||
```
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ See the [Docs](https://openai.github.io/openai-agents-python/models/litellm/) fo
|
|||
## Installation
|
||||
|
||||
```bash showLineNumbers title="Install dependencies"
|
||||
pip install openai-agents litellm
|
||||
uv add openai-agents litellm
|
||||
```
|
||||
|
||||
## 1. Start LiteLLM Proxy
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ Chat apps → OpenClaw Gateway → LiteLLM Proxy → LLM Providers (OpenAI, Anth
|
|||
## Step 1 — Install LiteLLM Proxy
|
||||
|
||||
```bash
|
||||
pip install 'litellm[proxy]'
|
||||
uv tool install 'litellm[proxy]'
|
||||
```
|
||||
|
||||
## Step 2 — Create a LiteLLM config file
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ git clone https://github.com/BerriAI/litellm.git
|
|||
|
||||
#### Installation
|
||||
```
|
||||
pip install mkdocs
|
||||
uv add mkdocs
|
||||
```
|
||||
|
||||
#### Locally Serving Docs
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue