Skip to content

Commit

Permalink
fix(proxy/utils.py): fix model dump to exclude none values
Browse files Browse the repository at this point in the history
  • Loading branch information
krrishdholakia committed Aug 28, 2024
1 parent f9034ff commit 65097d5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/my-website/docs/proxy/self_serve.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export PROXY_LOGOUT_URL="https://www.google.com"

### Set max budget for internal users

Automatically apply budget per internal user when they sign up
Automatically apply budget per internal user when they sign up. By default the table will be checked every 10 minutes, for users to reset. To modify this, [see this](./users.md#reset-budgets)

```yaml
litellm_settings:
Expand Down
3 changes: 3 additions & 0 deletions litellm/proxy/_new_secret_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,8 @@ litellm_settings:
max_internal_user_budget: 0.00001
internal_user_budget_duration: "3s" # reset every 3seconds

general_settings:
proxy_budget_rescheduler_min_time: 1
proxy_budget_rescheduler_max_time: 2


4 changes: 3 additions & 1 deletion litellm/proxy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1853,7 +1853,9 @@ async def update_data(
batcher = self.db.batch_()
for idx, user in enumerate(data_list):
try:
data_json = self.jsonify_object(data=user.model_dump())
data_json = self.jsonify_object(
data=user.model_dump(exclude_none=True)
)
except:
data_json = self.jsonify_object(data=user.dict())
batcher.litellm_usertable.upsert(
Expand Down

0 comments on commit 65097d5

Please sign in to comment.