mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 18:54:30 +00:00
fix(utils.py): update get_model_info docstring
Fixes https://github.com/BerriAI/litellm/issues/4711
This commit is contained in:
parent
ff1bcdd3b5
commit
9cc2daeec9
2 changed files with 48 additions and 8 deletions
|
@ -5474,8 +5474,19 @@ async def new_end_user(
|
||||||
):
|
):
|
||||||
"""
|
"""
|
||||||
Allow creating a new Customer
|
Allow creating a new Customer
|
||||||
NOTE: This used to be called `/end_user/new`, we will still be maintaining compatibility for /end_user/XXX for these endpoints
|
|
||||||
|
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
- user_id: str - The unique identifier for the user.
|
||||||
|
- alias: Optional[str] - A human-friendly alias for the user.
|
||||||
|
- blocked: bool - Flag to allow or disallow requests for this end-user. Default is False.
|
||||||
|
- max_budget: Optional[float] - The maximum budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both.
|
||||||
|
- budget_id: Optional[str] - The identifier for an existing budget allocated to the user. Either 'max_budget' or 'budget_id' should be provided, not both.
|
||||||
|
- allowed_model_region: Optional[Literal["eu"]] - Require all user requests to use models in this specific region.
|
||||||
|
- default_model: Optional[str] - If no equivalent model in the allowed region, default all requests to this model.
|
||||||
|
- metadata: Optional[dict] = Metadata for customer, store information for customer. Example metadata = {"data_training_opt_out": True}
|
||||||
|
|
||||||
|
|
||||||
- Allow specifying allowed regions
|
- Allow specifying allowed regions
|
||||||
- Allow specifying default model
|
- Allow specifying default model
|
||||||
|
|
||||||
|
@ -5493,6 +5504,8 @@ async def new_end_user(
|
||||||
|
|
||||||
# return end-user object
|
# return end-user object
|
||||||
```
|
```
|
||||||
|
|
||||||
|
NOTE: This used to be called `/end_user/new`, we will still be maintaining compatibility for /end_user/XXX for these endpoints
|
||||||
"""
|
"""
|
||||||
global prisma_client, llm_router
|
global prisma_client, llm_router
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -4665,13 +4665,40 @@ def get_model_info(model: str, custom_llm_provider: Optional[str] = None) -> Mod
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
dict: A dictionary containing the following information:
|
dict: A dictionary containing the following information:
|
||||||
- max_tokens (int): The maximum number of tokens allowed for the given model.
|
max_tokens: Required[Optional[int]]
|
||||||
- input_cost_per_token (float): The cost per token for input.
|
max_input_tokens: Required[Optional[int]]
|
||||||
- output_cost_per_token (float): The cost per token for output.
|
max_output_tokens: Required[Optional[int]]
|
||||||
- litellm_provider (str): The provider of the model (e.g., "openai").
|
input_cost_per_token: Required[float]
|
||||||
- mode (str): The mode of the model (e.g., "chat" or "completion").
|
input_cost_per_character: Optional[float] # only for vertex ai models
|
||||||
- supported_openai_params (List[str]): A list of supported OpenAI parameters for the model.
|
input_cost_per_token_above_128k_tokens: Optional[float] # only for vertex ai models
|
||||||
|
input_cost_per_character_above_128k_tokens: Optional[
|
||||||
|
float
|
||||||
|
] # only for vertex ai models
|
||||||
|
input_cost_per_image: Optional[float] # only for vertex ai models
|
||||||
|
input_cost_per_audio_per_second: Optional[float] # only for vertex ai models
|
||||||
|
input_cost_per_video_per_second: Optional[float] # only for vertex ai models
|
||||||
|
output_cost_per_token: Required[float]
|
||||||
|
output_cost_per_character: Optional[float] # only for vertex ai models
|
||||||
|
output_cost_per_token_above_128k_tokens: Optional[
|
||||||
|
float
|
||||||
|
] # only for vertex ai models
|
||||||
|
output_cost_per_character_above_128k_tokens: Optional[
|
||||||
|
float
|
||||||
|
] # only for vertex ai models
|
||||||
|
output_cost_per_image: Optional[float]
|
||||||
|
output_vector_size: Optional[int]
|
||||||
|
output_cost_per_video_per_second: Optional[float] # only for vertex ai models
|
||||||
|
output_cost_per_audio_per_second: Optional[float] # only for vertex ai models
|
||||||
|
litellm_provider: Required[str]
|
||||||
|
mode: Required[
|
||||||
|
Literal[
|
||||||
|
"completion", "embedding", "image_generation", "chat", "audio_transcription"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
supported_openai_params: Required[Optional[List[str]]]
|
||||||
|
supports_system_messages: Optional[bool]
|
||||||
|
supports_response_schema: Optional[bool]
|
||||||
|
supports_vision: Optional[bool]
|
||||||
Raises:
|
Raises:
|
||||||
Exception: If the model is not mapped yet.
|
Exception: If the model is not mapped yet.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue