build(config.yml): add /key/generate load test

This commit is contained in:
Krrish Dholakia 2024-01-10 19:23:42 +05:30
parent 1becc7a4cf
commit 21d951f279
2 changed files with 20 additions and 4 deletions

View file

@ -133,8 +133,24 @@ jobs:
command: dockerize -wait http://localhost:4000 -timeout 1m
- run:
name: Test the application
command: curl -s "http://localhost:4000/health/readiness"
command: |
status_codes=()
for i in {1..10}; do
status=$(curl --location --request 'POST' 'http://0.0.0.0:4000/key/generate' \
--header 'Authorization: Bearer sk-1234' \
--header 'Content-Type: application/json' \
--data '{"models": ["azure-models"], "aliases": {"mistral-7b": "gpt-3.5-turbo"}, "duration": null}' \
--silent --output /dev/null --write-out '%{http_code}\n') &
status_codes+=($status)
done
wait
for status in "${status_codes[@]}"; do
if [[ "$status" -ne 200 ]]; then
echo "A request did not return a 200 status code: $status"
exit 1
fi
done
echo "All requests returned a 200 status code."
publish_to_pypi:
docker:

View file

@ -23,7 +23,7 @@ litellm_settings:
set_verbose: True
general_settings:
# master_key: sk-1234 # [OPTIONAL] Only use this if you to require all calls to contain this key (Authorization: Bearer sk-1234)
master_key: sk-1234 # [OPTIONAL] Only use this if you to require all calls to contain this key (Authorization: Bearer sk-1234)
# database_url: "postgresql://<user>:<password>@<host>:<port>/<dbname>" # [OPTIONAL] use for token-based auth to proxy
environment_variables: