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: Update CLI arguments documentation with all available options (#20437)
Krish Dholakiaf65eec8fa807
diff --git a/docs/my-website/docs/proxy/cli.md b/docs/my-website/docs/proxy/cli.mdindex 9244f75b756..d3624000a32 100644--- a/docs/my-website/docs/proxy/cli.md+++ b/docs/my-website/docs/proxy/cli.md@@ -1,7 +1,10 @@# CLI Arguments-Cli arguments, --host, --port, --num_workers-## --host+This page documents all command-line interface (CLI) arguments available for the LiteLLM proxy server.++## Server Configuration++### --host- **Default:** `'0.0.0.0'`- The host for the server to listen on.- **Usage:**@@ -14,7 +17,7 @@ Cli arguments, --host, --port, --num_workerslitellm```-## --port+### --port- **Default:** `4000`- The port to bind the server to.- **Usage:**@@ -27,9 +30,9 @@ Cli arguments, --host, --port, --num_workerslitellm```-## --num_workers- - **Default:** `1`- - The number of uvicorn workers to spin up.+### --num_workers+ - **Default:** Number of logical CPUs in the system, or `4` if that cannot be determined+ - The number of uvicorn / gunicorn workers to spin up.- **Usage:**```shelllitellm --num_workers 4@@ -40,83 +43,183 @@ Cli arguments, --host, --port, --num_workerslitellm```-## --api_base+### --config+ - **Short form:** `-c`- **Default:** `None`- - The API base for the model litellm should call.+ - Path to the proxy configuration file (e.g., config.yaml).- **Usage:**```shell- litellm --model huggingface/tinyllama --api_base https://k58ory32yinf1ly0.us-east-1.aws.endpoints.huggingface.cloud+ litellm --config path/to/config.yaml```-## --api_version+### --log_config- **Default:** `None`- - For Azure services, specify the API version.+ - **Type:** `str`+ - Path to the logging configuration file for uvicorn.- **Usage:**```shell- litellm --model azure/gpt-deployment --api_version 2023-08-01 --api_base https://<your api base>"+ litellm --log_config path/to/log_config.conf```-## --model or -m+### --keepalive_timeout- **Default:** `None`- - The model name to pass to Litellm.+ - **Type:** `int`+ - Set the uvicorn keepalive timeout in seconds (uvicorn timeout_keep_alive parameter).- **Usage:**```shell- litellm --model gpt-3.5-turbo+ litellm --keepalive_timeout 30```+ - **Usage - set Environment Variable:** `KEEPALIVE_TIMEOUT`+ ```shell+ export KEEPALIVE_TIMEOUT=30+ litellm+ ```-## --test- - **Type:** `bool` (Flag)- - Proxy chat completions URL to make a test request.+### --max_requests_before_restart+ - **Default:** `None`+ - **Type:** `int`+ - Restart worker after this many requests. This is useful for mitigating memory growth over time.+ - For uvicorn: maps to `limit_max_requests`+ - For gunicorn: maps to `max_requests`- **Usage:**```shell- litellm --test+ litellm --max_requests_before_restart 10000```+ - **Usage - set Environment Variable:** `MAX_REQUESTS_BEFORE_RESTART`+ ```shell+ export MAX_REQUESTS_BEFORE_RESTART=10000+ litellm+ ```++## Server Backend Options-## --health+### --run_gunicorn+ - **Default:** `False`- **Type:** `bool` (Flag)- - Runs a health check on all models in config.yaml+ - Starts proxy via gunicorn instead of uvicorn. Better for managing multiple workers in production.- **Usage:**```shell- litellm --health+ litellm --run_gunicorn```-## --alias- - **Default:** `None`- - An alias for the model, for user-friendly reference.+### --run_hypercorn+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - Starts proxy via hypercorn instead of uvicorn. Supports HTTP/2.- **Usage:**```shell- litellm --alias my-gpt-model+ litellm --run_hypercorn```-## --debug+### --skip_server_startup- **Default:** `False`- **Type:** `bool` (Flag)- - Enable debugging mode for the input.+ - Skip starting the server after setup (useful for database migrations only).- **Usage:**```shell- litellm --debug+ litellm --skip_server_startup```- - **Usage - set Environment Variable:** `DEBUG`++## SSL/TLS Configuration++### --ssl_keyfile_path+ - **Default:** `None`+ - **Type:** `str`+ - Path to the SSL keyfile. Use this when you want to provide SSL certificate when starting proxy.+ - **Usage:**+ ```shell+ litellm --ssl_keyfile_path /path/to/key.pem --ssl_certfile_path /path/to/cert.pem+ ```+ - **Usage - set Environment Variable:** `SSL_KEYFILE_PATH````shell- export DEBUG=True+ export SSL_KEYFILE_PATH=/path/to/key.pemlitellm```-## --detailed_debug- - **Default:** `False`- - **Type:** `bool` (Flag)- - Enable debugging mode for the input.+### --ssl_certfile_path+ - **Default:** `None`+ - **Type:** `str`+ - Path to the SSL certfile. Use this when you want to provide SSL certificate when starting proxy.- **Usage:**```shell- litellm --detailed_debug+ litellm --ssl_certfile_path /path/to/cert.pem --ssl_keyfile_path /path/to/key.pem```- - **Usage - set Environment Variable:** `DETAILED_DEBUG`+ - **Usage - set Environment Variable:** `SSL_CERTFILE_PATH````shell- export DETAILED_DEBUG=True+ export SSL_CERTFILE_PATH=/path/to/cert.pemlitellm```-#### --temperature+### --ciphers+ - **Default:** `None`+ - **Type:** `str`+ - Ciphers to use for the SSL setup. Only used with `--run_hypercorn`.+ - **Usage:**+ ```shell+ litellm --run_hypercorn --ssl_keyfile_path /path/to/key.pem --ssl_certfile_path /path/to/cert.pem --ciphers "ECDHE+AESGCM"+ ```++## Model Configuration++### --model or -m+ - **Default:** `None`+ - The model name to pass to LiteLLM.+ - **Usage:**+ ```shell+ litellm --model gpt-3.5-turbo+ ```++### --alias+ - **Default:** `None`+ - An alias for the model, for user-friendly reference. Use this to give a litellm model name (e.g., "huggingface/codellama/CodeLlama-7b-Instruct-hf") a more user-friendly name ("codellama").+ - **Usage:**+ ```shell+ litellm --alias my-gpt-model+ ```++### --api_base+ - **Default:** `None`+ - The API base for the model LiteLLM should call.+ - **Usage:**+ ```shell+ litellm --model huggingface/tinyllama --api_base https://k58ory32yinf1ly0.us-east-1.aws.endpoints.huggingface.cloud+ ```++### --api_version+ - **Default:** `2024-07-01-preview`+ - For Azure services, specify the API version.+ - **Usage:**+ ```shell+ litellm --model azure/gpt-deployment --api_version 2023-08-01 --api_base https://<your api base>"+ ```++### --headers+ - **Default:** `None`+ - Headers for the API call (as JSON string).+ - **Usage:**+ ```shell+ litellm --model my-model --headers '{"Authorization": "Bearer token"}'+ ```++### --add_key+ - **Default:** `None`+ - Add a key to the model configuration.+ - **Usage:**+ ```shell+ litellm --add_key my-api-key+ ```++### --save+ - **Type:** `bool` (Flag)+ - Save the model-specific config.+ - **Usage:**+ ```shell+ litellm --model gpt-3.5-turbo --save+ ```++## Model Parameters++### --temperature- **Default:** `None`- **Type:** `float`- Set the temperature for the model.@@ -125,7 +228,7 @@ Cli arguments, --host, --port, --num_workerslitellm --temperature 0.7```-## --max_tokens+### --max_tokens- **Default:** `None`- **Type:** `int`- Set the maximum number of tokens for the model output.@@ -134,8 +237,8 @@ Cli arguments, --host, --port, --num_workerslitellm --max_tokens 50```-## --request_timeout- - **Default:** `6000`+### --request_timeout+ - **Default:** `None`- **Type:** `int`- Set the timeout in seconds for completion calls.- **Usage:**@@ -143,7 +246,16 @@ Cli arguments, --host, --port, --num_workerslitellm --request_timeout 300```-## --drop_params+### --max_budget+ - **Default:** `None`+ - **Type:** `float`+ - Set max budget for API calls. Works for hosted models like OpenAI, TogetherAI, Anthropic, etc.+ - **Usage:**+ ```shell+ litellm --max_budget 100.0+ ```++### --drop_params- **Type:** `bool` (Flag)- Drop any unmapped params.- **Usage:**@@ -151,7 +263,7 @@ Cli arguments, --host, --port, --num_workerslitellm --drop_params```-## --add_function_to_prompt+### --add_function_to_prompt- **Type:** `bool` (Flag)- If a function passed but unsupported, pass it as a part of the prompt.- **Usage:**@@ -159,37 +271,142 @@ Cli arguments, --host, --port, --num_workerslitellm --add_function_to_prompt```-## --config- - Configure Litellm by providing a configuration file path.+## Database Configuration++### --iam_token_db_auth+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - Connects to an RDS database using IAM token authentication instead of a password. This is useful for AWS RDS instances that are configured to use IAM database authentication.+ - When enabled, LiteLLM will generate an IAM authentication token to connect to the database.+ - **Required Environment Variables:**+ - `DATABASE_HOST` - The RDS database host+ - `DATABASE_PORT` - The database port+ - `DATABASE_USER` - The database user+ - `DATABASE_NAME` - The database name+ - `DATABASE_SCHEMA` (optional) - The database schema- **Usage:**```shell- litellm --config path/to/config.yaml+ litellm --iam_token_db_auth+ ```+ - **Usage - set Environment Variable:** `IAM_TOKEN_DB_AUTH`+ ```shell+ export IAM_TOKEN_DB_AUTH=True+ export DATABASE_HOST=mydb.us-east-1.rds.amazonaws.com+ export DATABASE_PORT=5432+ export DATABASE_USER=mydbuser+ export DATABASE_NAME=mydb+ litellm```-## --telemetry- - **Default:** `True`- - **Type:** `bool`- - Help track usage of this feature.+### --use_prisma_db_push+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - Use `prisma db push` instead of `prisma migrate` for database schema updates. This is useful when you want to quickly sync your database schema without creating migration files.- **Usage:**```shell- litellm --telemetry False+ litellm --use_prisma_db_push```+## Debugging-## --log_config- - **Default:** `None`- - **Type:** `str`- - Specify a log configuration file for uvicorn.+### --debug+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - Enable debugging mode for the input.- **Usage:**```shell- litellm --log_config path/to/log_config.conf+ litellm --debug```+ - **Usage - set Environment Variable:** `DEBUG`+ ```shell+ export DEBUG=True+ litellm+ ```-## --skip_server_startup+### --detailed_debug- **Default:** `False`- **Type:** `bool` (Flag)- - Skip starting the server after setup (useful for DB migrations only).+ - Enable detailed debugging mode to view verbose debug logs.- **Usage:**```shell- litellm --skip_server_startup- ```\ No newline at end of file+ litellm --detailed_debug+ ```+ - **Usage - set Environment Variable:** `DETAILED_DEBUG`+ ```shell+ export DETAILED_DEBUG=True+ litellm+ ```++### --local+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - For local debugging purposes.+ - **Usage:**+ ```shell+ litellm --local+ ```++## Testing & Health Checks++### --test+ - **Type:** `bool` (Flag)+ - Proxy chat completions URL to make a test request to.+ - **Usage:**+ ```shell+ litellm --test+ ```++### --test_async+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - Calls async endpoints `/queue/requests` and `/queue/response`.+ - **Usage:**+ ```shell+ litellm --test_async+ ```++### --num_requests+ - **Default:** `10`+ - **Type:** `int`+ - Number of requests to hit async endpoint with (used with `--test_async`).+ - **Usage:**+ ```shell+ litellm --test_async --num_requests 100+ ```++### --health+ - **Type:** `bool` (Flag)+ - Runs a health check on all models in config.yaml.+ - **Usage:**+ ```shell+ litellm --health+ ```++## Other Options++### --version+ - **Short form:** `-v`+ - **Type:** `bool` (Flag)+ - Print LiteLLM version and exit.+ - **Usage:**+ ```shell+ litellm --version+ ```++### --telemetry+ - **Default:** `True`+ - **Type:** `bool`+ - Help track usage of this feature. Turn off for privacy.+ - **Usage:**+ ```shell+ litellm --telemetry False+ ```++### --use_queue+ - **Default:** `False`+ - **Type:** `bool` (Flag)+ - To use celery workers for async endpoints.+ - **Usage:**+ ```shell+ litellm --use_queue+ ```