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(batches.md): add more examples to docs
Krrish Dholakia56cb94ac5eaf
diff --git a/docs/my-website/docs/batches.md b/docs/my-website/docs/batches.mdindex c73048f8b9d..898738f632a 100644--- a/docs/my-website/docs/batches.md+++ b/docs/my-website/docs/batches.md@@ -150,4 +150,76 @@ Just add the azure env vars to your environment.```bashexport AZURE_API_KEY=""export AZURE_API_BASE=""-```\ No newline at end of file+```++AND use `/azure/*` for the Batches API calls++```bash+http://0.0.0.0:4000/azure/v1/batches+```+### Usage++**Setup**++- Add Azure API Keys to your environment++#### 1. Upload a File++```bash+curl http://localhost:4000/azure/v1/files \+ -H "Authorization: Bearer sk-1234" \+ -F purpose="batch" \+ -F file="@mydata.jsonl"+```++**Example File**++Note: `model` should be your azure deployment name.++```json+{"custom_id": "task-0", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was Microsoft founded?"}]}}+{"custom_id": "task-1", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was the first XBOX released?"}]}}+{"custom_id": "task-2", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "What is Altair Basic?"}]}}+```++#### 2. Create a batch++```bash+curl http://0.0.0.0:4000/azure/v1/batches \+ -H "Authorization: Bearer $LITELLM_API_KEY" \+ -H "Content-Type: application/json" \+ -d '{+ "input_file_id": "file-abc123",+ "endpoint": "/v1/chat/completions",+ "completion_window": "24h"+ }'++```++#### 3. Retrieve batch+++```bash+curl http://0.0.0.0:4000/azure/v1/batches/batch_abc123 \+ -H "Authorization: Bearer $LITELLM_API_KEY" \+ -H "Content-Type: application/json" \+```++#### 4. Cancel batch++```bash+curl http://0.0.0.0:4000/azure/v1/batches/batch_abc123/cancel \+ -H "Authorization: Bearer $LITELLM_API_KEY" \+ -H "Content-Type: application/json" \+ -X POST+```++#### 5. List Batch++```bash+curl http://0.0.0.0:4000/v1/batches?limit=2 \+ -H "Authorization: Bearer $LITELLM_API_KEY" \+ -H "Content-Type: application/json"+```++### [👉 Health Check Azure Batch models](./proxy/health.md#batch-models-azure-only)\ No newline at end of filediff --git a/docs/my-website/docs/proxy/health.md b/docs/my-website/docs/proxy/health.mdindex e7ff69aeb3e..35dced84c97 100644--- a/docs/my-website/docs/proxy/health.md+++ b/docs/my-website/docs/proxy/health.md@@ -123,7 +123,7 @@ For Azure models deployed as 'batch' models, set `mode: batch`.model_list:- model_name: "batch-gpt-4o-mini"litellm_params:- model: "azure/gpt-4o-mini"+ model: "azure/batch-gpt-4o-mini"api_key: os.environ/AZURE_API_KEYapi_base: os.environ/AZURE_API_BASEmodel_info: