mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(s3.py): fix s3 path logging on proxy
This commit is contained in:
parent
bfab76a810
commit
b761ce9dd1
3 changed files with 18 additions and 2 deletions
|
@ -1188,6 +1188,7 @@ litellm_settings:
|
||||||
s3_region_name: us-west-2 # AWS Region Name for S3
|
s3_region_name: us-west-2 # AWS Region Name for S3
|
||||||
s3_aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID # us os.environ/<variable name> to pass environment variables. This is AWS Access Key ID for S3
|
s3_aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID # us os.environ/<variable name> to pass environment variables. This is AWS Access Key ID for S3
|
||||||
s3_aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY # AWS Secret Access Key for S3
|
s3_aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY # AWS Secret Access Key for S3
|
||||||
|
s3_path: my-test-path # [OPTIONAL] set path in bucket you want to write logs to
|
||||||
s3_endpoint_url: https://s3.amazonaws.com # [OPTIONAL] S3 endpoint URL, if you want to use Backblaze/cloudflare s3 buckets
|
s3_endpoint_url: https://s3.amazonaws.com # [OPTIONAL] S3 endpoint URL, if you want to use Backblaze/cloudflare s3 buckets
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,14 @@
|
||||||
#### What this does ####
|
#### What this does ####
|
||||||
# On success + failure, log events to Supabase
|
# On success + failure, log events to Supabase
|
||||||
|
|
||||||
|
import datetime
|
||||||
import os
|
import os
|
||||||
|
import subprocess
|
||||||
|
import sys
|
||||||
import traceback
|
import traceback
|
||||||
import datetime, subprocess, sys
|
import uuid
|
||||||
import litellm, uuid
|
|
||||||
|
import litellm
|
||||||
from litellm._logging import print_verbose, verbose_logger
|
from litellm._logging import print_verbose, verbose_logger
|
||||||
|
|
||||||
|
|
||||||
|
@ -54,6 +58,7 @@ class S3Logger:
|
||||||
"s3_aws_session_token"
|
"s3_aws_session_token"
|
||||||
)
|
)
|
||||||
s3_config = litellm.s3_callback_params.get("s3_config")
|
s3_config = litellm.s3_callback_params.get("s3_config")
|
||||||
|
s3_path = litellm.s3_callback_params.get("s3_path")
|
||||||
# done reading litellm.s3_callback_params
|
# done reading litellm.s3_callback_params
|
||||||
|
|
||||||
self.bucket_name = s3_bucket_name
|
self.bucket_name = s3_bucket_name
|
||||||
|
|
|
@ -2,3 +2,13 @@ model_list:
|
||||||
- model_name: "*" # all requests where model not in your config go to this deployment
|
- model_name: "*" # all requests where model not in your config go to this deployment
|
||||||
litellm_params:
|
litellm_params:
|
||||||
model: "openai/*"
|
model: "openai/*"
|
||||||
|
|
||||||
|
litellm_settings:
|
||||||
|
success_callback: ["s3"]
|
||||||
|
s3_callback_params:
|
||||||
|
s3_bucket_name: my-test-bucket-22-litellm # AWS Bucket Name for S3
|
||||||
|
s3_region_name: us-west-2 # AWS Region Name for S3
|
||||||
|
s3_aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID # us os.environ/<variable name> to pass environment variables. This is AWS Access Key ID for S3
|
||||||
|
s3_aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY # AWS Secret Access Key for S3
|
||||||
|
s3_path: my-test-path
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue