The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
docs(routing.md): add proxy loadbalancing tutorial
Krrish Dholakiaf5905e100068
diff --git a/docs/my-website/docs/proxy/reliability.md b/docs/my-website/docs/proxy/reliability.mdindex 5045ba36a59..4aa03228d39 100644--- a/docs/my-website/docs/proxy/reliability.md+++ b/docs/my-website/docs/proxy/reliability.md@@ -31,7 +31,9 @@ model_list:api_base: https://openai-france-1234.openai.azure.com/api_key: <your-azure-api-key>rpm: 1440-routing_strategy: simple-shuffle # Literal["simple-shuffle", "least-busy", "usage-based-routing","latency-based-routing"], default="simple-shuffle"++router_settings:+ routing_strategy: simple-shuffle # Literal["simple-shuffle", "least-busy", "usage-based-routing","latency-based-routing"], default="simple-shuffle"model_group_alias: {"gpt-4": "gpt-3.5-turbo"} # all requests with `gpt-4` will be routed to models with `gpt-3.5-turbo`num_retries: 2timeout: 30 # 30 seconds@@ -85,8 +87,6 @@ print(response)<TabItem value="Curl" label="Curl Request">-Pass `metadata` as part of the request body-```shellcurl --location 'http://0.0.0.0:4000/chat/completions' \--header 'Content-Type: application/json' \diff --git a/docs/my-website/docs/routing.md b/docs/my-website/docs/routing.mdindex 651c0739567..c7c6c3c9704 100644--- a/docs/my-website/docs/routing.md+++ b/docs/my-website/docs/routing.md@@ -25,6 +25,11 @@ If you want a server to load balance across different LLM APIs, use our [LiteLLM### Quick Start+Loadbalance across multiple [azure](./providers/azure.md)/[bedrock](./providers/bedrock.md)/[provider](./providers/) deployments. LiteLLM will handle retrying in different regions if a call fails.++<Tabs>+<TabItem value="sdk" label="SDK">+```pythonfrom litellm import Router@@ -84,6 +89,57 @@ response = await router.acompletion(model="gpt-4",print(response)```+</TabItem>+<TabItem value="proxy" label="PROXY">++:::info++See detailed proxy loadbalancing/fallback docs [here](./proxy/reliability.md)++:::++1. Setup model_list with multiple deployments+```yaml+model_list:+ - model_name: gpt-3.5-turbo+ litellm_params:+ model: azure/<your-deployment-name>+ api_base: <your-azure-endpoint>+ api_key: <your-azure-api-key>+ - model_name: gpt-3.5-turbo+ litellm_params:+ model: azure/gpt-turbo-small-ca+ api_base: https://my-endpoint-canada-berri992.openai.azure.com/+ api_key: <your-azure-api-key>+ - model_name: gpt-3.5-turbo+ litellm_params:+ model: azure/gpt-turbo-large+ api_base: https://openai-france-1234.openai.azure.com/+ api_key: <your-azure-api-key>+```++2. Start proxy++```bash+litellm --config /path/to/config.yaml+```++3. Test it!++```bash+curl -X POST 'http://0.0.0.0:4000/chat/completions' \+-H 'Content-Type: application/json' \+-H 'Authorization: Bearer sk-1234' \+-d '{+ "model": "gpt-3.5-turbo",+ "messages": [+ {"role": "user", "content": "Hi there!"}+ ],+ "mock_testing_rate_limit_error": true+}'+```+</TabItem>+</Tabs>### Available Endpoints- `router.completion()` - chat completions endpoint to call 100+ LLMs