Merge pull request #7 from hanzoai/release-please--branches--main--changes--next

release: 1.1.0
This commit is contained in:
2025-03-26 18:18:12 -05:00
committed by GitHub
104 changed files with 1853 additions and 1348 deletions
+1 -1
View File
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.1"
".": "1.1.0"
}
+4 -2
View File
@@ -1,2 +1,4 @@
configured_endpoints: 190
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2FHanzo-AI-ecabe8785463e6887a841c5e04ff8d9cfc0f051e21c68a65253e121da25fb7d5.yml
configured_endpoints: 188
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hanzo-industries-inc%2FHanzo-AI-74ec345bb9bd4c1c21bd22ff8ed2cd9b1cba5a5c73bf895113c7386b64199b56.yml
openapi_spec_hash: 526f5064d5a79d0a602c9d311b9f8f6b
config_hash: 20426fef371c3da1e306a85d8f9b9ada
+24
View File
@@ -1,5 +1,29 @@
# Changelog
## 1.1.0 (2025-03-26)
Full Changelog: [v1.0.0...v1.1.0](https://github.com/hanzoai/python-sdk/compare/v1.0.0...v1.1.0)
### Features
* **api:** api update ([#12](https://github.com/hanzoai/python-sdk/issues/12)) ([d37d657](https://github.com/hanzoai/python-sdk/commit/d37d657eea2988c528bb1cb7560f6e0ab2f1e61e))
* **api:** update via SDK Studio ([#4](https://github.com/hanzoai/python-sdk/issues/4)) ([e5137ed](https://github.com/hanzoai/python-sdk/commit/e5137ed411811a52ff9b7cc0e44a678ef3f3065e))
* **api:** update via SDK Studio ([#6](https://github.com/hanzoai/python-sdk/issues/6)) ([8da866d](https://github.com/hanzoai/python-sdk/commit/8da866dea4cc031c8388be2e013f79f96f6f2950))
### Bug Fixes
* **ci:** ensure pip is always available ([#9](https://github.com/hanzoai/python-sdk/issues/9)) ([42dc32d](https://github.com/hanzoai/python-sdk/commit/42dc32d241c11794317fa4a89ee7e1a15a58855b))
* **ci:** remove publishing patch ([#10](https://github.com/hanzoai/python-sdk/issues/10)) ([339a613](https://github.com/hanzoai/python-sdk/commit/339a6135e50161ae8acacaf7d1d7381a6d77428d))
### Chores
* go live ([#1](https://github.com/hanzoai/python-sdk/issues/1)) ([c1f495e](https://github.com/hanzoai/python-sdk/commit/c1f495ea0e560ada8c76c571b42928bf8e1b5ee5))
* go live ([#11](https://github.com/hanzoai/python-sdk/issues/11)) ([7e1b48c](https://github.com/hanzoai/python-sdk/commit/7e1b48ce65cba77dd8fbd7e019d3913c492a87a6))
* **internal:** codegen related update ([#8](https://github.com/hanzoai/python-sdk/issues/8)) ([ebc4649](https://github.com/hanzoai/python-sdk/commit/ebc4649173ca01aeb26903c6fe32adad0be49491))
* update SDK settings ([#3](https://github.com/hanzoai/python-sdk/issues/3)) ([beb5358](https://github.com/hanzoai/python-sdk/commit/beb53583fcdb15983f09a73be166dbbca30fb93f))
## 0.1.0-alpha.1 (2025-03-15)
Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/hanzoai/python-sdk/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)
+3 -3
View File
@@ -79,7 +79,7 @@ from hanzoai import Hanzo
client = Hanzo()
model = client.model.create(
litellm_params={
llm_params={
"model": "model",
"api_base": "api_base",
"api_key": "api_key",
@@ -92,7 +92,7 @@ model = client.model.create(
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -115,7 +115,7 @@ model = client.model.create(
model_info={"id": "id"},
model_name="model_name",
)
print(model.litellm_params)
print(model.llm_params)
```
## File uploads
+1 -1
View File
@@ -20,7 +20,7 @@ or products provided by Hanzo please follow the respective company's security re
### Hanzo Terms and Policies
Please contact dev-feedback@hanzo.ai for any questions or concerns regarding security of our services.
Please contact dev@hanzo.ai for any questions or concerns regarding security of our services.
---
+12 -30
View File
@@ -406,12 +406,7 @@ Methods:
Types:
```python
from hanzoai.types.fine_tuning import (
LiteLlmFineTuningJobCreate,
JobCreateResponse,
JobRetrieveResponse,
JobListResponse,
)
from hanzoai.types.fine_tuning import JobCreateResponse, JobRetrieveResponse, JobListResponse
```
Methods:
@@ -440,8 +435,6 @@ Types:
from hanzoai.types import (
CredentialItem,
CredentialCreateResponse,
CredentialRetrieveResponse,
CredentialUpdateResponse,
CredentialListResponse,
CredentialDeleteResponse,
)
@@ -450,8 +443,6 @@ from hanzoai.types import (
Methods:
- <code title="post /credentials">client.credentials.<a href="./src/hanzoai/resources/credentials.py">create</a>(\*\*<a href="src/hanzoai/types/credential_create_params.py">params</a>) -> <a href="./src/hanzoai/types/credential_create_response.py">object</a></code>
- <code title="get /credentials/{credential_name}">client.credentials.<a href="./src/hanzoai/resources/credentials.py">retrieve</a>(credential_name) -> <a href="./src/hanzoai/types/credential_retrieve_response.py">object</a></code>
- <code title="put /credentials/{credential_name}">client.credentials.<a href="./src/hanzoai/resources/credentials.py">update</a>(path_credential_name, \*\*<a href="src/hanzoai/types/credential_update_params.py">params</a>) -> <a href="./src/hanzoai/types/credential_update_response.py">object</a></code>
- <code title="get /credentials">client.credentials.<a href="./src/hanzoai/resources/credentials.py">list</a>() -> <a href="./src/hanzoai/types/credential_list_response.py">object</a></code>
- <code title="delete /credentials/{credential_name}">client.credentials.<a href="./src/hanzoai/resources/credentials.py">delete</a>(credential_name) -> <a href="./src/hanzoai/types/credential_delete_response.py">object</a></code>
@@ -800,10 +791,8 @@ Types:
```python
from hanzoai.types import (
BlockTeamRequest,
LiteLlmModelTable,
LiteLlmTeamTable,
LiteLlmUserTable,
Member,
TeamCreateResponse,
TeamUpdateResponse,
TeamListResponse,
TeamDeleteResponse,
@@ -820,7 +809,7 @@ from hanzoai.types import (
Methods:
- <code title="post /team/new">client.team.<a href="./src/hanzoai/resources/team/team.py">create</a>(\*\*<a href="src/hanzoai/types/team_create_params.py">params</a>) -> <a href="./src/hanzoai/types/lite_llm_team_table.py">LiteLlmTeamTable</a></code>
- <code title="post /team/new">client.team.<a href="./src/hanzoai/resources/team/team.py">create</a>(\*\*<a href="src/hanzoai/types/team_create_params.py">params</a>) -> <a href="./src/hanzoai/types/team_create_response.py">TeamCreateResponse</a></code>
- <code title="post /team/update">client.team.<a href="./src/hanzoai/resources/team/team.py">update</a>(\*\*<a href="src/hanzoai/types/team_update_params.py">params</a>) -> <a href="./src/hanzoai/types/team_update_response.py">object</a></code>
- <code title="get /team/list">client.team.<a href="./src/hanzoai/resources/team/team.py">list</a>(\*\*<a href="src/hanzoai/types/team_list_params.py">params</a>) -> <a href="./src/hanzoai/types/team_list_response.py">object</a></code>
- <code title="post /team/delete">client.team.<a href="./src/hanzoai/resources/team/team.py">delete</a>(\*\*<a href="src/hanzoai/types/team_delete_params.py">params</a>) -> <a href="./src/hanzoai/types/team_delete_response.py">object</a></code>
@@ -865,40 +854,38 @@ Types:
```python
from hanzoai.types import (
BudgetTable,
OrgMember,
OrganizationMembershipTable,
OrganizationTableWithMembers,
UserRoles,
OrganizationCreateResponse,
OrganizationUpdateResponse,
OrganizationListResponse,
OrganizationDeleteResponse,
OrganizationAddMemberResponse,
OrganizationDeleteMemberResponse,
OrganizationUpdateMemberResponse,
)
```
Methods:
- <code title="post /organization/new">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">create</a>(\*\*<a href="src/hanzoai/types/organization_create_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_create_response.py">OrganizationCreateResponse</a></code>
- <code title="patch /organization/update">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">update</a>(\*\*<a href="src/hanzoai/types/organization_update_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_table_with_members.py">OrganizationTableWithMembers</a></code>
- <code title="patch /organization/update">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">update</a>(\*\*<a href="src/hanzoai/types/organization_update_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_update_response.py">OrganizationUpdateResponse</a></code>
- <code title="get /organization/list">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">list</a>() -> <a href="./src/hanzoai/types/organization_list_response.py">OrganizationListResponse</a></code>
- <code title="delete /organization/delete">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">delete</a>(\*\*<a href="src/hanzoai/types/organization_delete_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_delete_response.py">OrganizationDeleteResponse</a></code>
- <code title="post /organization/member_add">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">add_member</a>(\*\*<a href="src/hanzoai/types/organization_add_member_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_add_member_response.py">OrganizationAddMemberResponse</a></code>
- <code title="delete /organization/member_delete">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">delete_member</a>(\*\*<a href="src/hanzoai/types/organization_delete_member_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_delete_member_response.py">object</a></code>
- <code title="patch /organization/member_update">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">update_member</a>(\*\*<a href="src/hanzoai/types/organization_update_member_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_membership_table.py">OrganizationMembershipTable</a></code>
- <code title="patch /organization/member_update">client.organization.<a href="./src/hanzoai/resources/organization/organization.py">update_member</a>(\*\*<a href="src/hanzoai/types/organization_update_member_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_update_member_response.py">OrganizationUpdateMemberResponse</a></code>
## Info
Types:
```python
from hanzoai.types.organization import InfoDeprecatedResponse
from hanzoai.types.organization import InfoRetrieveResponse, InfoDeprecatedResponse
```
Methods:
- <code title="get /organization/info">client.organization.info.<a href="./src/hanzoai/resources/organization/info.py">retrieve</a>(\*\*<a href="src/hanzoai/types/organization/info_retrieve_params.py">params</a>) -> <a href="./src/hanzoai/types/organization_table_with_members.py">OrganizationTableWithMembers</a></code>
- <code title="get /organization/info">client.organization.info.<a href="./src/hanzoai/resources/organization/info.py">retrieve</a>(\*\*<a href="src/hanzoai/types/organization/info_retrieve_params.py">params</a>) -> <a href="./src/hanzoai/types/organization/info_retrieve_response.py">InfoRetrieveResponse</a></code>
- <code title="post /organization/info">client.organization.info.<a href="./src/hanzoai/resources/organization/info.py">deprecated</a>(\*\*<a href="src/hanzoai/types/organization/info_deprecated_params.py">params</a>) -> <a href="./src/hanzoai/types/organization/info_deprecated_response.py">object</a></code>
# Customer
@@ -908,12 +895,12 @@ Types:
```python
from hanzoai.types import (
BlockUsers,
LiteLlmEndUserTable,
CustomerCreateResponse,
CustomerUpdateResponse,
CustomerListResponse,
CustomerDeleteResponse,
CustomerBlockResponse,
CustomerRetrieveInfoResponse,
CustomerUnblockResponse,
)
```
@@ -925,7 +912,7 @@ Methods:
- <code title="get /customer/list">client.customer.<a href="./src/hanzoai/resources/customer.py">list</a>() -> <a href="./src/hanzoai/types/customer_list_response.py">CustomerListResponse</a></code>
- <code title="post /customer/delete">client.customer.<a href="./src/hanzoai/resources/customer.py">delete</a>(\*\*<a href="src/hanzoai/types/customer_delete_params.py">params</a>) -> <a href="./src/hanzoai/types/customer_delete_response.py">object</a></code>
- <code title="post /customer/block">client.customer.<a href="./src/hanzoai/resources/customer.py">block</a>(\*\*<a href="src/hanzoai/types/customer_block_params.py">params</a>) -> <a href="./src/hanzoai/types/customer_block_response.py">object</a></code>
- <code title="get /customer/info">client.customer.<a href="./src/hanzoai/resources/customer.py">retrieve_info</a>(\*\*<a href="src/hanzoai/types/customer_retrieve_info_params.py">params</a>) -> <a href="./src/hanzoai/types/lite_llm_end_user_table.py">LiteLlmEndUserTable</a></code>
- <code title="get /customer/info">client.customer.<a href="./src/hanzoai/resources/customer.py">retrieve_info</a>(\*\*<a href="src/hanzoai/types/customer_retrieve_info_params.py">params</a>) -> <a href="./src/hanzoai/types/customer_retrieve_info_response.py">CustomerRetrieveInfoResponse</a></code>
- <code title="post /customer/unblock">client.customer.<a href="./src/hanzoai/resources/customer.py">unblock</a>(\*\*<a href="src/hanzoai/types/customer_unblock_params.py">params</a>) -> <a href="./src/hanzoai/types/customer_unblock_response.py">object</a></code>
# Spend
@@ -933,12 +920,7 @@ Methods:
Types:
```python
from hanzoai.types import (
LiteLlmSpendLogs,
SpendCalculateSpendResponse,
SpendListLogsResponse,
SpendListTagsResponse,
)
from hanzoai.types import SpendCalculateSpendResponse, SpendListLogsResponse, SpendListTagsResponse
```
Methods:
-3
View File
@@ -3,7 +3,4 @@
set -eux
mkdir -p dist
rye build --clean
# Patching importlib-metadata version until upstream library version is updated
# https://github.com/pypa/twine/issues/977#issuecomment-2189800841
"$HOME/.rye/self/bin/python3" -m pip install 'importlib-metadata==7.2.1'
rye publish --yes --token=$PYPI_TOKEN
+2 -2
View File
@@ -1,6 +1,6 @@
[project]
name = "hanzoai"
version = "1.0.0"
version = "1.1.0"
description = "The official Python library for the Hanzo API"
dynamic = ["readme"]
license = "Apache-2.0"
@@ -86,7 +86,7 @@ typecheck = { chain = [
"typecheck:mypy" = "mypy ."
[build-system]
requires = ["hatchling", "hatch-fancy-pypi-readme"]
requires = ["hatchling==1.26.3", "hatch-fancy-pypi-readme"]
build-backend = "hatchling.build"
[tool.hatch.build]
+1 -1
View File
@@ -681,7 +681,7 @@ def set_pydantic_config(typ: Any, config: pydantic.ConfigDict) -> None:
setattr(typ, "__pydantic_config__", config) # noqa: B010
# our use of subclasssing here causes weirdness for type checkers,
# our use of subclassing here causes weirdness for type checkers,
# so we just pretend that we don't subclass
if TYPE_CHECKING:
GenericModel = BaseModel
+1 -1
View File
@@ -126,7 +126,7 @@ def _get_annotated_type(type_: type) -> type | None:
def _maybe_transform_key(key: str, type_: type) -> str:
"""Transform the given `data` based on the annotations provided in `type_`.
Note: this function only looks at `Annotated` types that contain `PropertInfo` metadata.
Note: this function only looks at `Annotated` types that contain `PropertyInfo` metadata.
"""
annotated_type = _get_annotated_type(type_)
if annotated_type is None:
+1 -1
View File
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
__title__ = "hanzoai"
__version__ = "0.1.0-alpha.1" # x-release-please-version
__version__ = "1.1.0" # x-release-please-version
+22 -22
View File
@@ -49,7 +49,7 @@ class ActiveResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Returns a list of litellm level settings
Returns a list of llm level settings
This is useful for debugging and ensuring the proxy server is configured
correctly.
@@ -59,17 +59,17 @@ class ActiveResource(SyncAPIResource):
```
{
"alerting": _alerting,
"litellm.callbacks": litellm_callbacks,
"litellm.input_callback": litellm_input_callbacks,
"litellm.failure_callback": litellm_failure_callbacks,
"litellm.success_callback": litellm_success_callbacks,
"litellm._async_success_callback": litellm_async_success_callbacks,
"litellm._async_failure_callback": litellm_async_failure_callbacks,
"litellm._async_input_callback": litellm_async_input_callbacks,
"all_litellm_callbacks": all_litellm_callbacks,
"num_callbacks": len(all_litellm_callbacks),
"llm.callbacks": llm_callbacks,
"llm.input_callback": llm_input_callbacks,
"llm.failure_callback": llm_failure_callbacks,
"llm.success_callback": llm_success_callbacks,
"llm._async_success_callback": llm_async_success_callbacks,
"llm._async_failure_callback": llm_async_failure_callbacks,
"llm._async_input_callback": llm_async_input_callbacks,
"all_llm_callbacks": all_llm_callbacks,
"num_callbacks": len(all_llm_callbacks),
"num_alerting": _num_alerting,
"litellm.request_timeout": litellm.request_timeout,
"llm.request_timeout": llm.request_timeout,
}
```
"""
@@ -113,7 +113,7 @@ class AsyncActiveResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Returns a list of litellm level settings
Returns a list of llm level settings
This is useful for debugging and ensuring the proxy server is configured
correctly.
@@ -123,17 +123,17 @@ class AsyncActiveResource(AsyncAPIResource):
```
{
"alerting": _alerting,
"litellm.callbacks": litellm_callbacks,
"litellm.input_callback": litellm_input_callbacks,
"litellm.failure_callback": litellm_failure_callbacks,
"litellm.success_callback": litellm_success_callbacks,
"litellm._async_success_callback": litellm_async_success_callbacks,
"litellm._async_failure_callback": litellm_async_failure_callbacks,
"litellm._async_input_callback": litellm_async_input_callbacks,
"all_litellm_callbacks": all_litellm_callbacks,
"num_callbacks": len(all_litellm_callbacks),
"llm.callbacks": llm_callbacks,
"llm.input_callback": llm_input_callbacks,
"llm.failure_callback": llm_failure_callbacks,
"llm.success_callback": llm_success_callbacks,
"llm._async_success_callback": llm_async_success_callbacks,
"llm._async_failure_callback": llm_async_failure_callbacks,
"llm._async_input_callback": llm_async_input_callbacks,
"all_llm_callbacks": all_llm_callbacks,
"num_callbacks": len(all_llm_callbacks),
"num_alerting": _num_alerting,
"litellm.request_timeout": litellm.request_timeout,
"llm.request_timeout": llm.request_timeout,
}
```
"""
+10 -10
View File
@@ -50,7 +50,7 @@ class AnthropicResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -83,7 +83,7 @@ class AnthropicResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -116,7 +116,7 @@ class AnthropicResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -149,7 +149,7 @@ class AnthropicResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -182,7 +182,7 @@ class AnthropicResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -236,7 +236,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -269,7 +269,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -302,7 +302,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -335,7 +335,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
@@ -368,7 +368,7 @@ class AsyncAnthropicResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/anthropic_completion)
[Docs](https://docs.llm.ai/docs/anthropic_completion)
Args:
extra_headers: Send extra headers
+10 -10
View File
@@ -50,7 +50,7 @@ class BedrockResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -83,7 +83,7 @@ class BedrockResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -116,7 +116,7 @@ class BedrockResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -149,7 +149,7 @@ class BedrockResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -182,7 +182,7 @@ class BedrockResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -236,7 +236,7 @@ class AsyncBedrockResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -269,7 +269,7 @@ class AsyncBedrockResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -302,7 +302,7 @@ class AsyncBedrockResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -335,7 +335,7 @@ class AsyncBedrockResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
@@ -368,7 +368,7 @@ class AsyncBedrockResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/bedrock)
[Docs](https://docs.llm.ai/docs/pass_through/bedrock)
Args:
extra_headers: Send extra headers
+4 -4
View File
@@ -63,8 +63,8 @@ class CacheResource(SyncAPIResource):
) -> object:
"""Endpoint for deleting a key from the cache.
All responses from litellm proxy
have `x-litellm-cache-key` in the headers
All responses from llm proxy have
`x-llm-cache-key` in the headers
Parameters:
@@ -170,8 +170,8 @@ class AsyncCacheResource(AsyncAPIResource):
) -> object:
"""Endpoint for deleting a key from the cache.
All responses from litellm proxy
have `x-litellm-cache-key` in the headers
All responses from llm proxy have
`x-llm-cache-key` in the headers
Parameters:
+10 -10
View File
@@ -50,7 +50,7 @@ class CohereResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -83,7 +83,7 @@ class CohereResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -116,7 +116,7 @@ class CohereResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -149,7 +149,7 @@ class CohereResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -182,7 +182,7 @@ class CohereResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -236,7 +236,7 @@ class AsyncCohereResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -269,7 +269,7 @@ class AsyncCohereResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -302,7 +302,7 @@ class AsyncCohereResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -335,7 +335,7 @@ class AsyncCohereResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -368,7 +368,7 @@ class AsyncCohereResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/cohere)
[Docs](https://docs.llm.ai/docs/pass_through/cohere)
Args:
extra_headers: Send extra headers
@@ -70,7 +70,7 @@ class PassThroughEndpointResource(SyncAPIResource):
headers: Key-value pairs of headers to be forwarded with the request. You can set any key
value pair here and it will be forwarded to your target endpoint
path: The route to be added to the LiteLLM Proxy Server.
path: The route to be added to the LLM Proxy Server.
target: The URL to which requests for this path should be forwarded.
@@ -250,7 +250,7 @@ class AsyncPassThroughEndpointResource(AsyncAPIResource):
headers: Key-value pairs of headers to be forwarded with the request. You can set any key
value pair here and it will be forwarded to your target endpoint
path: The route to be added to the LiteLLM Proxy Server.
path: The route to be added to the LLM Proxy Server.
target: The URL to which requests for this path should be forwarded.
+9 -189
View File
@@ -2,9 +2,11 @@
from __future__ import annotations
from typing import Optional
import httpx
from ..types import credential_create_params, credential_update_params
from ..types import credential_create_params
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
from .._utils import (
maybe_transform,
@@ -48,7 +50,8 @@ class CredentialsResource(SyncAPIResource):
*,
credential_info: object,
credential_name: str,
credential_values: object,
credential_values: Optional[object] | NotGiven = NOT_GIVEN,
model_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -77,6 +80,7 @@ class CredentialsResource(SyncAPIResource):
"credential_info": credential_info,
"credential_name": credential_name,
"credential_values": credential_values,
"model_id": model_id,
},
credential_create_params.CredentialCreateParams,
),
@@ -86,87 +90,6 @@ class CredentialsResource(SyncAPIResource):
cast_to=object,
)
def retrieve(
self,
credential_name: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""[BETA] endpoint.
This might change unexpectedly.
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not credential_name:
raise ValueError(f"Expected a non-empty value for `credential_name` but received {credential_name!r}")
return self._get(
f"/credentials/{credential_name}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
)
def update(
self,
path_credential_name: str,
*,
credential_info: object,
body_credential_name: str,
credential_values: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""[BETA] endpoint.
This might change unexpectedly.
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not path_credential_name:
raise ValueError(
f"Expected a non-empty value for `path_credential_name` but received {path_credential_name!r}"
)
return self._put(
f"/credentials/{path_credential_name}",
body=maybe_transform(
{
"credential_info": credential_info,
"body_credential_name": body_credential_name,
"credential_values": credential_values,
},
credential_update_params.CredentialUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
)
def list(
self,
*,
@@ -246,7 +169,8 @@ class AsyncCredentialsResource(AsyncAPIResource):
*,
credential_info: object,
credential_name: str,
credential_values: object,
credential_values: Optional[object] | NotGiven = NOT_GIVEN,
model_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -275,6 +199,7 @@ class AsyncCredentialsResource(AsyncAPIResource):
"credential_info": credential_info,
"credential_name": credential_name,
"credential_values": credential_values,
"model_id": model_id,
},
credential_create_params.CredentialCreateParams,
),
@@ -284,87 +209,6 @@ class AsyncCredentialsResource(AsyncAPIResource):
cast_to=object,
)
async def retrieve(
self,
credential_name: str,
*,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""[BETA] endpoint.
This might change unexpectedly.
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not credential_name:
raise ValueError(f"Expected a non-empty value for `credential_name` but received {credential_name!r}")
return await self._get(
f"/credentials/{credential_name}",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
)
async def update(
self,
path_credential_name: str,
*,
credential_info: object,
body_credential_name: str,
credential_values: object,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""[BETA] endpoint.
This might change unexpectedly.
Args:
extra_headers: Send extra headers
extra_query: Add additional query parameters to the request
extra_body: Add additional JSON properties to the request
timeout: Override the client-level default timeout for this request, in seconds
"""
if not path_credential_name:
raise ValueError(
f"Expected a non-empty value for `path_credential_name` but received {path_credential_name!r}"
)
return await self._put(
f"/credentials/{path_credential_name}",
body=await async_maybe_transform(
{
"credential_info": credential_info,
"body_credential_name": body_credential_name,
"credential_values": credential_values,
},
credential_update_params.CredentialUpdateParams,
),
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=object,
)
async def list(
self,
*,
@@ -426,12 +270,6 @@ class CredentialsResourceWithRawResponse:
self.create = to_raw_response_wrapper(
credentials.create,
)
self.retrieve = to_raw_response_wrapper(
credentials.retrieve,
)
self.update = to_raw_response_wrapper(
credentials.update,
)
self.list = to_raw_response_wrapper(
credentials.list,
)
@@ -447,12 +285,6 @@ class AsyncCredentialsResourceWithRawResponse:
self.create = async_to_raw_response_wrapper(
credentials.create,
)
self.retrieve = async_to_raw_response_wrapper(
credentials.retrieve,
)
self.update = async_to_raw_response_wrapper(
credentials.update,
)
self.list = async_to_raw_response_wrapper(
credentials.list,
)
@@ -468,12 +300,6 @@ class CredentialsResourceWithStreamingResponse:
self.create = to_streamed_response_wrapper(
credentials.create,
)
self.retrieve = to_streamed_response_wrapper(
credentials.retrieve,
)
self.update = to_streamed_response_wrapper(
credentials.update,
)
self.list = to_streamed_response_wrapper(
credentials.list,
)
@@ -489,12 +315,6 @@ class AsyncCredentialsResourceWithStreamingResponse:
self.create = async_to_streamed_response_wrapper(
credentials.create,
)
self.retrieve = async_to_streamed_response_wrapper(
credentials.retrieve,
)
self.update = async_to_streamed_response_wrapper(
credentials.update,
)
self.list = async_to_streamed_response_wrapper(
credentials.list,
)
+13 -13
View File
@@ -30,7 +30,7 @@ from .._response import (
)
from .._base_client import make_request_options
from ..types.customer_list_response import CustomerListResponse
from ..types.lite_llm_end_user_table import LiteLlmEndUserTable
from ..types.customer_retrieve_info_response import CustomerRetrieveInfoResponse
__all__ = ["CustomerResource", "AsyncCustomerResource"]
@@ -119,7 +119,7 @@ class CustomerResource(SyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id" : "ishaan-jaff-3",
"user_id" : "z-jaff-3",
"allowed_region": "eu",
"budget_id": "free_tier",
"default_model": "azure/gpt-3.5-turbo-eu" <- all calls from this user, use this model?
@@ -217,7 +217,7 @@ class CustomerResource(SyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id": "test-litellm-user-4",
"user_id": "test-llm-user-4",
"budget_id": "paid_tier"
}'
@@ -302,7 +302,7 @@ class CustomerResource(SyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_ids" :["ishaan-jaff-5"]
"user_ids" :["z-jaff-5"]
}'
See below for all params
@@ -383,7 +383,7 @@ class CustomerResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> LiteLlmEndUserTable:
) -> CustomerRetrieveInfoResponse:
"""Get information about an end-user.
An `end_user` is a customer (external user)
@@ -396,7 +396,7 @@ class CustomerResource(SyncAPIResource):
Example curl:
```
curl -X GET 'http://localhost:4000/customer/info?end_user_id=test-litellm-user-4' -H 'Authorization: Bearer sk-1234'
curl -X GET 'http://localhost:4000/customer/info?end_user_id=test-llm-user-4' -H 'Authorization: Bearer sk-1234'
```
Args:
@@ -421,7 +421,7 @@ class CustomerResource(SyncAPIResource):
{"end_user_id": end_user_id}, customer_retrieve_info_params.CustomerRetrieveInfoParams
),
),
cast_to=LiteLlmEndUserTable,
cast_to=CustomerRetrieveInfoResponse,
)
def unblock(
@@ -551,7 +551,7 @@ class AsyncCustomerResource(AsyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/new' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id" : "ishaan-jaff-3",
"user_id" : "z-jaff-3",
"allowed_region": "eu",
"budget_id": "free_tier",
"default_model": "azure/gpt-3.5-turbo-eu" <- all calls from this user, use this model?
@@ -649,7 +649,7 @@ class AsyncCustomerResource(AsyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id": "test-litellm-user-4",
"user_id": "test-llm-user-4",
"budget_id": "paid_tier"
}'
@@ -734,7 +734,7 @@ class AsyncCustomerResource(AsyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/customer/delete' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_ids" :["ishaan-jaff-5"]
"user_ids" :["z-jaff-5"]
}'
See below for all params
@@ -815,7 +815,7 @@ class AsyncCustomerResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> LiteLlmEndUserTable:
) -> CustomerRetrieveInfoResponse:
"""Get information about an end-user.
An `end_user` is a customer (external user)
@@ -828,7 +828,7 @@ class AsyncCustomerResource(AsyncAPIResource):
Example curl:
```
curl -X GET 'http://localhost:4000/customer/info?end_user_id=test-litellm-user-4' -H 'Authorization: Bearer sk-1234'
curl -X GET 'http://localhost:4000/customer/info?end_user_id=test-llm-user-4' -H 'Authorization: Bearer sk-1234'
```
Args:
@@ -853,7 +853,7 @@ class AsyncCustomerResource(AsyncAPIResource):
{"end_user_id": end_user_id}, customer_retrieve_info_params.CustomerRetrieveInfoParams
),
),
cast_to=LiteLlmEndUserTable,
cast_to=CustomerRetrieveInfoResponse,
)
async def unblock(
@@ -57,7 +57,7 @@ class CancelResource(SyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `fine_tuning_job_id`: The ID of the fine-tuning job to cancel.
Args:
@@ -119,7 +119,7 @@ class AsyncCancelResource(AsyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `fine_tuning_job_id`: The ID of the fine-tuning job to cancel.
Args:
@@ -145,7 +145,7 @@ class JobsResource(SyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `fine_tuning_job_id`: The ID of the fine-tuning job to retrieve.
Args:
@@ -193,7 +193,7 @@ class JobsResource(SyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `after`: Identifier for the last job from the previous pagination request.
- `limit`: Number of fine-tuning jobs to retrieve (default is 20).
@@ -337,7 +337,7 @@ class AsyncJobsResource(AsyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `fine_tuning_job_id`: The ID of the fine-tuning job to retrieve.
Args:
@@ -385,7 +385,7 @@ class AsyncJobsResource(AsyncAPIResource):
Supported Query Params:
- `custom_llm_provider`: Name of the LiteLLM provider
- `custom_llm_provider`: Name of the LLM provider
- `after`: Identifier for the last job from the previous pagination request.
- `limit`: Number of fine-tuning jobs to retrieve (default is 20).
+10 -10
View File
@@ -50,7 +50,7 @@ class GeminiResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -83,7 +83,7 @@ class GeminiResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -116,7 +116,7 @@ class GeminiResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -149,7 +149,7 @@ class GeminiResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -182,7 +182,7 @@ class GeminiResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -236,7 +236,7 @@ class AsyncGeminiResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -269,7 +269,7 @@ class AsyncGeminiResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -302,7 +302,7 @@ class AsyncGeminiResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -335,7 +335,7 @@ class AsyncGeminiResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
@@ -368,7 +368,7 @@ class AsyncGeminiResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
[Docs](https://docs.litellm.ai/docs/pass_through/google_ai_studio)
[Docs](https://docs.llm.ai/docs/pass_through/google_ai_studio)
Args:
extra_headers: Send extra headers
+12 -12
View File
@@ -61,9 +61,9 @@ class SpendResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SpendListTagsResponse:
"""LiteLLM Enterprise - View Spend Per Request Tag.
"""LLM Enterprise - View Spend Per Request Tag.
Used by LiteLLM UI
Used by LLM UI
Example Request:
@@ -124,12 +124,12 @@ class SpendResource(SyncAPIResource):
"""
ADMIN ONLY / MASTER KEY Only Endpoint
Globally reset spend for All API Keys and Teams, maintain LiteLLM_SpendLogs
Globally reset spend for All API Keys and Teams, maintain LLM_SpendLogs
1. LiteLLM_SpendLogs will maintain the logs on spend, no data gets deleted from
1. LLM_SpendLogs will maintain the logs on spend, no data gets deleted from
there
2. LiteLLM_VerificationTokens spend will be set = 0
3. LiteLLM_TeamTable spend will be set = 0
2. LLM_VerificationTokens spend will be set = 0
3. LLM_TeamTable spend will be set = 0
"""
return self._post(
"/global/spend/reset",
@@ -246,9 +246,9 @@ class AsyncSpendResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SpendListTagsResponse:
"""LiteLLM Enterprise - View Spend Per Request Tag.
"""LLM Enterprise - View Spend Per Request Tag.
Used by LiteLLM UI
Used by LLM UI
Example Request:
@@ -309,12 +309,12 @@ class AsyncSpendResource(AsyncAPIResource):
"""
ADMIN ONLY / MASTER KEY Only Endpoint
Globally reset spend for All API Keys and Teams, maintain LiteLLM_SpendLogs
Globally reset spend for All API Keys and Teams, maintain LLM_SpendLogs
1. LiteLLM_SpendLogs will maintain the logs on spend, no data gets deleted from
1. LLM_SpendLogs will maintain the logs on spend, no data gets deleted from
there
2. LiteLLM_VerificationTokens spend will be set = 0
3. LiteLLM_TeamTable spend will be set = 0
2. LLM_VerificationTokens spend will be set = 0
3. LLM_TeamTable spend will be set = 0
"""
return await self._post(
"/global/spend/reset",
+2 -2
View File
@@ -52,7 +52,7 @@ class GuardrailsResource(SyncAPIResource):
"""
List the guardrails that are available on the proxy server
👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)
👉 [Guardrail docs](https://docs.llm.ai/docs/proxy/guardrails/quick_start)
Example Request:
@@ -127,7 +127,7 @@ class AsyncGuardrailsResource(AsyncAPIResource):
"""
List the guardrails that are available on the proxy server
👉 [Guardrail docs](https://docs.litellm.ai/docs/proxy/guardrails/quick_start)
👉 [Guardrail docs](https://docs.llm.ai/docs/proxy/guardrails/quick_start)
Example Request:
+2 -2
View File
@@ -60,7 +60,7 @@ class HealthResource(SyncAPIResource):
"""
🚨 USE `/health/liveliness` to health check the proxy 🚨
See more 👉 https://docs.litellm.ai/docs/proxy/health
See more 👉 https://docs.llm.ai/docs/proxy/health
Check the health of all the endpoints in config.yaml
@@ -237,7 +237,7 @@ class AsyncHealthResource(AsyncAPIResource):
"""
🚨 USE `/health/liveliness` to health check the proxy 🚨
See more 👉 https://docs.litellm.ai/docs/proxy/health
See more 👉 https://docs.llm.ai/docs/proxy/health
Check the health of all the endpoints in config.yaml
+70 -82
View File
@@ -90,7 +90,7 @@ class KeyResource(SyncAPIResource):
temp_budget_increase: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -113,7 +113,7 @@ class KeyResource(SyncAPIResource):
- tags: Optional[List[str]] - Tags for organizing keys (Enterprise only)
- enforced_params: Optional[List[str]] - List of enforced params for the key
(Enterprise only).
[Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
[Docs](https://docs.llm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
- spend: Optional[float] - Amount spent by key
- max_budget: Optional[float] - Max budget for key
- model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets
@@ -137,7 +137,7 @@ class KeyResource(SyncAPIResource):
- guardrails: Optional[List[str]] - List of active guardrails for the key
- blocked: Optional[bool] - Whether the key is blocked
- aliases: Optional[dict] - Model aliases for the key -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases)
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases)
- config: Optional[dict] - [DEPRECATED PARAM] Key-specific config.
- temp_budget_increase: Optional[float] - Temporary budget increase for the key
(Enterprise only).
@@ -158,9 +158,8 @@ class KeyResource(SyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -170,7 +169,7 @@ class KeyResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/key/update",
body=maybe_transform(
@@ -289,7 +288,7 @@ class KeyResource(SyncAPIResource):
*,
key_aliases: Optional[List[str]] | NotGiven = NOT_GIVEN,
keys: Optional[List[str]] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -325,9 +324,8 @@ class KeyResource(SyncAPIResource):
Raises: HTTPException: If an error occurs during key deletion.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -337,7 +335,7 @@ class KeyResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/key/delete",
body=maybe_transform(
@@ -357,7 +355,7 @@ class KeyResource(SyncAPIResource):
self,
*,
key: str,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -384,9 +382,8 @@ class KeyResource(SyncAPIResource):
Note: This is an admin-only endpoint. Only proxy admins can block keys.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -396,7 +393,7 @@ class KeyResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/key/block",
body=maybe_transform({"key": key}, key_block_params.KeyBlockParams),
@@ -495,7 +492,7 @@ class KeyResource(SyncAPIResource):
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -506,7 +503,7 @@ class KeyResource(SyncAPIResource):
"""
Generate an API key based on the provided data.
Docs: https://docs.litellm.ai/docs/proxy/virtual_keys
Docs: https://docs.llm.ai/docs/proxy/virtual_keys
Parameters:
@@ -524,12 +521,12 @@ class KeyResource(SyncAPIResource):
key is allowed to call all models)
- aliases: Optional[dict] - Any alias mappings, on top of anything in the
config.yaml model list. -
https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models
https://docs.llm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models
- config: Optional[dict] - any key-specific configs, overrides config in
config.yaml
- spend: Optional[int] - Amount spent by key. Default is 0. Will be updated by
proxy whenever key is used.
https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend
https://docs.llm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend
- send_invite_email: Optional[bool] - Whether to send an invite email to the
user_id, with the generate key
- max_budget: Optional[float] - Specify max budget for a given key.
@@ -539,8 +536,8 @@ class KeyResource(SyncAPIResource):
- max_parallel_requests: Optional[int] - Rate limit a user based on the number
of parallel requests. Raises 429 error, if user's parallel requests > x.
- metadata: Optional[dict] - Metadata for key, store information for key.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- guardrails: Optional[List[str]] - List of active guardrails for the key
- permissions: Optional[dict] - key-specific permissions. Currently just used
for turning off pii masking (if connected). Example - {"pii": false}
@@ -555,7 +552,7 @@ class KeyResource(SyncAPIResource):
specific tpm limit.
- allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request
- blocked: Optional[bool] - Whether the key is blocked.
- rpm_limit: Optional[int] - Specify rpm limit for a given key (Requests per
minute)
@@ -564,12 +561,12 @@ class KeyResource(SyncAPIResource):
- soft_budget: Optional[float] - Specify soft budget for a given key. Will
trigger a slack alert when this soft budget is reached.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- enforced_params: Optional[List[str]] - List of enforced params for the key
(Enterprise only).
[Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
[Docs](https://docs.llm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
Examples:
@@ -589,9 +586,8 @@ class KeyResource(SyncAPIResource):
for same user id.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -601,7 +597,7 @@ class KeyResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/key/generate",
body=maybe_transform(
@@ -674,7 +670,7 @@ class KeyResource(SyncAPIResource):
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -735,9 +731,8 @@ class KeyResource(SyncAPIResource):
Note: This is an Enterprise feature. It requires a premium license to use.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -749,7 +744,7 @@ class KeyResource(SyncAPIResource):
"""
if not path_key:
raise ValueError(f"Expected a non-empty value for `path_key` but received {path_key!r}")
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
f"/key/{path_key}/regenerate",
body=maybe_transform(
@@ -849,7 +844,7 @@ class KeyResource(SyncAPIResource):
self,
*,
key: str,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -876,9 +871,8 @@ class KeyResource(SyncAPIResource):
Note: This is an admin-only endpoint. Only proxy admins can unblock keys.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -888,7 +882,7 @@ class KeyResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/key/unblock",
body=maybe_transform({"key": key}, key_unblock_params.KeyUnblockParams),
@@ -949,7 +943,7 @@ class AsyncKeyResource(AsyncAPIResource):
temp_budget_increase: Optional[float] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -972,7 +966,7 @@ class AsyncKeyResource(AsyncAPIResource):
- tags: Optional[List[str]] - Tags for organizing keys (Enterprise only)
- enforced_params: Optional[List[str]] - List of enforced params for the key
(Enterprise only).
[Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
[Docs](https://docs.llm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
- spend: Optional[float] - Amount spent by key
- max_budget: Optional[float] - Max budget for key
- model_max_budget: Optional[Dict[str, BudgetConfig]] - Model-specific budgets
@@ -996,7 +990,7 @@ class AsyncKeyResource(AsyncAPIResource):
- guardrails: Optional[List[str]] - List of active guardrails for the key
- blocked: Optional[bool] - Whether the key is blocked
- aliases: Optional[dict] - Model aliases for the key -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases)
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases)
- config: Optional[dict] - [DEPRECATED PARAM] Key-specific config.
- temp_budget_increase: Optional[float] - Temporary budget increase for the key
(Enterprise only).
@@ -1017,9 +1011,8 @@ class AsyncKeyResource(AsyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1029,7 +1022,7 @@ class AsyncKeyResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/key/update",
body=await async_maybe_transform(
@@ -1148,7 +1141,7 @@ class AsyncKeyResource(AsyncAPIResource):
*,
key_aliases: Optional[List[str]] | NotGiven = NOT_GIVEN,
keys: Optional[List[str]] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1184,9 +1177,8 @@ class AsyncKeyResource(AsyncAPIResource):
Raises: HTTPException: If an error occurs during key deletion.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1196,7 +1188,7 @@ class AsyncKeyResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/key/delete",
body=await async_maybe_transform(
@@ -1216,7 +1208,7 @@ class AsyncKeyResource(AsyncAPIResource):
self,
*,
key: str,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1243,9 +1235,8 @@ class AsyncKeyResource(AsyncAPIResource):
Note: This is an admin-only endpoint. Only proxy admins can block keys.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1255,7 +1246,7 @@ class AsyncKeyResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/key/block",
body=await async_maybe_transform({"key": key}, key_block_params.KeyBlockParams),
@@ -1354,7 +1345,7 @@ class AsyncKeyResource(AsyncAPIResource):
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1365,7 +1356,7 @@ class AsyncKeyResource(AsyncAPIResource):
"""
Generate an API key based on the provided data.
Docs: https://docs.litellm.ai/docs/proxy/virtual_keys
Docs: https://docs.llm.ai/docs/proxy/virtual_keys
Parameters:
@@ -1383,12 +1374,12 @@ class AsyncKeyResource(AsyncAPIResource):
key is allowed to call all models)
- aliases: Optional[dict] - Any alias mappings, on top of anything in the
config.yaml model list. -
https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models
https://docs.llm.ai/docs/proxy/virtual_keys#managing-auth---upgradedowngrade-models
- config: Optional[dict] - any key-specific configs, overrides config in
config.yaml
- spend: Optional[int] - Amount spent by key. Default is 0. Will be updated by
proxy whenever key is used.
https://docs.litellm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend
https://docs.llm.ai/docs/proxy/virtual_keys#managing-auth---tracking-spend
- send_invite_email: Optional[bool] - Whether to send an invite email to the
user_id, with the generate key
- max_budget: Optional[float] - Specify max budget for a given key.
@@ -1398,8 +1389,8 @@ class AsyncKeyResource(AsyncAPIResource):
- max_parallel_requests: Optional[int] - Rate limit a user based on the number
of parallel requests. Raises 429 error, if user's parallel requests > x.
- metadata: Optional[dict] - Metadata for key, store information for key.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- guardrails: Optional[List[str]] - List of active guardrails for the key
- permissions: Optional[dict] - key-specific permissions. Currently just used
for turning off pii masking (if connected). Example - {"pii": false}
@@ -1414,7 +1405,7 @@ class AsyncKeyResource(AsyncAPIResource):
specific tpm limit.
- allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request
- blocked: Optional[bool] - Whether the key is blocked.
- rpm_limit: Optional[int] - Specify rpm limit for a given key (Requests per
minute)
@@ -1423,12 +1414,12 @@ class AsyncKeyResource(AsyncAPIResource):
- soft_budget: Optional[float] - Specify soft budget for a given key. Will
trigger a slack alert when this soft budget is reached.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- enforced_params: Optional[List[str]] - List of enforced params for the key
(Enterprise only).
[Docs](https://docs.litellm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
[Docs](https://docs.llm.ai/docs/proxy/enterprise#enforce-required-params-for-llm-requests)
Examples:
@@ -1448,9 +1439,8 @@ class AsyncKeyResource(AsyncAPIResource):
for same user id.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1460,7 +1450,7 @@ class AsyncKeyResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/key/generate",
body=await async_maybe_transform(
@@ -1533,7 +1523,7 @@ class AsyncKeyResource(AsyncAPIResource):
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1594,9 +1584,8 @@ class AsyncKeyResource(AsyncAPIResource):
Note: This is an Enterprise feature. It requires a premium license to use.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1608,7 +1597,7 @@ class AsyncKeyResource(AsyncAPIResource):
"""
if not path_key:
raise ValueError(f"Expected a non-empty value for `path_key` but received {path_key!r}")
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
f"/key/{path_key}/regenerate",
body=await async_maybe_transform(
@@ -1708,7 +1697,7 @@ class AsyncKeyResource(AsyncAPIResource):
self,
*,
key: str,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1735,9 +1724,8 @@ class AsyncKeyResource(AsyncAPIResource):
Note: This is an admin-only endpoint. Only proxy admins can unblock keys.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1747,7 +1735,7 @@ class AsyncKeyResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/key/unblock",
body=await async_maybe_transform({"key": key}, key_unblock_params.KeyUnblockParams),
+20 -20
View File
@@ -49,11 +49,11 @@ class LangfuseResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -85,11 +85,11 @@ class LangfuseResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -121,11 +121,11 @@ class LangfuseResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -157,11 +157,11 @@ class LangfuseResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -193,11 +193,11 @@ class LangfuseResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -250,11 +250,11 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -286,11 +286,11 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -322,11 +322,11 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -358,11 +358,11 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
@@ -394,11 +394,11 @@ class AsyncLangfuseResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Call Langfuse via LiteLLM proxy.
"""Call Langfuse via LLM proxy.
Works with Langfuse SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/langfuse)
[Docs](https://docs.llm.ai/docs/pass_through/langfuse)
Args:
extra_headers: Send extra headers
+14 -16
View File
@@ -48,7 +48,7 @@ class InfoResource(SyncAPIResource):
def list(
self,
*,
litellm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -60,11 +60,11 @@ class InfoResource(SyncAPIResource):
Provides more info about each model in /models, including config.yaml
descriptions (except api key and api base)
Parameters: litellm_model_id: Optional[str] = None (this is the value of
`x-litellm-model-id` returned in response headers)
Parameters: llm_model_id: Optional[str] = None (this is the value of
`x-llm-model-id` returned in response headers)
- When litellm_model_id is passed, it will return the info for that specific model
- When litellm_model_id is not passed, it will return the info for all models
- When llm_model_id is passed, it will return the info for that specific model
- When llm_model_id is not passed, it will return the info for all models
Returns: Returns a dictionary containing information about each model.
@@ -75,7 +75,7 @@ class InfoResource(SyncAPIResource):
"data": [
{
"model_name": "fake-openai-endpoint",
"litellm_params": {
"llm_params": {
"api_base": "https://exampleopenaiendpoint-production.up.railway.app/",
"model": "openai/fake"
},
@@ -104,7 +104,7 @@ class InfoResource(SyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=maybe_transform({"litellm_model_id": litellm_model_id}, info_list_params.InfoListParams),
query=maybe_transform({"llm_model_id": llm_model_id}, info_list_params.InfoListParams),
),
cast_to=object,
)
@@ -133,7 +133,7 @@ class AsyncInfoResource(AsyncAPIResource):
async def list(
self,
*,
litellm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
llm_model_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -145,11 +145,11 @@ class AsyncInfoResource(AsyncAPIResource):
Provides more info about each model in /models, including config.yaml
descriptions (except api key and api base)
Parameters: litellm_model_id: Optional[str] = None (this is the value of
`x-litellm-model-id` returned in response headers)
Parameters: llm_model_id: Optional[str] = None (this is the value of
`x-llm-model-id` returned in response headers)
- When litellm_model_id is passed, it will return the info for that specific model
- When litellm_model_id is not passed, it will return the info for all models
- When llm_model_id is passed, it will return the info for that specific model
- When llm_model_id is not passed, it will return the info for all models
Returns: Returns a dictionary containing information about each model.
@@ -160,7 +160,7 @@ class AsyncInfoResource(AsyncAPIResource):
"data": [
{
"model_name": "fake-openai-endpoint",
"litellm_params": {
"llm_params": {
"api_base": "https://exampleopenaiendpoint-production.up.railway.app/",
"model": "openai/fake"
},
@@ -189,9 +189,7 @@ class AsyncInfoResource(AsyncAPIResource):
extra_query=extra_query,
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"litellm_model_id": litellm_model_id}, info_list_params.InfoListParams
),
query=await async_maybe_transform({"llm_model_id": llm_model_id}, info_list_params.InfoListParams),
),
cast_to=object,
)
+6 -6
View File
@@ -71,7 +71,7 @@ class ModelResource(SyncAPIResource):
def create(
self,
*,
litellm_params: model_create_params.LitellmParams,
llm_params: model_create_params.LlmParams,
model_info: ModelInfoParam,
model_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -85,7 +85,7 @@ class ModelResource(SyncAPIResource):
Allows adding new models to the model list in the config.yaml
Args:
litellm_params: LiteLLM Params with 'model' requirement - used for completions
llm_params: LLM Params with 'model' requirement - used for completions
extra_headers: Send extra headers
@@ -99,7 +99,7 @@ class ModelResource(SyncAPIResource):
"/model/new",
body=maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
@@ -175,7 +175,7 @@ class AsyncModelResource(AsyncAPIResource):
async def create(
self,
*,
litellm_params: model_create_params.LitellmParams,
llm_params: model_create_params.LlmParams,
model_info: ModelInfoParam,
model_name: str,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -189,7 +189,7 @@ class AsyncModelResource(AsyncAPIResource):
Allows adding new models to the model list in the config.yaml
Args:
litellm_params: LiteLLM Params with 'model' requirement - used for completions
llm_params: LLM Params with 'model' requirement - used for completions
extra_headers: Send extra headers
@@ -203,7 +203,7 @@ class AsyncModelResource(AsyncAPIResource):
"/model/new",
body=await async_maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
+8 -8
View File
@@ -49,7 +49,7 @@ class UpdateResource(SyncAPIResource):
def full(
self,
*,
litellm_params: Optional[update_full_params.LitellmParams] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_full_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -75,7 +75,7 @@ class UpdateResource(SyncAPIResource):
"/model/update",
body=maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
@@ -91,7 +91,7 @@ class UpdateResource(SyncAPIResource):
self,
model_id: str,
*,
litellm_params: Optional[update_partial_params.LitellmParams] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_partial_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -130,7 +130,7 @@ class UpdateResource(SyncAPIResource):
f"/model/{model_id}/update",
body=maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
@@ -166,7 +166,7 @@ class AsyncUpdateResource(AsyncAPIResource):
async def full(
self,
*,
litellm_params: Optional[update_full_params.LitellmParams] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_full_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -192,7 +192,7 @@ class AsyncUpdateResource(AsyncAPIResource):
"/model/update",
body=await async_maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
@@ -208,7 +208,7 @@ class AsyncUpdateResource(AsyncAPIResource):
self,
model_id: str,
*,
litellm_params: Optional[update_partial_params.LitellmParams] | NotGiven = NOT_GIVEN,
llm_params: Optional[update_partial_params.LlmParams] | NotGiven = NOT_GIVEN,
model_info: Optional[ModelInfoParam] | NotGiven = NOT_GIVEN,
model_name: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -247,7 +247,7 @@ class AsyncUpdateResource(AsyncAPIResource):
f"/model/{model_id}/update",
body=await async_maybe_transform(
{
"litellm_params": litellm_params,
"llm_params": llm_params,
"model_info": model_info,
"model_name": model_name,
},
+6 -6
View File
@@ -57,8 +57,8 @@ class ModelGroupResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Get information about all the deployments on litellm proxy, including
config.yaml descriptions (except api key and api base)
Get information about all the deployments on llm proxy, including config.yaml
descriptions (except api key and api base)
- /model_group/info returns all model groups. End users of proxy should use
/model_group/info since those models will be used for /chat/completions,
@@ -87,7 +87,7 @@ class ModelGroupResource(SyncAPIResource):
```
Learn how to use and set wildcard models
[here](https://docs.litellm.ai/docs/wildcard_routing)
[here](https://docs.llm.ai/docs/wildcard_routing)
Example Response:
@@ -256,8 +256,8 @@ class AsyncModelGroupResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Get information about all the deployments on litellm proxy, including
config.yaml descriptions (except api key and api base)
Get information about all the deployments on llm proxy, including config.yaml
descriptions (except api key and api base)
- /model_group/info returns all model groups. End users of proxy should use
/model_group/info since those models will be used for /chat/completions,
@@ -286,7 +286,7 @@ class AsyncModelGroupResource(AsyncAPIResource):
```
Learn how to use and set wildcard models
[here](https://docs.litellm.ai/docs/wildcard_routing)
[here](https://docs.llm.ai/docs/wildcard_routing)
Example Response:
+12 -2
View File
@@ -49,6 +49,7 @@ class ModelsResource(SyncAPIResource):
self,
*,
return_wildcard_routes: Optional[bool] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -79,7 +80,11 @@ class ModelsResource(SyncAPIResource):
extra_body=extra_body,
timeout=timeout,
query=maybe_transform(
{"return_wildcard_routes": return_wildcard_routes}, model_list_params.ModelListParams
{
"return_wildcard_routes": return_wildcard_routes,
"team_id": team_id,
},
model_list_params.ModelListParams,
),
),
cast_to=object,
@@ -110,6 +115,7 @@ class AsyncModelsResource(AsyncAPIResource):
self,
*,
return_wildcard_routes: Optional[bool] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -140,7 +146,11 @@ class AsyncModelsResource(AsyncAPIResource):
extra_body=extra_body,
timeout=timeout,
query=await async_maybe_transform(
{"return_wildcard_routes": return_wildcard_routes}, model_list_params.ModelListParams
{
"return_wildcard_routes": return_wildcard_routes,
"team_id": team_id,
},
model_list_params.ModelListParams,
),
),
cast_to=object,
+5 -5
View File
@@ -21,7 +21,7 @@ from ..._response import (
)
from ..._base_client import make_request_options
from ...types.organization import info_retrieve_params, info_deprecated_params
from ...types.organization_table_with_members import OrganizationTableWithMembers
from ...types.organization.info_retrieve_response import InfoRetrieveResponse
__all__ = ["InfoResource", "AsyncInfoResource"]
@@ -56,7 +56,7 @@ class InfoResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationTableWithMembers:
) -> InfoRetrieveResponse:
"""
Get the org specific information
@@ -78,7 +78,7 @@ class InfoResource(SyncAPIResource):
timeout=timeout,
query=maybe_transform({"organization_id": organization_id}, info_retrieve_params.InfoRetrieveParams),
),
cast_to=OrganizationTableWithMembers,
cast_to=InfoRetrieveResponse,
)
def deprecated(
@@ -144,7 +144,7 @@ class AsyncInfoResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationTableWithMembers:
) -> InfoRetrieveResponse:
"""
Get the org specific information
@@ -168,7 +168,7 @@ class AsyncInfoResource(AsyncAPIResource):
{"organization_id": organization_id}, info_retrieve_params.InfoRetrieveParams
),
),
cast_to=OrganizationTableWithMembers,
cast_to=InfoRetrieveResponse,
)
async def deprecated(
@@ -3,6 +3,7 @@
from __future__ import annotations
from typing import List, Iterable, Optional
from typing_extensions import Literal
import httpx
@@ -15,7 +16,6 @@ from .info import (
AsyncInfoResourceWithStreamingResponse,
)
from ...types import (
UserRoles,
organization_create_params,
organization_delete_params,
organization_update_params,
@@ -37,13 +37,12 @@ from ..._response import (
async_to_streamed_response_wrapper,
)
from ..._base_client import make_request_options
from ...types.user_roles import UserRoles
from ...types.organization_list_response import OrganizationListResponse
from ...types.organization_create_response import OrganizationCreateResponse
from ...types.organization_delete_response import OrganizationDeleteResponse
from ...types.organization_membership_table import OrganizationMembershipTable
from ...types.organization_table_with_members import OrganizationTableWithMembers
from ...types.organization_update_response import OrganizationUpdateResponse
from ...types.organization_add_member_response import OrganizationAddMemberResponse
from ...types.organization_update_member_response import OrganizationUpdateMemberResponse
__all__ = ["OrganizationResource", "AsyncOrganizationResource"]
@@ -124,13 +123,13 @@ class OrganizationResource(SyncAPIResource):
- blocked: _bool_ - Flag indicating if the org is blocked or not - will stop all
calls from keys with this org_id.
- tags: _Optional[List[str]]_ - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: _Optional[str]_ - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
Case 1: Create new org **without** a budget_id
@@ -210,7 +209,7 @@ class OrganizationResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationTableWithMembers:
) -> OrganizationUpdateResponse:
"""
Update an organization
@@ -240,7 +239,7 @@ class OrganizationResource(SyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrganizationTableWithMembers,
cast_to=OrganizationUpdateResponse,
)
def list(
@@ -330,7 +329,7 @@ class OrganizationResource(SyncAPIResource):
- organization_id: str (required)
- member: Union[List[Member], Member] (required)
- role: Literal[LitellmUserRoles] (required)
- role: Literal[LLMUserRoles] (required)
- user_id: Optional[str]
- user_email: Optional[str]
@@ -343,7 +342,7 @@ class OrganizationResource(SyncAPIResource):
"organization_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",
"member": {
"role": "internal_user",
"user_id": "krrish247652@berri.ai"
"user_id": "dev247652@hanzo.ai"
},
"max_budget_in_organization": 100.0
}'
@@ -353,8 +352,8 @@ class OrganizationResource(SyncAPIResource):
1. Check if organization exists
2. Creates a new Internal User if the user_id or user_email is not found in
LiteLLM_UserTable
3. Add Internal User to the `LiteLLM_OrganizationMembership` table
LLM_UserTable
3. Add Internal User to the `LLM_OrganizationMembership` table
Args:
extra_headers: Send extra headers
@@ -427,7 +426,18 @@ class OrganizationResource(SyncAPIResource):
*,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
role: Optional[UserRoles] | NotGiven = NOT_GIVEN,
role: Optional[
Literal[
"proxy_admin",
"proxy_admin_viewer",
"org_admin",
"internal_user",
"internal_user_viewer",
"team",
"customer",
]
]
| NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -436,7 +446,7 @@ class OrganizationResource(SyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationMembershipTable:
) -> OrganizationUpdateMemberResponse:
"""
Update a member's role in an organization
@@ -476,7 +486,7 @@ class OrganizationResource(SyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrganizationMembershipTable,
cast_to=OrganizationUpdateMemberResponse,
)
@@ -556,13 +566,13 @@ class AsyncOrganizationResource(AsyncAPIResource):
- blocked: _bool_ - Flag indicating if the org is blocked or not - will stop all
calls from keys with this org_id.
- tags: _Optional[List[str]]_ - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: _Optional[str]_ - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
Case 1: Create new org **without** a budget_id
@@ -642,7 +652,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationTableWithMembers:
) -> OrganizationUpdateResponse:
"""
Update an organization
@@ -672,7 +682,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrganizationTableWithMembers,
cast_to=OrganizationUpdateResponse,
)
async def list(
@@ -762,7 +772,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
- organization_id: str (required)
- member: Union[List[Member], Member] (required)
- role: Literal[LitellmUserRoles] (required)
- role: Literal[LLMUserRoles] (required)
- user_id: Optional[str]
- user_email: Optional[str]
@@ -775,7 +785,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
"organization_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",
"member": {
"role": "internal_user",
"user_id": "krrish247652@berri.ai"
"user_id": "dev247652@hanzo.ai"
},
"max_budget_in_organization": 100.0
}'
@@ -785,8 +795,8 @@ class AsyncOrganizationResource(AsyncAPIResource):
1. Check if organization exists
2. Creates a new Internal User if the user_id or user_email is not found in
LiteLLM_UserTable
3. Add Internal User to the `LiteLLM_OrganizationMembership` table
LLM_UserTable
3. Add Internal User to the `LLM_OrganizationMembership` table
Args:
extra_headers: Send extra headers
@@ -859,7 +869,18 @@ class AsyncOrganizationResource(AsyncAPIResource):
*,
organization_id: str,
max_budget_in_organization: Optional[float] | NotGiven = NOT_GIVEN,
role: Optional[UserRoles] | NotGiven = NOT_GIVEN,
role: Optional[
Literal[
"proxy_admin",
"proxy_admin_viewer",
"org_admin",
"internal_user",
"internal_user_viewer",
"team",
"customer",
]
]
| NotGiven = NOT_GIVEN,
user_email: Optional[str] | NotGiven = NOT_GIVEN,
user_id: Optional[str] | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -868,7 +889,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> OrganizationMembershipTable:
) -> OrganizationUpdateMemberResponse:
"""
Update a member's role in an organization
@@ -908,7 +929,7 @@ class AsyncOrganizationResource(AsyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=OrganizationMembershipTable,
cast_to=OrganizationUpdateMemberResponse,
)
+2 -2
View File
@@ -51,7 +51,7 @@ class ProviderResource(SyncAPIResource):
) -> ProviderListBudgetsResponse:
"""
Provider Budget Routing - Get Budget, Spend Details
https://docs.litellm.ai/docs/proxy/provider_budget_routing
https://docs.llm.ai/docs/proxy/provider_budget_routing
Use this endpoint to check current budget, spend and budget reset time for a
provider
@@ -136,7 +136,7 @@ class AsyncProviderResource(AsyncAPIResource):
) -> ProviderListBudgetsResponse:
"""
Provider Budget Routing - Get Budget, Spend Details
https://docs.litellm.ai/docs/proxy/provider_budget_routing
https://docs.llm.ai/docs/proxy/provider_budget_routing
Use this endpoint to check current budget, spend and budget reset time for a
provider
+22 -22
View File
@@ -49,7 +49,7 @@ class SettingsResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Returns a list of litellm level settings
Returns a list of llm level settings
This is useful for debugging and ensuring the proxy server is configured
correctly.
@@ -59,17 +59,17 @@ class SettingsResource(SyncAPIResource):
```
{
"alerting": _alerting,
"litellm.callbacks": litellm_callbacks,
"litellm.input_callback": litellm_input_callbacks,
"litellm.failure_callback": litellm_failure_callbacks,
"litellm.success_callback": litellm_success_callbacks,
"litellm._async_success_callback": litellm_async_success_callbacks,
"litellm._async_failure_callback": litellm_async_failure_callbacks,
"litellm._async_input_callback": litellm_async_input_callbacks,
"all_litellm_callbacks": all_litellm_callbacks,
"num_callbacks": len(all_litellm_callbacks),
"llm.callbacks": llm_callbacks,
"llm.input_callback": llm_input_callbacks,
"llm.failure_callback": llm_failure_callbacks,
"llm.success_callback": llm_success_callbacks,
"llm._async_success_callback": llm_async_success_callbacks,
"llm._async_failure_callback": llm_async_failure_callbacks,
"llm._async_input_callback": llm_async_input_callbacks,
"all_llm_callbacks": all_llm_callbacks,
"num_callbacks": len(all_llm_callbacks),
"num_alerting": _num_alerting,
"litellm.request_timeout": litellm.request_timeout,
"llm.request_timeout": llm.request_timeout,
}
```
"""
@@ -113,7 +113,7 @@ class AsyncSettingsResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Returns a list of litellm level settings
Returns a list of llm level settings
This is useful for debugging and ensuring the proxy server is configured
correctly.
@@ -123,17 +123,17 @@ class AsyncSettingsResource(AsyncAPIResource):
```
{
"alerting": _alerting,
"litellm.callbacks": litellm_callbacks,
"litellm.input_callback": litellm_input_callbacks,
"litellm.failure_callback": litellm_failure_callbacks,
"litellm.success_callback": litellm_success_callbacks,
"litellm._async_success_callback": litellm_async_success_callbacks,
"litellm._async_failure_callback": litellm_async_failure_callbacks,
"litellm._async_input_callback": litellm_async_input_callbacks,
"all_litellm_callbacks": all_litellm_callbacks,
"num_callbacks": len(all_litellm_callbacks),
"llm.callbacks": llm_callbacks,
"llm.input_callback": llm_input_callbacks,
"llm.failure_callback": llm_failure_callbacks,
"llm.success_callback": llm_success_callbacks,
"llm._async_success_callback": llm_async_success_callbacks,
"llm._async_failure_callback": llm_async_failure_callbacks,
"llm._async_input_callback": llm_async_input_callbacks,
"all_llm_callbacks": all_llm_callbacks,
"num_callbacks": len(all_llm_callbacks),
"num_alerting": _num_alerting,
"litellm.request_timeout": litellm.request_timeout,
"llm.request_timeout": llm.request_timeout,
}
```
"""
+6 -6
View File
@@ -66,7 +66,7 @@ class SpendResource(SyncAPIResource):
Calculate spend **before** making call:
Note: If you see a spend of $0.0 you need to set custom_pricing for your model:
https://docs.litellm.ai/docs/proxy/custom_pricing
https://docs.llm.ai/docs/proxy/custom_pricing
```
curl --location 'http://localhost:4000/spend/calculate'
@@ -174,7 +174,7 @@ class SpendResource(SyncAPIResource):
Example Request for specific user_id
```
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai" -H "Authorization: Bearer sk-1234"
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=z@hanzo.ai" -H "Authorization: Bearer sk-1234"
```
Args:
@@ -231,7 +231,7 @@ class SpendResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SpendListTagsResponse:
"""
LiteLLM Enterprise - View Spend Per Request Tag
LLM Enterprise - View Spend Per Request Tag
Example Request:
@@ -316,7 +316,7 @@ class AsyncSpendResource(AsyncAPIResource):
Calculate spend **before** making call:
Note: If you see a spend of $0.0 you need to set custom_pricing for your model:
https://docs.litellm.ai/docs/proxy/custom_pricing
https://docs.llm.ai/docs/proxy/custom_pricing
```
curl --location 'http://localhost:4000/spend/calculate'
@@ -424,7 +424,7 @@ class AsyncSpendResource(AsyncAPIResource):
Example Request for specific user_id
```
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=ishaan@berri.ai" -H "Authorization: Bearer sk-1234"
curl -X GET "http://0.0.0.0:8000/spend/logs?user_id=z@hanzo.ai" -H "Authorization: Bearer sk-1234"
```
Args:
@@ -481,7 +481,7 @@ class AsyncSpendResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SpendListTagsResponse:
"""
LiteLLM Enterprise - View Spend Per Request Tag
LLM Enterprise - View Spend Per Request Tag
Example Request:
+8 -10
View File
@@ -105,7 +105,7 @@ class CallbackResource(SyncAPIResource):
callback_name: str,
callback_vars: Dict[str, str],
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -156,9 +156,8 @@ class CallbackResource(SyncAPIResource):
the secret key sk-xxxxx
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -170,7 +169,7 @@ class CallbackResource(SyncAPIResource):
"""
if not team_id:
raise ValueError(f"Expected a non-empty value for `team_id` but received {team_id!r}")
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
f"/team/{team_id}/callback",
body=maybe_transform(
@@ -266,7 +265,7 @@ class AsyncCallbackResource(AsyncAPIResource):
callback_name: str,
callback_vars: Dict[str, str],
callback_type: Optional[Literal["success", "failure", "success_and_failure"]] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -317,9 +316,8 @@ class AsyncCallbackResource(AsyncAPIResource):
the secret key sk-xxxxx
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -331,7 +329,7 @@ class AsyncCallbackResource(AsyncAPIResource):
"""
if not team_id:
raise ValueError(f"Expected a non-empty value for `team_id` but received {team_id!r}")
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
f"/team/{team_id}/callback",
body=await async_maybe_transform(
+61 -67
View File
@@ -52,7 +52,7 @@ from ..._response import (
)
from ..._base_client import make_request_options
from ...types.member_param import MemberParam
from ...types.lite_llm_team_table import LiteLlmTeamTable
from ...types.team_create_response import TeamCreateResponse
from ...types.team_add_member_response import TeamAddMemberResponse
from ...types.team_update_member_response import TeamUpdateMemberResponse
@@ -106,20 +106,20 @@ class TeamResource(SyncAPIResource):
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> LiteLlmTeamTable:
) -> TeamCreateResponse:
"""Allow users to create a new team.
Apply user permissions to their team.
👉
[Detailed Doc on setting team budgets](https://docs.litellm.ai/docs/proxy/team_budgets)
[Detailed Doc on setting team budgets](https://docs.llm.ai/docs/proxy/team_budgets)
Parameters:
@@ -138,7 +138,7 @@ class TeamResource(SyncAPIResource):
- max_budget: Optional[float] - The maximum budget allocated to the team - all
keys for this team_id will have at max this max_budget
- budget_duration: Optional[str] - The duration of the budget for the team. Doc
[here](https://docs.litellm.ai/docs/proxy/team_budgets)
[here](https://docs.llm.ai/docs/proxy/team_budgets)
- models: Optional[list] - A list of models associated with the team - all keys
for this team_id will have at most, these models. If empty, assumes all models
are allowed.
@@ -147,15 +147,15 @@ class TeamResource(SyncAPIResource):
- members: Optional[List] - Control team members via `/team/member/add` and
`/team/member/delete`.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: Optional[str] - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
- guardrails: Optional[List[str]] - Guardrails for the team.
[Docs](https://docs.litellm.ai/docs/proxy/guardrails) Returns:
[Docs](https://docs.llm.ai/docs/proxy/guardrails) Returns:
- team_id: (str) Unique team id - used for tracking spend across multiple keys
for same team id.
@@ -184,9 +184,8 @@ class TeamResource(SyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -196,7 +195,7 @@ class TeamResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/team/new",
body=maybe_transform(
@@ -223,7 +222,7 @@ class TeamResource(SyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=LiteLlmTeamTable,
cast_to=TeamCreateResponse,
)
def update(
@@ -242,7 +241,7 @@ class TeamResource(SyncAPIResource):
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -260,8 +259,8 @@ class TeamResource(SyncAPIResource):
- team_id: str - The team id of the user. Required param.
- team_alias: Optional[str] - User defined team alias
- metadata: Optional[dict] - Metadata for team, store information for team.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team -
all keys with this team_id will have at max this TPM limit
- rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team -
@@ -269,23 +268,23 @@ class TeamResource(SyncAPIResource):
- max_budget: Optional[float] - The maximum budget allocated to the team - all
keys for this team_id will have at max this max_budget
- budget_duration: Optional[str] - The duration of the budget for the team. Doc
[here](https://docs.litellm.ai/docs/proxy/team_budgets)
[here](https://docs.llm.ai/docs/proxy/team_budgets)
- models: Optional[list] - A list of models associated with the team - all keys
for this team_id will have at most, these models. If empty, assumes all models
are allowed.
- blocked: bool - Flag indicating if the team is blocked or not - will stop all
calls from keys with this team_id.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: Optional[str] - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
- guardrails: Optional[List[str]] - Guardrails for the team.
[Docs](https://docs.litellm.ai/docs/proxy/guardrails) Example - update team
TPM Limit
[Docs](https://docs.llm.ai/docs/proxy/guardrails) Example - update team TPM
Limit
```
curl --location 'http://0.0.0.0:4000/team/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{
@@ -304,9 +303,8 @@ class TeamResource(SyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -316,7 +314,7 @@ class TeamResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/team/update",
body=maybe_transform(
@@ -401,7 +399,7 @@ class TeamResource(SyncAPIResource):
self,
*,
team_ids: List[str],
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -424,9 +422,8 @@ class TeamResource(SyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -436,7 +433,7 @@ class TeamResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/team/delete",
body=maybe_transform({"team_ids": team_ids}, team_delete_params.TeamDeleteParams),
@@ -470,7 +467,7 @@ class TeamResource(SyncAPIResource):
```
curl -X POST 'http://0.0.0.0:4000/team/member_add' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849", "member": {"role": "user", "user_id": "krrish247652@berri.ai"}}'
curl -X POST 'http://0.0.0.0:4000/team/member_add' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849", "member": {"role": "user", "user_id": "dev247652@hanzo.ai"}}'
```
@@ -653,7 +650,7 @@ class TeamResource(SyncAPIResource):
-H 'Content-Type: application/json'
-d '{
"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",
"user_id": "krrish247652@berri.ai"
"user_id": "dev247652@hanzo.ai"
}'
```
@@ -867,20 +864,20 @@ class AsyncTeamResource(AsyncAPIResource):
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
team_id: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> LiteLlmTeamTable:
) -> TeamCreateResponse:
"""Allow users to create a new team.
Apply user permissions to their team.
👉
[Detailed Doc on setting team budgets](https://docs.litellm.ai/docs/proxy/team_budgets)
[Detailed Doc on setting team budgets](https://docs.llm.ai/docs/proxy/team_budgets)
Parameters:
@@ -899,7 +896,7 @@ class AsyncTeamResource(AsyncAPIResource):
- max_budget: Optional[float] - The maximum budget allocated to the team - all
keys for this team_id will have at max this max_budget
- budget_duration: Optional[str] - The duration of the budget for the team. Doc
[here](https://docs.litellm.ai/docs/proxy/team_budgets)
[here](https://docs.llm.ai/docs/proxy/team_budgets)
- models: Optional[list] - A list of models associated with the team - all keys
for this team_id will have at most, these models. If empty, assumes all models
are allowed.
@@ -908,15 +905,15 @@ class AsyncTeamResource(AsyncAPIResource):
- members: Optional[List] - Control team members via `/team/member/add` and
`/team/member/delete`.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: Optional[str] - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
- guardrails: Optional[List[str]] - Guardrails for the team.
[Docs](https://docs.litellm.ai/docs/proxy/guardrails) Returns:
[Docs](https://docs.llm.ai/docs/proxy/guardrails) Returns:
- team_id: (str) Unique team id - used for tracking spend across multiple keys
for same team id.
@@ -945,9 +942,8 @@ class AsyncTeamResource(AsyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -957,7 +953,7 @@ class AsyncTeamResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/team/new",
body=await async_maybe_transform(
@@ -984,7 +980,7 @@ class AsyncTeamResource(AsyncAPIResource):
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=LiteLlmTeamTable,
cast_to=TeamCreateResponse,
)
async def update(
@@ -1003,7 +999,7 @@ class AsyncTeamResource(AsyncAPIResource):
tags: Optional[Iterable[object]] | NotGiven = NOT_GIVEN,
team_alias: Optional[str] | NotGiven = NOT_GIVEN,
tpm_limit: Optional[int] | NotGiven = NOT_GIVEN,
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1021,8 +1017,8 @@ class AsyncTeamResource(AsyncAPIResource):
- team_id: str - The team id of the user. Required param.
- team_alias: Optional[str] - User defined team alias
- metadata: Optional[dict] - Metadata for team, store information for team.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- tpm_limit: Optional[int] - The TPM (Tokens Per Minute) limit for this team -
all keys with this team_id will have at max this TPM limit
- rpm_limit: Optional[int] - The RPM (Requests Per Minute) limit for this team -
@@ -1030,23 +1026,23 @@ class AsyncTeamResource(AsyncAPIResource):
- max_budget: Optional[float] - The maximum budget allocated to the team - all
keys for this team_id will have at max this max_budget
- budget_duration: Optional[str] - The duration of the budget for the team. Doc
[here](https://docs.litellm.ai/docs/proxy/team_budgets)
[here](https://docs.llm.ai/docs/proxy/team_budgets)
- models: Optional[list] - A list of models associated with the team - all keys
for this team_id will have at most, these models. If empty, assumes all models
are allowed.
- blocked: bool - Flag indicating if the team is blocked or not - will stop all
calls from keys with this team_id.
- tags: Optional[List[str]] - Tags for
[tracking spend](https://litellm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
[tracking spend](https://llm.vercel.app/docs/proxy/enterprise#tracking-spend-for-custom-tags)
and/or doing
[tag-based routing](https://litellm.vercel.app/docs/proxy/tag_routing).
[tag-based routing](https://llm.vercel.app/docs/proxy/tag_routing).
- organization_id: Optional[str] - The organization id of the team. Default is
None. Create via `/organization/new`.
- model_aliases: Optional[dict] - Model aliases for the team.
[Docs](https://docs.litellm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
[Docs](https://docs.llm.ai/docs/proxy/team_based_routing#create-team-with-model-alias)
- guardrails: Optional[List[str]] - Guardrails for the team.
[Docs](https://docs.litellm.ai/docs/proxy/guardrails) Example - update team
TPM Limit
[Docs](https://docs.llm.ai/docs/proxy/guardrails) Example - update team TPM
Limit
```
curl --location 'http://0.0.0.0:4000/team/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data-raw '{
@@ -1065,9 +1061,8 @@ class AsyncTeamResource(AsyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1077,7 +1072,7 @@ class AsyncTeamResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/team/update",
body=await async_maybe_transform(
@@ -1162,7 +1157,7 @@ class AsyncTeamResource(AsyncAPIResource):
self,
*,
team_ids: List[str],
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -1185,9 +1180,8 @@ class AsyncTeamResource(AsyncAPIResource):
```
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -1197,7 +1191,7 @@ class AsyncTeamResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/team/delete",
body=await async_maybe_transform({"team_ids": team_ids}, team_delete_params.TeamDeleteParams),
@@ -1231,7 +1225,7 @@ class AsyncTeamResource(AsyncAPIResource):
```
curl -X POST 'http://0.0.0.0:4000/team/member_add' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849", "member": {"role": "user", "user_id": "krrish247652@berri.ai"}}'
curl -X POST 'http://0.0.0.0:4000/team/member_add' -H 'Authorization: Bearer sk-1234' -H 'Content-Type: application/json' -d '{"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849", "member": {"role": "user", "user_id": "dev247652@hanzo.ai"}}'
```
@@ -1414,7 +1408,7 @@ class AsyncTeamResource(AsyncAPIResource):
-H 'Content-Type: application/json'
-d '{
"team_id": "45e3e396-ee08-4a61-a88e-16b3ce7e0849",
"user_id": "krrish247652@berri.ai"
"user_id": "dev247652@hanzo.ai"
}'
```
+48 -50
View File
@@ -95,8 +95,8 @@ class UserResource(SyncAPIResource):
"""Use this to create a new INTERNAL user with a budget.
Internal Users can access
LiteLLM Admin UI to make keys, request access to models. This creates a new user
and generates a new api key for the new user. The new api key is returned.
LLM Admin UI to make keys, request access to models. This creates a new user and
generates a new api key for the new user. The new api key is returned.
Returns user id, budget + new key.
@@ -112,7 +112,7 @@ class UserResource(SyncAPIResource):
- user_role: Optional[str] - Specify a user role - "proxy_admin",
"proxy_admin_viewer", "internal_user", "internal_user_viewer", "team",
"customer". Info about each role here:
`https://github.com/BerriAI/litellm/litellm/proxy/_types.py#L20`
`https://github.com/hanzoai/llm/llm/proxy/_types.py#L20`
- max_budget: Optional[float] - Specify max budget for a given user.
- budget_duration: Optional[str] - Budget is reset at the end of specified
duration. If not set, budget is never reset. You can set duration as seconds
@@ -127,29 +127,29 @@ class UserResource(SyncAPIResource):
- auto_create_key: bool - Default=True. Flag used for returning a key as part of
the /user/new response
- aliases: Optional[dict] - Model aliases for the user -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases)
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases)
- config: Optional[dict] - [DEPRECATED PARAM] User-specific config.
- allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request-
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request-
- blocked: Optional[bool] - [Not Implemented Yet] Whether the user is blocked.
- guardrails: Optional[List[str]] - [Not Implemented Yet] List of active
guardrails for the user
- permissions: Optional[dict] - [Not Implemented Yet] User-specific permissions,
eg. turning off pii masking.
- metadata: Optional[dict] - Metadata for user, store information for user.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- max_parallel_requests: Optional[int] - Rate limit a user based on the number
of parallel requests. Raises 429 error, if user's parallel requests > x.
- soft_budget: Optional[float] - Get alerts when user crosses given budget,
doesn't block requests.
- model_max_budget: Optional[dict] - Model-specific max budget for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-budgets-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-budgets-to-keys)
- model_rpm_limit: Optional[float] - Model-specific rpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
- model_tpm_limit: Optional[float] - Model-specific tpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
- spend: Optional[float] - Amount spent by user. Default is 0. Will be updated
by proxy whenever user is used. You can set duration as seconds ("30s"),
minutes ("30m"), hours ("30h"), days ("30d"), months ("1mo").
@@ -266,7 +266,7 @@ class UserResource(SyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/user/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id": "test-litellm-user-4",
"user_id": "test-llm-user-4",
"user_role": "proxy_admin_viewer"
}'
```
@@ -280,7 +280,7 @@ class UserResource(SyncAPIResource):
user_role: Optional[str] - Specify a user role - "proxy_admin",
"proxy_admin_viewer", "internal_user", "internal_user_viewer", "team",
"customer". Info about each role here:
`https://github.com/BerriAI/litellm/litellm/proxy/_types.py#L20` - max_budget:
`https://github.com/hanzoai/llm/llm/proxy/_types.py#L20` - max_budget:
Optional[float] - Specify max budget for a given user. - budget_duration:
Optional[str] - Budget is reset at the end of specified duration. If not set,
budget is never reset. You can set duration as seconds ("30s"), minutes ("30m"),
@@ -291,27 +291,27 @@ class UserResource(SyncAPIResource):
(Requests per minute) - auto_create_key: bool - Default=True. Flag used for
returning a key as part of the /user/new response - aliases: Optional[dict] -
Model aliases for the user -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases) -
config: Optional[dict] - [DEPRECATED PARAM] User-specific config. -
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases) - config:
Optional[dict] - [DEPRECATED PARAM] User-specific config. -
allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request- -
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request- -
blocked: Optional[bool] - [Not Implemented Yet] Whether the user is blocked. -
guardrails: Optional[List[str]] - [Not Implemented Yet] List of active
guardrails for the user - permissions: Optional[dict] - [Not Implemented Yet]
User-specific permissions, eg. turning off pii masking. - metadata:
Optional[dict] - Metadata for user, store information for user. Example metadata
= {"team": "core-infra", "app": "app2", "email": "ishaan@berri.ai" } -
= {"team": "core-infra", "app": "app2", "email": "z@hanzo.ai" } -
max_parallel_requests: Optional[int] - Rate limit a user based on the number of
parallel requests. Raises 429 error, if user's parallel requests > x. -
soft_budget: Optional[float] - Get alerts when user crosses given budget,
doesn't block requests. - model_max_budget: Optional[dict] - Model-specific max
budget for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-budgets-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-budgets-to-keys) -
model_rpm_limit: Optional[float] - Model-specific rpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
model_tpm_limit: Optional[float] - Model-specific tpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
spend: Optional[float] - Amount spent by user. Default is 0. Will be updated by
proxy whenever user is used. You can set duration as seconds ("30s"), minutes
("30m"), hours ("30h"), days ("30d"), months ("1mo"). - team_id: Optional[str] -
@@ -439,7 +439,7 @@ class UserResource(SyncAPIResource):
self,
*,
user_ids: List[str],
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -464,9 +464,8 @@ class UserResource(SyncAPIResource):
- user_ids: List[str] - The list of user id's to be deleted.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -476,7 +475,7 @@ class UserResource(SyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return self._post(
"/user/delete",
body=maybe_transform({"user_ids": user_ids}, user_delete_params.UserDeleteParams),
@@ -505,7 +504,7 @@ class UserResource(SyncAPIResource):
Example request
```
curl -X GET 'http://localhost:4000/user/info?user_id=krrish7%40berri.ai' --header 'Authorization: Bearer sk-1234'
curl -X GET 'http://localhost:4000/user/info?user_id=dev7%40hanzo.ai' --header 'Authorization: Bearer sk-1234'
```
Args:
@@ -593,8 +592,8 @@ class AsyncUserResource(AsyncAPIResource):
"""Use this to create a new INTERNAL user with a budget.
Internal Users can access
LiteLLM Admin UI to make keys, request access to models. This creates a new user
and generates a new api key for the new user. The new api key is returned.
LLM Admin UI to make keys, request access to models. This creates a new user and
generates a new api key for the new user. The new api key is returned.
Returns user id, budget + new key.
@@ -610,7 +609,7 @@ class AsyncUserResource(AsyncAPIResource):
- user_role: Optional[str] - Specify a user role - "proxy_admin",
"proxy_admin_viewer", "internal_user", "internal_user_viewer", "team",
"customer". Info about each role here:
`https://github.com/BerriAI/litellm/litellm/proxy/_types.py#L20`
`https://github.com/hanzoai/llm/llm/proxy/_types.py#L20`
- max_budget: Optional[float] - Specify max budget for a given user.
- budget_duration: Optional[str] - Budget is reset at the end of specified
duration. If not set, budget is never reset. You can set duration as seconds
@@ -625,29 +624,29 @@ class AsyncUserResource(AsyncAPIResource):
- auto_create_key: bool - Default=True. Flag used for returning a key as part of
the /user/new response
- aliases: Optional[dict] - Model aliases for the user -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases)
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases)
- config: Optional[dict] - [DEPRECATED PARAM] User-specific config.
- allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request-
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request-
- blocked: Optional[bool] - [Not Implemented Yet] Whether the user is blocked.
- guardrails: Optional[List[str]] - [Not Implemented Yet] List of active
guardrails for the user
- permissions: Optional[dict] - [Not Implemented Yet] User-specific permissions,
eg. turning off pii masking.
- metadata: Optional[dict] - Metadata for user, store information for user.
Example metadata = {"team": "core-infra", "app": "app2", "email":
"[email protected]" }
Example metadata = {"team": "core-infra", "app": "app2", "email": "[email protected]"
}
- max_parallel_requests: Optional[int] - Rate limit a user based on the number
of parallel requests. Raises 429 error, if user's parallel requests > x.
- soft_budget: Optional[float] - Get alerts when user crosses given budget,
doesn't block requests.
- model_max_budget: Optional[dict] - Model-specific max budget for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-budgets-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-budgets-to-keys)
- model_rpm_limit: Optional[float] - Model-specific rpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
- model_tpm_limit: Optional[float] - Model-specific tpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys)
- spend: Optional[float] - Amount spent by user. Default is 0. Will be updated
by proxy whenever user is used. You can set duration as seconds ("30s"),
minutes ("30m"), hours ("30h"), days ("30d"), months ("1mo").
@@ -764,7 +763,7 @@ class AsyncUserResource(AsyncAPIResource):
```
curl --location 'http://0.0.0.0:4000/user/update' --header 'Authorization: Bearer sk-1234' --header 'Content-Type: application/json' --data '{
"user_id": "test-litellm-user-4",
"user_id": "test-llm-user-4",
"user_role": "proxy_admin_viewer"
}'
```
@@ -778,7 +777,7 @@ class AsyncUserResource(AsyncAPIResource):
user_role: Optional[str] - Specify a user role - "proxy_admin",
"proxy_admin_viewer", "internal_user", "internal_user_viewer", "team",
"customer". Info about each role here:
`https://github.com/BerriAI/litellm/litellm/proxy/_types.py#L20` - max_budget:
`https://github.com/hanzoai/llm/llm/proxy/_types.py#L20` - max_budget:
Optional[float] - Specify max budget for a given user. - budget_duration:
Optional[str] - Budget is reset at the end of specified duration. If not set,
budget is never reset. You can set duration as seconds ("30s"), minutes ("30m"),
@@ -789,27 +788,27 @@ class AsyncUserResource(AsyncAPIResource):
(Requests per minute) - auto_create_key: bool - Default=True. Flag used for
returning a key as part of the /user/new response - aliases: Optional[dict] -
Model aliases for the user -
[Docs](https://litellm.vercel.app/docs/proxy/virtual_keys#model-aliases) -
config: Optional[dict] - [DEPRECATED PARAM] User-specific config. -
[Docs](https://llm.vercel.app/docs/proxy/virtual_keys#model-aliases) - config:
Optional[dict] - [DEPRECATED PARAM] User-specific config. -
allowed_cache_controls: Optional[list] - List of allowed cache control values.
Example - ["no-cache", "no-store"]. See all values -
https://docs.litellm.ai/docs/proxy/caching#turn-on--off-caching-per-request- -
https://docs.llm.ai/docs/proxy/caching#turn-on--off-caching-per-request- -
blocked: Optional[bool] - [Not Implemented Yet] Whether the user is blocked. -
guardrails: Optional[List[str]] - [Not Implemented Yet] List of active
guardrails for the user - permissions: Optional[dict] - [Not Implemented Yet]
User-specific permissions, eg. turning off pii masking. - metadata:
Optional[dict] - Metadata for user, store information for user. Example metadata
= {"team": "core-infra", "app": "app2", "email": "ishaan@berri.ai" } -
= {"team": "core-infra", "app": "app2", "email": "z@hanzo.ai" } -
max_parallel_requests: Optional[int] - Rate limit a user based on the number of
parallel requests. Raises 429 error, if user's parallel requests > x. -
soft_budget: Optional[float] - Get alerts when user crosses given budget,
doesn't block requests. - model_max_budget: Optional[dict] - Model-specific max
budget for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-budgets-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-budgets-to-keys) -
model_rpm_limit: Optional[float] - Model-specific rpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
model_tpm_limit: Optional[float] - Model-specific tpm limit for user.
[Docs](https://docs.litellm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
[Docs](https://docs.llm.ai/docs/proxy/users#add-model-specific-limits-to-keys) -
spend: Optional[float] - Amount spent by user. Default is 0. Will be updated by
proxy whenever user is used. You can set duration as seconds ("30s"), minutes
("30m"), hours ("30h"), days ("30d"), months ("1mo"). - team_id: Optional[str] -
@@ -937,7 +936,7 @@ class AsyncUserResource(AsyncAPIResource):
self,
*,
user_ids: List[str],
litellm_changed_by: str | NotGiven = NOT_GIVEN,
llm_changed_by: str | NotGiven = NOT_GIVEN,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
@@ -962,9 +961,8 @@ class AsyncUserResource(AsyncAPIResource):
- user_ids: List[str] - The list of user id's to be deleted.
Args:
litellm_changed_by: The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
llm_changed_by: The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
extra_headers: Send extra headers
@@ -974,7 +972,7 @@ class AsyncUserResource(AsyncAPIResource):
timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {**strip_not_given({"litellm-changed-by": litellm_changed_by}), **(extra_headers or {})}
extra_headers = {**strip_not_given({"llm-changed-by": llm_changed_by}), **(extra_headers or {})}
return await self._post(
"/user/delete",
body=await async_maybe_transform({"user_ids": user_ids}, user_delete_params.UserDeleteParams),
@@ -1003,7 +1001,7 @@ class AsyncUserResource(AsyncAPIResource):
Example request
```
curl -X GET 'http://localhost:4000/user/info?user_id=krrish7%40berri.ai' --header 'Authorization: Bearer sk-1234'
curl -X GET 'http://localhost:4000/user/info?user_id=dev7%40hanzo.ai' --header 'Authorization: Bearer sk-1234'
```
Args:
+2 -2
View File
@@ -63,7 +63,7 @@ class UtilsResource(SyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Returns supported openai params for a given litellm model name
"""Returns supported openai params for a given llm model name
e.g.
@@ -272,7 +272,7 @@ class AsyncUtilsResource(AsyncAPIResource):
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""Returns supported openai params for a given litellm model name
"""Returns supported openai params for a given llm model name
e.g.
+20 -20
View File
@@ -50,9 +50,9 @@ class VertexAIResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -85,9 +85,9 @@ class VertexAIResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -120,9 +120,9 @@ class VertexAIResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -155,9 +155,9 @@ class VertexAIResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -190,9 +190,9 @@ class VertexAIResource(SyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -246,9 +246,9 @@ class AsyncVertexAIResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -281,9 +281,9 @@ class AsyncVertexAIResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -316,9 +316,9 @@ class AsyncVertexAIResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -351,9 +351,9 @@ class AsyncVertexAIResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
@@ -386,9 +386,9 @@ class AsyncVertexAIResource(AsyncAPIResource):
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> object:
"""
Call LiteLLM proxy via Vertex AI SDK.
Call LLM proxy via Vertex AI SDK.
[Docs](https://docs.litellm.ai/docs/pass_through/vertex_ai)
[Docs](https://docs.llm.ai/docs/pass_through/vertex_ai)
Args:
extra_headers: Send extra headers
+4 -10
View File
@@ -3,8 +3,6 @@
from __future__ import annotations
from .member import Member as Member
from .user_roles import UserRoles as UserRoles
from .budget_table import BudgetTable as BudgetTable
from .member_param import MemberParam as MemberParam
from .key_list_params import KeyListParams as KeyListParams
from .file_list_params import FileListParams as FileListParams
@@ -32,16 +30,13 @@ from .user_update_params import UserUpdateParams as UserUpdateParams
from .batch_create_params import BatchCreateParams as BatchCreateParams
from .cache_ping_response import CachePingResponse as CachePingResponse
from .key_generate_params import KeyGenerateParams as KeyGenerateParams
from .lite_llm_spend_logs import LiteLlmSpendLogs as LiteLlmSpendLogs
from .lite_llm_team_table import LiteLlmTeamTable as LiteLlmTeamTable
from .lite_llm_user_table import LiteLlmUserTable as LiteLlmUserTable
from .model_create_params import ModelCreateParams as ModelCreateParams
from .model_delete_params import ModelDeleteParams as ModelDeleteParams
from .team_unblock_params import TeamUnblockParams as TeamUnblockParams
from .budget_create_params import BudgetCreateParams as BudgetCreateParams
from .budget_delete_params import BudgetDeleteParams as BudgetDeleteParams
from .budget_update_params import BudgetUpdateParams as BudgetUpdateParams
from .lite_llm_model_table import LiteLlmModelTable as LiteLlmModelTable
from .team_create_response import TeamCreateResponse as TeamCreateResponse
from .user_create_response import UserCreateResponse as UserCreateResponse
from .batch_retrieve_params import BatchRetrieveParams as BatchRetrieveParams
from .customer_block_params import CustomerBlockParams as CustomerBlockParams
@@ -58,10 +53,8 @@ from .customer_unblock_params import CustomerUnblockParams as CustomerUnblockPar
from .embedding_create_params import EmbeddingCreateParams as EmbeddingCreateParams
from .guardrail_list_response import GuardrailListResponse as GuardrailListResponse
from .health_check_all_params import HealthCheckAllParams as HealthCheckAllParams
from .lite_llm_end_user_table import LiteLlmEndUserTable as LiteLlmEndUserTable
from .completion_create_params import CompletionCreateParams as CompletionCreateParams
from .credential_create_params import CredentialCreateParams as CredentialCreateParams
from .credential_update_params import CredentialUpdateParams as CredentialUpdateParams
from .key_retrieve_info_params import KeyRetrieveInfoParams as KeyRetrieveInfoParams
from .spend_list_logs_response import SpendListLogsResponse as SpendListLogsResponse
from .spend_list_tags_response import SpendListTagsResponse as SpendListTagsResponse
@@ -84,20 +77,21 @@ from .health_check_services_params import HealthCheckServicesParams as HealthChe
from .key_regenerate_by_key_params import KeyRegenerateByKeyParams as KeyRegenerateByKeyParams
from .organization_create_response import OrganizationCreateResponse as OrganizationCreateResponse
from .organization_delete_response import OrganizationDeleteResponse as OrganizationDeleteResponse
from .organization_update_response import OrganizationUpdateResponse as OrganizationUpdateResponse
from .spend_calculate_spend_params import SpendCalculateSpendParams as SpendCalculateSpendParams
from .customer_retrieve_info_params import CustomerRetrieveInfoParams as CustomerRetrieveInfoParams
from .organization_membership_table import OrganizationMembershipTable as OrganizationMembershipTable
from .util_transform_request_params import UtilTransformRequestParams as UtilTransformRequestParams
from .organization_add_member_params import OrganizationAddMemberParams as OrganizationAddMemberParams
from .provider_list_budgets_response import ProviderListBudgetsResponse as ProviderListBudgetsResponse
from .batch_list_with_provider_params import BatchListWithProviderParams as BatchListWithProviderParams
from .customer_retrieve_info_response import CustomerRetrieveInfoResponse as CustomerRetrieveInfoResponse
from .delete_create_allowed_ip_params import DeleteCreateAllowedIPParams as DeleteCreateAllowedIPParams
from .organization_table_with_members import OrganizationTableWithMembers as OrganizationTableWithMembers
from .util_transform_request_response import UtilTransformRequestResponse as UtilTransformRequestResponse
from .model_group_retrieve_info_params import ModelGroupRetrieveInfoParams as ModelGroupRetrieveInfoParams
from .organization_add_member_response import OrganizationAddMemberResponse as OrganizationAddMemberResponse
from .organization_delete_member_params import OrganizationDeleteMemberParams as OrganizationDeleteMemberParams
from .organization_update_member_params import OrganizationUpdateMemberParams as OrganizationUpdateMemberParams
from .organization_update_member_response import OrganizationUpdateMemberResponse as OrganizationUpdateMemberResponse
from .util_get_supported_openai_params_params import (
UtilGetSupportedOpenAIParamsParams as UtilGetSupportedOpenAIParamsParams,
)
+1 -1
View File
@@ -14,7 +14,7 @@ class CachePingResponse(BaseModel):
health_check_cache_params: Optional[object] = None
litellm_cache_params: Optional[str] = None
llm_cache_params: Optional[str] = None
ping_response: Optional[bool] = None
@@ -16,7 +16,7 @@ class PassThroughEndpointCreateParams(TypedDict, total=False):
"""
path: Required[str]
"""The route to be added to the LiteLLM Proxy Server."""
"""The route to be added to the LLM Proxy Server."""
target: Required[str]
"""The URL to which requests for this path should be forwarded."""
@@ -15,7 +15,7 @@ class PassThroughGenericEndpoint(BaseModel):
"""
path: str
"""The route to be added to the LiteLLM Proxy Server."""
"""The route to be added to the LLM Proxy Server."""
target: str
"""The URL to which requests for this path should be forwarded."""
@@ -2,6 +2,7 @@
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
__all__ = ["CredentialCreateParams"]
@@ -12,4 +13,6 @@ class CredentialCreateParams(TypedDict, total=False):
credential_name: Required[str]
credential_values: Required[object]
credential_values: Optional[object]
model_id: Optional[str]
@@ -1,17 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Required, Annotated, TypedDict
from .._utils import PropertyInfo
__all__ = ["CredentialUpdateParams"]
class CredentialUpdateParams(TypedDict, total=False):
credential_info: Required[object]
body_credential_name: Required[Annotated[str, PropertyInfo(alias="credential_name")]]
credential_values: Required[object]
+41 -5
View File
@@ -1,10 +1,46 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing_extensions import TypeAlias
from typing import List, Optional
from typing_extensions import Literal, TypeAlias
from .lite_llm_end_user_table import LiteLlmEndUserTable
from pydantic import Field as FieldInfo
__all__ = ["CustomerListResponse"]
from .._models import BaseModel
CustomerListResponse: TypeAlias = List[LiteLlmEndUserTable]
__all__ = ["CustomerListResponse", "CustomerListResponseItem", "CustomerListResponseItemLlmBudgetTable"]
class CustomerListResponseItemLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class CustomerListResponseItem(BaseModel):
blocked: bool
user_id: str
alias: Optional[str] = None
allowed_model_region: Optional[Literal["eu", "us"]] = None
default_model: Optional[str] = None
llm_budget_table: Optional[CustomerListResponseItemLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
CustomerListResponse: TypeAlias = List[CustomerListResponseItem]
@@ -1,15 +1,16 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from typing_extensions import Literal
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = ["BudgetTable"]
__all__ = ["CustomerRetrieveInfoResponse", "LlmBudgetTable"]
class BudgetTable(BaseModel):
class LlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
@@ -23,3 +24,20 @@ class BudgetTable(BaseModel):
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class CustomerRetrieveInfoResponse(BaseModel):
blocked: bool
user_id: str
alias: Optional[str] = None
allowed_model_region: Optional[Literal["eu", "us"]] = None
default_model: Optional[str] = None
llm_budget_table: Optional[LlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
+1 -1
View File
@@ -41,7 +41,7 @@ class GenerateKeyResponse(BaseModel):
key_name: Optional[str] = None
litellm_budget_table: Optional[object] = None
llm_budget_table: Optional[object] = None
max_budget: Optional[float] = None
@@ -1,10 +1,54 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from ..lite_llm_spend_logs import LiteLlmSpendLogs
from pydantic import Field as FieldInfo
__all__ = ["SpendListTagsResponse"]
from ..._models import BaseModel
SpendListTagsResponse: TypeAlias = List[LiteLlmSpendLogs]
__all__ = ["SpendListTagsResponse", "SpendListTagsResponseItem"]
class SpendListTagsResponseItem(BaseModel):
api_key: str
call_type: str
end_time: Union[str, datetime, None] = FieldInfo(alias="endTime", default=None)
messages: Union[str, List[object], object, None] = None
request_id: str
response: Union[str, List[object], object, None] = None
start_time: Union[str, datetime, None] = FieldInfo(alias="startTime", default=None)
api_base: Optional[str] = None
cache_hit: Optional[str] = None
cache_key: Optional[str] = None
completion_tokens: Optional[int] = None
metadata: Optional[object] = None
model: Optional[str] = None
prompt_tokens: Optional[int] = None
request_tags: Optional[object] = None
requester_ip_address: Optional[str] = None
spend: Optional[float] = None
total_tokens: Optional[int] = None
user: Optional[str] = None
SpendListTagsResponse: TypeAlias = List[SpendListTagsResponseItem]
@@ -1,10 +1,54 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from ..lite_llm_spend_logs import LiteLlmSpendLogs
from pydantic import Field as FieldInfo
__all__ = ["SpendRetrieveReportResponse"]
from ..._models import BaseModel
SpendRetrieveReportResponse: TypeAlias = List[LiteLlmSpendLogs]
__all__ = ["SpendRetrieveReportResponse", "SpendRetrieveReportResponseItem"]
class SpendRetrieveReportResponseItem(BaseModel):
api_key: str
call_type: str
end_time: Union[str, datetime, None] = FieldInfo(alias="endTime", default=None)
messages: Union[str, List[object], object, None] = None
request_id: str
response: Union[str, List[object], object, None] = None
start_time: Union[str, datetime, None] = FieldInfo(alias="startTime", default=None)
api_base: Optional[str] = None
cache_hit: Optional[str] = None
cache_key: Optional[str] = None
completion_tokens: Optional[int] = None
metadata: Optional[object] = None
model: Optional[str] = None
prompt_tokens: Optional[int] = None
request_tags: Optional[object] = None
requester_ip_address: Optional[str] = None
spend: Optional[float] = None
total_tokens: Optional[int] = None
user: Optional[str] = None
SpendRetrieveReportResponse: TypeAlias = List[SpendRetrieveReportResponseItem]
+4 -4
View File
@@ -4,10 +4,10 @@ from typing import List, Union, Optional
from .._models import BaseModel
__all__ = ["GuardrailListResponse", "Guardrail", "GuardrailLitellmParams"]
__all__ = ["GuardrailListResponse", "Guardrail", "GuardrailLlmParams"]
class GuardrailLitellmParams(BaseModel):
class GuardrailLlmParams(BaseModel):
guardrail: str
mode: Union[str, List[str]]
@@ -20,8 +20,8 @@ class Guardrail(BaseModel):
guardrail_name: str
litellm_params: GuardrailLitellmParams
"""The returned LiteLLM Params object for /guardrails/list"""
llm_params: GuardrailLlmParams
"""The returned LLM Params object for /guardrails/list"""
class GuardrailListResponse(BaseModel):
+3 -4
View File
@@ -12,9 +12,8 @@ __all__ = ["KeyBlockParams"]
class KeyBlockParams(TypedDict, total=False):
key: Required[str]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+1 -1
View File
@@ -35,7 +35,7 @@ class KeyBlockResponse(BaseModel):
key_name: Optional[str] = None
litellm_budget_table: Optional[object] = None
llm_budget_table: Optional[object] = None
max_budget: Optional[float] = None
+3 -4
View File
@@ -15,9 +15,8 @@ class KeyDeleteParams(TypedDict, total=False):
keys: Optional[List[str]]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+3 -4
View File
@@ -65,9 +65,8 @@ class KeyGenerateParams(TypedDict, total=False):
user_id: Optional[str]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+12 -3
View File
@@ -8,7 +8,6 @@ from pydantic import Field as FieldInfo
from .member import Member
from .._models import BaseModel
from .user_roles import UserRoles
__all__ = ["KeyListResponse", "Key", "KeyUserAPIKeyAuth"]
@@ -52,7 +51,7 @@ class KeyUserAPIKeyAuth(BaseModel):
last_refreshed_at: Optional[float] = None
litellm_budget_table: Optional[object] = None
llm_budget_table: Optional[object] = None
max_budget: Optional[float] = None
@@ -118,7 +117,17 @@ class KeyUserAPIKeyAuth(BaseModel):
user_id: Optional[str] = None
user_role: Optional[UserRoles] = None
user_role: Optional[
Literal[
"proxy_admin",
"proxy_admin_viewer",
"org_admin",
"internal_user",
"internal_user_viewer",
"team",
"customer",
]
] = None
"""
Admin Roles: PROXY_ADMIN: admin over the platform PROXY_ADMIN_VIEW_ONLY: can
login, view all own keys, view all spend ORG_ADMIN: admin over a specific
@@ -67,9 +67,8 @@ class KeyRegenerateByKeyParams(TypedDict, total=False):
user_id: Optional[str]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+3 -4
View File
@@ -12,9 +12,8 @@ __all__ = ["KeyUnblockParams"]
class KeyUnblockParams(TypedDict, total=False):
key: Required[str]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+3 -4
View File
@@ -66,9 +66,8 @@ class KeyUpdateParams(TypedDict, total=False):
user_id: Optional[str]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
@@ -1,26 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from typing_extensions import Literal
from .._models import BaseModel
from .budget_table import BudgetTable
__all__ = ["LiteLlmEndUserTable"]
class LiteLlmEndUserTable(BaseModel):
blocked: bool
user_id: str
alias: Optional[str] = None
allowed_model_region: Optional[Literal["eu", "us"]] = None
default_model: Optional[str] = None
litellm_budget_table: Optional[BudgetTable] = None
"""Represents user-controllable params for a LiteLLM_BudgetTable record"""
spend: Optional[float] = None
-17
View File
@@ -1,17 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Union
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = ["LiteLlmModelTable"]
class LiteLlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
-50
View File
@@ -1,50 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = ["LiteLlmSpendLogs"]
class LiteLlmSpendLogs(BaseModel):
api_key: str
call_type: str
end_time: Union[str, datetime, None] = FieldInfo(alias="endTime", default=None)
messages: Union[str, List[object], object, None] = None
request_id: str
response: Union[str, List[object], object, None] = None
start_time: Union[str, datetime, None] = FieldInfo(alias="startTime", default=None)
api_base: Optional[str] = None
cache_hit: Optional[str] = None
cache_key: Optional[str] = None
completion_tokens: Optional[int] = None
metadata: Optional[object] = None
model: Optional[str] = None
prompt_tokens: Optional[int] = None
request_tags: Optional[object] = None
requester_ip_address: Optional[str] = None
spend: Optional[float] = None
total_tokens: Optional[int] = None
user: Optional[str] = None
-45
View File
@@ -1,45 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .._models import BaseModel
from .organization_membership_table import OrganizationMembershipTable
__all__ = ["LiteLlmUserTable"]
class LiteLlmUserTable(BaseModel):
user_id: str
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
max_budget: Optional[float] = None
metadata: Optional[object] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
api_model_spend: Optional[object] = FieldInfo(alias="model_spend", default=None)
models: Optional[List[object]] = None
organization_memberships: Optional[List[OrganizationMembershipTable]] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
sso_user_id: Optional[str] = None
teams: Optional[List[str]] = None
tpm_limit: Optional[int] = None
user_email: Optional[str] = None
user_role: Optional[str] = None
+1 -1
View File
@@ -9,4 +9,4 @@ __all__ = ["InfoListParams"]
class InfoListParams(TypedDict, total=False):
litellm_model_id: Optional[str]
llm_model_id: Optional[str]
@@ -8,21 +8,21 @@ from typing_extensions import TypeAlias, TypedDict
from ..model_info_param import ModelInfoParam
from ..configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam
__all__ = ["UpdateFullParams", "LitellmParams", "LitellmParamsConfigurableClientsideAuthParam"]
__all__ = ["UpdateFullParams", "LlmParams", "LlmParamsConfigurableClientsideAuthParam"]
class UpdateFullParams(TypedDict, total=False):
litellm_params: Optional[LitellmParams]
llm_params: Optional[LlmParams]
model_info: Optional[ModelInfoParam]
model_name: Optional[str]
LitellmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
LlmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
class LitellmParamsTyped(TypedDict, total=False):
class LlmParamsTyped(TypedDict, total=False):
api_base: Optional[str]
api_key: Optional[str]
@@ -37,7 +37,7 @@ class LitellmParamsTyped(TypedDict, total=False):
budget_duration: Optional[str]
configurable_clientside_auth_params: Optional[List[LitellmParamsConfigurableClientsideAuthParam]]
configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]]
custom_llm_provider: Optional[str]
@@ -45,7 +45,7 @@ class LitellmParamsTyped(TypedDict, total=False):
input_cost_per_token: Optional[float]
litellm_trace_id: Optional[str]
llm_trace_id: Optional[str]
max_budget: Optional[float]
@@ -86,4 +86,4 @@ class LitellmParamsTyped(TypedDict, total=False):
watsonx_region_name: Optional[str]
LitellmParams: TypeAlias = Union[LitellmParamsTyped, Dict[str, object]]
LlmParams: TypeAlias = Union[LlmParamsTyped, Dict[str, object]]
@@ -8,21 +8,21 @@ from typing_extensions import TypeAlias, TypedDict
from ..model_info_param import ModelInfoParam
from ..configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam
__all__ = ["UpdatePartialParams", "LitellmParams", "LitellmParamsConfigurableClientsideAuthParam"]
__all__ = ["UpdatePartialParams", "LlmParams", "LlmParamsConfigurableClientsideAuthParam"]
class UpdatePartialParams(TypedDict, total=False):
litellm_params: Optional[LitellmParams]
llm_params: Optional[LlmParams]
model_info: Optional[ModelInfoParam]
model_name: Optional[str]
LitellmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
LlmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
class LitellmParamsTyped(TypedDict, total=False):
class LlmParamsTyped(TypedDict, total=False):
api_base: Optional[str]
api_key: Optional[str]
@@ -37,7 +37,7 @@ class LitellmParamsTyped(TypedDict, total=False):
budget_duration: Optional[str]
configurable_clientside_auth_params: Optional[List[LitellmParamsConfigurableClientsideAuthParam]]
configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]]
custom_llm_provider: Optional[str]
@@ -45,7 +45,7 @@ class LitellmParamsTyped(TypedDict, total=False):
input_cost_per_token: Optional[float]
litellm_trace_id: Optional[str]
llm_trace_id: Optional[str]
max_budget: Optional[float]
@@ -86,4 +86,4 @@ class LitellmParamsTyped(TypedDict, total=False):
watsonx_region_name: Optional[str]
LitellmParams: TypeAlias = Union[LitellmParamsTyped, Dict[str, object]]
LlmParams: TypeAlias = Union[LlmParamsTyped, Dict[str, object]]
+8 -8
View File
@@ -8,22 +8,22 @@ from typing_extensions import Required, TypeAlias, TypedDict
from .model_info_param import ModelInfoParam
from .configurable_clientside_params_custom_auth_param import ConfigurableClientsideParamsCustomAuthParam
__all__ = ["ModelCreateParams", "LitellmParams", "LitellmParamsConfigurableClientsideAuthParam"]
__all__ = ["ModelCreateParams", "LlmParams", "LlmParamsConfigurableClientsideAuthParam"]
class ModelCreateParams(TypedDict, total=False):
litellm_params: Required[LitellmParams]
"""LiteLLM Params with 'model' requirement - used for completions"""
llm_params: Required[LlmParams]
"""LLM Params with 'model' requirement - used for completions"""
model_info: Required[ModelInfoParam]
model_name: Required[str]
LitellmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
LlmParamsConfigurableClientsideAuthParam: TypeAlias = Union[str, ConfigurableClientsideParamsCustomAuthParam]
class LitellmParamsTyped(TypedDict, total=False):
class LlmParamsTyped(TypedDict, total=False):
model: Required[str]
api_base: Optional[str]
@@ -40,7 +40,7 @@ class LitellmParamsTyped(TypedDict, total=False):
budget_duration: Optional[str]
configurable_clientside_auth_params: Optional[List[LitellmParamsConfigurableClientsideAuthParam]]
configurable_clientside_auth_params: Optional[List[LlmParamsConfigurableClientsideAuthParam]]
custom_llm_provider: Optional[str]
@@ -48,7 +48,7 @@ class LitellmParamsTyped(TypedDict, total=False):
input_cost_per_token: Optional[float]
litellm_trace_id: Optional[str]
llm_trace_id: Optional[str]
max_budget: Optional[float]
@@ -87,4 +87,4 @@ class LitellmParamsTyped(TypedDict, total=False):
watsonx_region_name: Optional[str]
LitellmParams: TypeAlias = Union[LitellmParamsTyped, Dict[str, object]]
LlmParams: TypeAlias = Union[LlmParamsTyped, Dict[str, object]]
+2
View File
@@ -10,3 +10,5 @@ __all__ = ["ModelListParams"]
class ModelListParams(TypedDict, total=False):
return_wildcard_routes: Optional[bool]
team_id: Optional[str]
@@ -4,3 +4,4 @@ from __future__ import annotations
from .info_retrieve_params import InfoRetrieveParams as InfoRetrieveParams
from .info_deprecated_params import InfoDeprecatedParams as InfoDeprecatedParams
from .info_retrieve_response import InfoRetrieveResponse as InfoRetrieveResponse
@@ -0,0 +1,141 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .. import member
from ..._models import BaseModel
__all__ = ["InfoRetrieveResponse", "LlmBudgetTable", "Member", "MemberLlmBudgetTable", "Team", "TeamLlmModelTable"]
class LlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class MemberLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class Member(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[MemberLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class TeamLlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class Team(BaseModel):
team_id: str
admins: Optional[List[object]] = None
blocked: Optional[bool] = None
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
created_at: Optional[datetime] = None
llm_model_table: Optional[TeamLlmModelTable] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
members: Optional[List[object]] = None
members_with_roles: Optional[List[member.Member]] = None
metadata: Optional[object] = None
api_model_id: Optional[int] = FieldInfo(alias="model_id", default=None)
models: Optional[List[object]] = None
organization_id: Optional[str] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
team_alias: Optional[str] = None
tpm_limit: Optional[int] = None
class InfoRetrieveResponse(BaseModel):
budget_id: str
created_at: datetime
created_by: str
models: List[str]
updated_at: datetime
updated_by: str
llm_budget_table: Optional[LlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
members: Optional[List[Member]] = None
metadata: Optional[object] = None
organization_alias: Optional[str] = None
organization_id: Optional[str] = None
spend: Optional[float] = None
teams: Optional[List[Team]] = None
@@ -1,17 +1,133 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .._models import BaseModel
from .lite_llm_user_table import LiteLlmUserTable
from .organization_membership_table import OrganizationMembershipTable
__all__ = ["OrganizationAddMemberResponse"]
__all__ = [
"OrganizationAddMemberResponse",
"UpdatedOrganizationMembership",
"UpdatedOrganizationMembershipLlmBudgetTable",
"UpdatedUser",
"UpdatedUserOrganizationMembership",
"UpdatedUserOrganizationMembershipLlmBudgetTable",
]
class UpdatedOrganizationMembershipLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class UpdatedOrganizationMembership(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[UpdatedOrganizationMembershipLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class UpdatedUserOrganizationMembershipLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class UpdatedUserOrganizationMembership(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[UpdatedUserOrganizationMembershipLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class UpdatedUser(BaseModel):
user_id: str
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
max_budget: Optional[float] = None
metadata: Optional[object] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
api_model_spend: Optional[object] = FieldInfo(alias="model_spend", default=None)
models: Optional[List[object]] = None
organization_memberships: Optional[List[UpdatedUserOrganizationMembership]] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
sso_user_id: Optional[str] = None
teams: Optional[List[str]] = None
tpm_limit: Optional[int] = None
user_email: Optional[str] = None
user_role: Optional[str] = None
class OrganizationAddMemberResponse(BaseModel):
organization_id: str
updated_organization_memberships: List[OrganizationMembershipTable]
updated_organization_memberships: List[UpdatedOrganizationMembership]
updated_users: List[LiteLlmUserTable]
updated_users: List[UpdatedUser]
@@ -1,10 +1,153 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from .organization_table_with_members import OrganizationTableWithMembers
from pydantic import Field as FieldInfo
__all__ = ["OrganizationDeleteResponse"]
from .member import Member
from .._models import BaseModel
OrganizationDeleteResponse: TypeAlias = List[OrganizationTableWithMembers]
__all__ = [
"OrganizationDeleteResponse",
"OrganizationDeleteResponseItem",
"OrganizationDeleteResponseItemLlmBudgetTable",
"OrganizationDeleteResponseItemMember",
"OrganizationDeleteResponseItemMemberLlmBudgetTable",
"OrganizationDeleteResponseItemTeam",
"OrganizationDeleteResponseItemTeamLlmModelTable",
]
class OrganizationDeleteResponseItemLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class OrganizationDeleteResponseItemMemberLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class OrganizationDeleteResponseItemMember(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[OrganizationDeleteResponseItemMemberLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class OrganizationDeleteResponseItemTeamLlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class OrganizationDeleteResponseItemTeam(BaseModel):
team_id: str
admins: Optional[List[object]] = None
blocked: Optional[bool] = None
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
created_at: Optional[datetime] = None
llm_model_table: Optional[OrganizationDeleteResponseItemTeamLlmModelTable] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
members: Optional[List[object]] = None
members_with_roles: Optional[List[Member]] = None
metadata: Optional[object] = None
api_model_id: Optional[int] = FieldInfo(alias="model_id", default=None)
models: Optional[List[object]] = None
organization_id: Optional[str] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
team_alias: Optional[str] = None
tpm_limit: Optional[int] = None
class OrganizationDeleteResponseItem(BaseModel):
budget_id: str
created_at: datetime
created_by: str
models: List[str]
updated_at: datetime
updated_by: str
llm_budget_table: Optional[OrganizationDeleteResponseItemLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
members: Optional[List[OrganizationDeleteResponseItemMember]] = None
metadata: Optional[object] = None
organization_alias: Optional[str] = None
organization_id: Optional[str] = None
spend: Optional[float] = None
teams: Optional[List[OrganizationDeleteResponseItemTeam]] = None
OrganizationDeleteResponse: TypeAlias = List[OrganizationDeleteResponseItem]
+147 -4
View File
@@ -1,10 +1,153 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from .organization_table_with_members import OrganizationTableWithMembers
from pydantic import Field as FieldInfo
__all__ = ["OrganizationListResponse"]
from .member import Member
from .._models import BaseModel
OrganizationListResponse: TypeAlias = List[OrganizationTableWithMembers]
__all__ = [
"OrganizationListResponse",
"OrganizationListResponseItem",
"OrganizationListResponseItemLlmBudgetTable",
"OrganizationListResponseItemMember",
"OrganizationListResponseItemMemberLlmBudgetTable",
"OrganizationListResponseItemTeam",
"OrganizationListResponseItemTeamLlmModelTable",
]
class OrganizationListResponseItemLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class OrganizationListResponseItemMemberLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class OrganizationListResponseItemMember(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[OrganizationListResponseItemMemberLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class OrganizationListResponseItemTeamLlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class OrganizationListResponseItemTeam(BaseModel):
team_id: str
admins: Optional[List[object]] = None
blocked: Optional[bool] = None
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
created_at: Optional[datetime] = None
llm_model_table: Optional[OrganizationListResponseItemTeamLlmModelTable] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
members: Optional[List[object]] = None
members_with_roles: Optional[List[Member]] = None
metadata: Optional[object] = None
api_model_id: Optional[int] = FieldInfo(alias="model_id", default=None)
models: Optional[List[object]] = None
organization_id: Optional[str] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
team_alias: Optional[str] = None
tpm_limit: Optional[int] = None
class OrganizationListResponseItem(BaseModel):
budget_id: str
created_at: datetime
created_by: str
models: List[str]
updated_at: datetime
updated_by: str
llm_budget_table: Optional[OrganizationListResponseItemLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
members: Optional[List[OrganizationListResponseItemMember]] = None
metadata: Optional[object] = None
organization_alias: Optional[str] = None
organization_id: Optional[str] = None
spend: Optional[float] = None
teams: Optional[List[OrganizationListResponseItemTeam]] = None
OrganizationListResponse: TypeAlias = List[OrganizationListResponseItem]
@@ -1,30 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from datetime import datetime
from .._models import BaseModel
from .budget_table import BudgetTable
__all__ = ["OrganizationMembershipTable"]
class OrganizationMembershipTable(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
litellm_budget_table: Optional[BudgetTable] = None
"""Represents user-controllable params for a LiteLLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
@@ -1,40 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from datetime import datetime
from .._models import BaseModel
from .budget_table import BudgetTable
from .lite_llm_team_table import LiteLlmTeamTable
from .organization_membership_table import OrganizationMembershipTable
__all__ = ["OrganizationTableWithMembers"]
class OrganizationTableWithMembers(BaseModel):
budget_id: str
created_at: datetime
created_by: str
models: List[str]
updated_at: datetime
updated_by: str
litellm_budget_table: Optional[BudgetTable] = None
"""Represents user-controllable params for a LiteLLM_BudgetTable record"""
members: Optional[List[OrganizationMembershipTable]] = None
metadata: Optional[object] = None
organization_alias: Optional[str] = None
organization_id: Optional[str] = None
spend: Optional[float] = None
teams: Optional[List[LiteLlmTeamTable]] = None
@@ -3,9 +3,7 @@
from __future__ import annotations
from typing import Optional
from typing_extensions import Required, TypedDict
from .user_roles import UserRoles
from typing_extensions import Literal, Required, TypedDict
__all__ = ["OrganizationUpdateMemberParams"]
@@ -15,7 +13,17 @@ class OrganizationUpdateMemberParams(TypedDict, total=False):
max_budget_in_organization: Optional[float]
role: Optional[UserRoles]
role: Optional[
Literal[
"proxy_admin",
"proxy_admin_viewer",
"org_admin",
"internal_user",
"internal_user_viewer",
"team",
"customer",
]
]
"""
Admin Roles: PROXY_ADMIN: admin over the platform PROXY_ADMIN_VIEW_ONLY: can
login, view all own keys, view all spend ORG_ADMIN: admin over a specific
@@ -0,0 +1,47 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .._models import BaseModel
__all__ = ["OrganizationUpdateMemberResponse", "LlmBudgetTable"]
class LlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class OrganizationUpdateMemberResponse(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[LlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
@@ -0,0 +1,148 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Union, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from . import member
from .._models import BaseModel
__all__ = [
"OrganizationUpdateResponse",
"LlmBudgetTable",
"Member",
"MemberLlmBudgetTable",
"Team",
"TeamLlmModelTable",
]
class LlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class MemberLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class Member(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[MemberLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class TeamLlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class Team(BaseModel):
team_id: str
admins: Optional[List[object]] = None
blocked: Optional[bool] = None
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
created_at: Optional[datetime] = None
llm_model_table: Optional[TeamLlmModelTable] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
members: Optional[List[object]] = None
members_with_roles: Optional[List[member.Member]] = None
metadata: Optional[object] = None
api_model_id: Optional[int] = FieldInfo(alias="model_id", default=None)
models: Optional[List[object]] = None
organization_id: Optional[str] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
team_alias: Optional[str] = None
tpm_limit: Optional[int] = None
class OrganizationUpdateResponse(BaseModel):
budget_id: str
created_at: datetime
created_by: str
models: List[str]
updated_at: datetime
updated_by: str
llm_budget_table: Optional[LlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
members: Optional[List[Member]] = None
metadata: Optional[object] = None
organization_alias: Optional[str] = None
organization_id: Optional[str] = None
spend: Optional[float] = None
teams: Optional[List[Team]] = None
+48 -4
View File
@@ -1,10 +1,54 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from .lite_llm_spend_logs import LiteLlmSpendLogs
from pydantic import Field as FieldInfo
__all__ = ["SpendListLogsResponse"]
from .._models import BaseModel
SpendListLogsResponse: TypeAlias = List[LiteLlmSpendLogs]
__all__ = ["SpendListLogsResponse", "SpendListLogsResponseItem"]
class SpendListLogsResponseItem(BaseModel):
api_key: str
call_type: str
end_time: Union[str, datetime, None] = FieldInfo(alias="endTime", default=None)
messages: Union[str, List[object], object, None] = None
request_id: str
response: Union[str, List[object], object, None] = None
start_time: Union[str, datetime, None] = FieldInfo(alias="startTime", default=None)
api_base: Optional[str] = None
cache_hit: Optional[str] = None
cache_key: Optional[str] = None
completion_tokens: Optional[int] = None
metadata: Optional[object] = None
model: Optional[str] = None
prompt_tokens: Optional[int] = None
request_tags: Optional[object] = None
requester_ip_address: Optional[str] = None
spend: Optional[float] = None
total_tokens: Optional[int] = None
user: Optional[str] = None
SpendListLogsResponse: TypeAlias = List[SpendListLogsResponseItem]
+48 -4
View File
@@ -1,10 +1,54 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List
from typing import List, Union, Optional
from datetime import datetime
from typing_extensions import TypeAlias
from .lite_llm_spend_logs import LiteLlmSpendLogs
from pydantic import Field as FieldInfo
__all__ = ["SpendListTagsResponse"]
from .._models import BaseModel
SpendListTagsResponse: TypeAlias = List[LiteLlmSpendLogs]
__all__ = ["SpendListTagsResponse", "SpendListTagsResponseItem"]
class SpendListTagsResponseItem(BaseModel):
api_key: str
call_type: str
end_time: Union[str, datetime, None] = FieldInfo(alias="endTime", default=None)
messages: Union[str, List[object], object, None] = None
request_id: str
response: Union[str, List[object], object, None] = None
start_time: Union[str, datetime, None] = FieldInfo(alias="startTime", default=None)
api_base: Optional[str] = None
cache_hit: Optional[str] = None
cache_key: Optional[str] = None
completion_tokens: Optional[int] = None
metadata: Optional[object] = None
model: Optional[str] = None
prompt_tokens: Optional[int] = None
request_tags: Optional[object] = None
requester_ip_address: Optional[str] = None
spend: Optional[float] = None
total_tokens: Optional[int] = None
user: Optional[str] = None
SpendListTagsResponse: TypeAlias = List[SpendListTagsResponseItem]
@@ -17,9 +17,8 @@ class CallbackAddParams(TypedDict, total=False):
callback_type: Optional[Literal["success", "failure", "success_and_failure"]]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+109 -9
View File
@@ -1,36 +1,136 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from typing import List, Union, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .member import Member
from .._models import BaseModel
from .budget_table import BudgetTable
from .lite_llm_user_table import LiteLlmUserTable
from .lite_llm_model_table import LiteLlmModelTable
__all__ = ["TeamAddMemberResponse", "UpdatedTeamMembership"]
__all__ = [
"TeamAddMemberResponse",
"UpdatedTeamMembership",
"UpdatedTeamMembershipLlmBudgetTable",
"UpdatedUser",
"UpdatedUserOrganizationMembership",
"UpdatedUserOrganizationMembershipLlmBudgetTable",
"LlmModelTable",
]
class UpdatedTeamMembershipLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class UpdatedTeamMembership(BaseModel):
budget_id: str
litellm_budget_table: Optional[BudgetTable] = None
"""Represents user-controllable params for a LiteLLM_BudgetTable record"""
llm_budget_table: Optional[UpdatedTeamMembershipLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
team_id: str
user_id: str
class UpdatedUserOrganizationMembershipLlmBudgetTable(BaseModel):
budget_duration: Optional[str] = None
max_budget: Optional[float] = None
max_parallel_requests: Optional[int] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
rpm_limit: Optional[int] = None
soft_budget: Optional[float] = None
tpm_limit: Optional[int] = None
class UpdatedUserOrganizationMembership(BaseModel):
created_at: datetime
organization_id: str
updated_at: datetime
user_id: str
budget_id: Optional[str] = None
llm_budget_table: Optional[UpdatedUserOrganizationMembershipLlmBudgetTable] = None
"""Represents user-controllable params for a LLM_BudgetTable record"""
spend: Optional[float] = None
user: Optional[object] = None
user_role: Optional[str] = None
class UpdatedUser(BaseModel):
user_id: str
budget_duration: Optional[str] = None
budget_reset_at: Optional[datetime] = None
max_budget: Optional[float] = None
metadata: Optional[object] = None
api_model_max_budget: Optional[object] = FieldInfo(alias="model_max_budget", default=None)
api_model_spend: Optional[object] = FieldInfo(alias="model_spend", default=None)
models: Optional[List[object]] = None
organization_memberships: Optional[List[UpdatedUserOrganizationMembership]] = None
rpm_limit: Optional[int] = None
spend: Optional[float] = None
sso_user_id: Optional[str] = None
teams: Optional[List[str]] = None
tpm_limit: Optional[int] = None
user_email: Optional[str] = None
user_role: Optional[str] = None
class LlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class TeamAddMemberResponse(BaseModel):
team_id: str
updated_team_memberships: List[UpdatedTeamMembership]
updated_users: List[LiteLlmUserTable]
updated_users: List[UpdatedUser]
admins: Optional[List[object]] = None
@@ -42,7 +142,7 @@ class TeamAddMemberResponse(BaseModel):
created_at: Optional[datetime] = None
litellm_model_table: Optional[LiteLlmModelTable] = None
llm_model_table: Optional[LlmModelTable] = None
max_budget: Optional[float] = None
+3 -4
View File
@@ -44,9 +44,8 @@ class TeamCreateParams(TypedDict, total=False):
tpm_limit: Optional[int]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
@@ -1,18 +1,25 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from typing import List, Union, Optional
from datetime import datetime
from pydantic import Field as FieldInfo
from .member import Member
from .._models import BaseModel
from .lite_llm_model_table import LiteLlmModelTable
__all__ = ["LiteLlmTeamTable"]
__all__ = ["TeamCreateResponse", "LlmModelTable"]
class LiteLlmTeamTable(BaseModel):
class LlmModelTable(BaseModel):
created_by: str
updated_by: str
api_model_aliases: Union[str, object, None] = FieldInfo(alias="model_aliases", default=None)
class TeamCreateResponse(BaseModel):
team_id: str
admins: Optional[List[object]] = None
@@ -25,7 +32,7 @@ class LiteLlmTeamTable(BaseModel):
created_at: Optional[datetime] = None
litellm_model_table: Optional[LiteLlmModelTable] = None
llm_model_table: Optional[LlmModelTable] = None
max_budget: Optional[float] = None
+3 -4
View File
@@ -13,9 +13,8 @@ __all__ = ["TeamDeleteParams"]
class TeamDeleteParams(TypedDict, total=False):
team_ids: Required[List[str]]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+3 -4
View File
@@ -37,9 +37,8 @@ class TeamUpdateParams(TypedDict, total=False):
tpm_limit: Optional[int]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
+1 -1
View File
@@ -42,7 +42,7 @@ class UserCreateResponse(BaseModel):
key_name: Optional[str] = None
litellm_budget_table: Optional[object] = None
llm_budget_table: Optional[object] = None
max_budget: Optional[float] = None
+3 -4
View File
@@ -13,9 +13,8 @@ __all__ = ["UserDeleteParams"]
class UserDeleteParams(TypedDict, total=False):
user_ids: Required[List[str]]
litellm_changed_by: Annotated[str, PropertyInfo(alias="litellm-changed-by")]
llm_changed_by: Annotated[str, PropertyInfo(alias="llm-changed-by")]
"""
The litellm-changed-by header enables tracking of actions performed by
authorized users on behalf of other users, providing an audit trail for
accountability
The llm-changed-by header enables tracking of actions performed by authorized
users on behalf of other users, providing an audit trail for accountability
"""
-9
View File
@@ -1,9 +0,0 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal, TypeAlias
__all__ = ["UserRoles"]
UserRoles: TypeAlias = Literal[
"proxy_admin", "proxy_admin_viewer", "org_admin", "internal_user", "internal_user_viewer", "team", "customer"
]
+2 -2
View File
@@ -26,7 +26,7 @@ class TestInfo:
@parametrize
def test_method_list_with_all_params(self, client: Hanzo) -> None:
info = client.model.info.list(
litellm_model_id="litellm_model_id",
llm_model_id="llm_model_id",
)
assert_matches_type(object, info, path=["response"])
@@ -66,7 +66,7 @@ class TestAsyncInfo:
@parametrize
async def test_method_list_with_all_params(self, async_client: AsyncHanzo) -> None:
info = await async_client.model.info.list(
litellm_model_id="litellm_model_id",
llm_model_id="llm_model_id",
)
assert_matches_type(object, info, path=["response"])
+8 -8
View File
@@ -27,7 +27,7 @@ class TestUpdate:
@parametrize
def test_method_full_with_all_params(self, client: Hanzo) -> None:
update = client.model.update.full(
litellm_params={
llm_params={
"api_base": "api_base",
"api_key": "api_key",
"api_version": "api_version",
@@ -39,7 +39,7 @@ class TestUpdate:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -111,7 +111,7 @@ class TestUpdate:
def test_method_partial_with_all_params(self, client: Hanzo) -> None:
update = client.model.update.partial(
model_id="model_id",
litellm_params={
llm_params={
"api_base": "api_base",
"api_key": "api_key",
"api_version": "api_version",
@@ -123,7 +123,7 @@ class TestUpdate:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -208,7 +208,7 @@ class TestAsyncUpdate:
@parametrize
async def test_method_full_with_all_params(self, async_client: AsyncHanzo) -> None:
update = await async_client.model.update.full(
litellm_params={
llm_params={
"api_base": "api_base",
"api_key": "api_key",
"api_version": "api_version",
@@ -220,7 +220,7 @@ class TestAsyncUpdate:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -292,7 +292,7 @@ class TestAsyncUpdate:
async def test_method_partial_with_all_params(self, async_client: AsyncHanzo) -> None:
update = await async_client.model.update.partial(
model_id="model_id",
litellm_params={
llm_params={
"api_base": "api_base",
"api_key": "api_key",
"api_version": "api_version",
@@ -304,7 +304,7 @@ class TestAsyncUpdate:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -9,7 +9,7 @@ import pytest
from hanzoai import Hanzo, AsyncHanzo
from tests.utils import assert_matches_type
from hanzoai.types import OrganizationTableWithMembers
from hanzoai.types.organization import InfoRetrieveResponse
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -23,7 +23,7 @@ class TestInfo:
info = client.organization.info.retrieve(
organization_id="organization_id",
)
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -35,7 +35,7 @@ class TestInfo:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
info = response.parse()
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -47,7 +47,7 @@ class TestInfo:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
info = response.parse()
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -95,7 +95,7 @@ class TestAsyncInfo:
info = await async_client.organization.info.retrieve(
organization_id="organization_id",
)
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -107,7 +107,7 @@ class TestAsyncInfo:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
info = await response.parse()
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -119,7 +119,7 @@ class TestAsyncInfo:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
info = await response.parse()
assert_matches_type(OrganizationTableWithMembers, info, path=["response"])
assert_matches_type(InfoRetrieveResponse, info, path=["response"])
assert cast(Any, response.is_closed) is True
+2 -2
View File
@@ -76,7 +76,7 @@ class TestCallback:
callback_name="callback_name",
callback_vars={"foo": "string"},
callback_type="success",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, callback, path=["response"])
@@ -184,7 +184,7 @@ class TestAsyncCallback:
callback_name="callback_name",
callback_vars={"foo": "string"},
callback_type="success",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, callback, path=["response"])
+20 -196
View File
@@ -19,10 +19,20 @@ class TestCredentials:
@pytest.mark.skip()
@parametrize
def test_method_create(self, client: Hanzo) -> None:
credential = client.credentials.create(
credential_info={},
credential_name="credential_name",
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
def test_method_create_with_all_params(self, client: Hanzo) -> None:
credential = client.credentials.create(
credential_info={},
credential_name="credential_name",
credential_values={},
model_id="model_id",
)
assert_matches_type(object, credential, path=["response"])
@@ -32,7 +42,6 @@ class TestCredentials:
response = client.credentials.with_raw_response.create(
credential_info={},
credential_name="credential_name",
credential_values={},
)
assert response.is_closed is True
@@ -46,7 +55,6 @@ class TestCredentials:
with client.credentials.with_streaming_response.create(
credential_info={},
credential_name="credential_name",
credential_values={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -56,102 +64,6 @@ class TestCredentials:
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
def test_method_retrieve(self, client: Hanzo) -> None:
credential = client.credentials.retrieve(
"credential_name",
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
def test_raw_response_retrieve(self, client: Hanzo) -> None:
response = client.credentials.with_raw_response.retrieve(
"credential_name",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
def test_streaming_response_retrieve(self, client: Hanzo) -> None:
with client.credentials.with_streaming_response.retrieve(
"credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
def test_path_params_retrieve(self, client: Hanzo) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `credential_name` but received ''"):
client.credentials.with_raw_response.retrieve(
"",
)
@pytest.mark.skip()
@parametrize
def test_method_update(self, client: Hanzo) -> None:
credential = client.credentials.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
def test_raw_response_update(self, client: Hanzo) -> None:
response = client.credentials.with_raw_response.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
def test_streaming_response_update(self, client: Hanzo) -> None:
with client.credentials.with_streaming_response.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = response.parse()
assert_matches_type(object, credential, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
def test_path_params_update(self, client: Hanzo) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_credential_name` but received ''"):
client.credentials.with_raw_response.update(
path_credential_name="",
credential_info={},
body_credential_name="",
credential_values={},
)
@pytest.mark.skip()
@parametrize
def test_method_list(self, client: Hanzo) -> None:
@@ -229,10 +141,20 @@ class TestAsyncCredentials:
@pytest.mark.skip()
@parametrize
async def test_method_create(self, async_client: AsyncHanzo) -> None:
credential = await async_client.credentials.create(
credential_info={},
credential_name="credential_name",
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None:
credential = await async_client.credentials.create(
credential_info={},
credential_name="credential_name",
credential_values={},
model_id="model_id",
)
assert_matches_type(object, credential, path=["response"])
@@ -242,7 +164,6 @@ class TestAsyncCredentials:
response = await async_client.credentials.with_raw_response.create(
credential_info={},
credential_name="credential_name",
credential_values={},
)
assert response.is_closed is True
@@ -256,7 +177,6 @@ class TestAsyncCredentials:
async with async_client.credentials.with_streaming_response.create(
credential_info={},
credential_name="credential_name",
credential_values={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -266,102 +186,6 @@ class TestAsyncCredentials:
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
async def test_method_retrieve(self, async_client: AsyncHanzo) -> None:
credential = await async_client.credentials.retrieve(
"credential_name",
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_raw_response_retrieve(self, async_client: AsyncHanzo) -> None:
response = await async_client.credentials.with_raw_response.retrieve(
"credential_name",
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_streaming_response_retrieve(self, async_client: AsyncHanzo) -> None:
async with async_client.credentials.with_streaming_response.retrieve(
"credential_name",
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
async def test_path_params_retrieve(self, async_client: AsyncHanzo) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `credential_name` but received ''"):
await async_client.credentials.with_raw_response.retrieve(
"",
)
@pytest.mark.skip()
@parametrize
async def test_method_update(self, async_client: AsyncHanzo) -> None:
credential = await async_client.credentials.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
)
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_raw_response_update(self, async_client: AsyncHanzo) -> None:
response = await async_client.credentials.with_raw_response.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
@pytest.mark.skip()
@parametrize
async def test_streaming_response_update(self, async_client: AsyncHanzo) -> None:
async with async_client.credentials.with_streaming_response.update(
path_credential_name="credential_name",
credential_info={},
body_credential_name="credential_name",
credential_values={},
) as response:
assert not response.is_closed
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
credential = await response.parse()
assert_matches_type(object, credential, path=["response"])
assert cast(Any, response.is_closed) is True
@pytest.mark.skip()
@parametrize
async def test_path_params_update(self, async_client: AsyncHanzo) -> None:
with pytest.raises(ValueError, match=r"Expected a non-empty value for `path_credential_name` but received ''"):
await async_client.credentials.with_raw_response.update(
path_credential_name="",
credential_info={},
body_credential_name="",
credential_values={},
)
@pytest.mark.skip()
@parametrize
async def test_method_list(self, async_client: AsyncHanzo) -> None:
+7 -7
View File
@@ -10,8 +10,8 @@ import pytest
from hanzoai import Hanzo, AsyncHanzo
from tests.utils import assert_matches_type
from hanzoai.types import (
LiteLlmEndUserTable,
CustomerListResponse,
CustomerRetrieveInfoResponse,
)
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
@@ -231,7 +231,7 @@ class TestCustomer:
customer = client.customer.retrieve_info(
end_user_id="end_user_id",
)
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -243,7 +243,7 @@ class TestCustomer:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
customer = response.parse()
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -255,7 +255,7 @@ class TestCustomer:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
customer = response.parse()
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
assert cast(Any, response.is_closed) is True
@@ -508,7 +508,7 @@ class TestAsyncCustomer:
customer = await async_client.customer.retrieve_info(
end_user_id="end_user_id",
)
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -520,7 +520,7 @@ class TestAsyncCustomer:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
customer = await response.parse()
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
@pytest.mark.skip()
@parametrize
@@ -532,7 +532,7 @@ class TestAsyncCustomer:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
customer = await response.parse()
assert_matches_type(LiteLlmEndUserTable, customer, path=["response"])
assert_matches_type(CustomerRetrieveInfoResponse, customer, path=["response"])
assert cast(Any, response.is_closed) is True
+12 -12
View File
@@ -62,7 +62,7 @@ class TestKey:
temp_budget_increase=0,
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
@@ -147,7 +147,7 @@ class TestKey:
key = client.key.delete(
key_aliases=["string"],
keys=["string"],
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
@@ -186,7 +186,7 @@ class TestKey:
def test_method_block_with_all_params(self, client: Hanzo) -> None:
key = client.key.block(
key="key",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -281,7 +281,7 @@ class TestKey:
team_id="team_id",
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -348,7 +348,7 @@ class TestKey:
team_id="team_id",
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -436,7 +436,7 @@ class TestKey:
def test_method_unblock_with_all_params(self, client: Hanzo) -> None:
key = client.key.unblock(
key="key",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
@@ -509,7 +509,7 @@ class TestAsyncKey:
temp_budget_increase=0,
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
@@ -594,7 +594,7 @@ class TestAsyncKey:
key = await async_client.key.delete(
key_aliases=["string"],
keys=["string"],
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
@@ -633,7 +633,7 @@ class TestAsyncKey:
async def test_method_block_with_all_params(self, async_client: AsyncHanzo) -> None:
key = await async_client.key.block(
key="key",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(Optional[KeyBlockResponse], key, path=["response"])
@@ -728,7 +728,7 @@ class TestAsyncKey:
team_id="team_id",
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(GenerateKeyResponse, key, path=["response"])
@@ -795,7 +795,7 @@ class TestAsyncKey:
team_id="team_id",
tpm_limit=0,
user_id="user_id",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(Optional[GenerateKeyResponse], key, path=["response"])
@@ -883,7 +883,7 @@ class TestAsyncKey:
async def test_method_unblock_with_all_params(self, async_client: AsyncHanzo) -> None:
key = await async_client.key.unblock(
key="key",
litellm_changed_by="litellm-changed-by",
llm_changed_by="llm-changed-by",
)
assert_matches_type(object, key, path=["response"])
+10 -10
View File
@@ -21,7 +21,7 @@ class TestModel:
@parametrize
def test_method_create(self, client: Hanzo) -> None:
model = client.model.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
)
@@ -31,7 +31,7 @@ class TestModel:
@parametrize
def test_method_create_with_all_params(self, client: Hanzo) -> None:
model = client.model.create(
litellm_params={
llm_params={
"model": "model",
"api_base": "api_base",
"api_key": "api_key",
@@ -44,7 +44,7 @@ class TestModel:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -84,7 +84,7 @@ class TestModel:
@parametrize
def test_raw_response_create(self, client: Hanzo) -> None:
response = client.model.with_raw_response.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
)
@@ -98,7 +98,7 @@ class TestModel:
@parametrize
def test_streaming_response_create(self, client: Hanzo) -> None:
with client.model.with_streaming_response.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
) as response:
@@ -152,7 +152,7 @@ class TestAsyncModel:
@parametrize
async def test_method_create(self, async_client: AsyncHanzo) -> None:
model = await async_client.model.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
)
@@ -162,7 +162,7 @@ class TestAsyncModel:
@parametrize
async def test_method_create_with_all_params(self, async_client: AsyncHanzo) -> None:
model = await async_client.model.create(
litellm_params={
llm_params={
"model": "model",
"api_base": "api_base",
"api_key": "api_key",
@@ -175,7 +175,7 @@ class TestAsyncModel:
"custom_llm_provider": "custom_llm_provider",
"input_cost_per_second": 0,
"input_cost_per_token": 0,
"litellm_trace_id": "litellm_trace_id",
"llm_trace_id": "llm_trace_id",
"max_budget": 0,
"max_file_size_mb": 0,
"max_retries": 0,
@@ -215,7 +215,7 @@ class TestAsyncModel:
@parametrize
async def test_raw_response_create(self, async_client: AsyncHanzo) -> None:
response = await async_client.model.with_raw_response.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
)
@@ -229,7 +229,7 @@ class TestAsyncModel:
@parametrize
async def test_streaming_response_create(self, async_client: AsyncHanzo) -> None:
async with async_client.model.with_streaming_response.create(
litellm_params={"model": "model"},
llm_params={"model": "model"},
model_info={"id": "id"},
model_name="model_name",
) as response:

Some files were not shown because too many files have changed in this diff Show More