mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 02:34:29 +00:00
Litellm dev contributor prs 01 31 2025 (#8168)
* Add O3-Mini for Azure and Remove Vision Support (#8161) * Azure Released O3-mini at the same time as OAI, so i've added support here. Confirmed to work with Sweden Central. * [FIX] replace cgi for python 3.13 with email.Message as suggested in PEP 594 (#8160) * Update model_prices_and_context_window.json (#8120) codestral2501 pricing on vertex_ai * Fix/db view names (#8119) * Fix to case sensitive DB Views name * Fix to case sensitive DB View names * Added quotes to check query as well * Added quotes to create view query * test: handle server error for flaky test vertex ai has unstable endpoints --------- Co-authored-by: Wanis Elabbar <70503629+elabbarw@users.noreply.github.com> Co-authored-by: Honghua Dong <dhh1995@163.com> Co-authored-by: superpoussin22 <vincent.nadal@orange.fr> Co-authored-by: Miguel Armenta <37154380+ma-armenta@users.noreply.github.com>
This commit is contained in:
parent
d0c5639912
commit
91ed05df29
6 changed files with 83 additions and 11 deletions
|
@ -168,11 +168,11 @@ async def check_view_exists(): # noqa: PLR0915
|
||||||
print("MonthlyGlobalSpendPerUserPerKey Created!") # noqa
|
print("MonthlyGlobalSpendPerUserPerKey Created!") # noqa
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await db.query_raw("""SELECT 1 FROM DailyTagSpend LIMIT 1""")
|
await db.query_raw("""SELECT 1 FROM "DailyTagSpend" LIMIT 1""")
|
||||||
print("DailyTagSpend Exists!") # noqa
|
print("DailyTagSpend Exists!") # noqa
|
||||||
except Exception:
|
except Exception:
|
||||||
sql_query = """
|
sql_query = """
|
||||||
CREATE OR REPLACE VIEW DailyTagSpend AS
|
CREATE OR REPLACE VIEW "DailyTagSpend" AS
|
||||||
SELECT
|
SELECT
|
||||||
jsonb_array_elements_text(request_tags) AS individual_request_tag,
|
jsonb_array_elements_text(request_tags) AS individual_request_tag,
|
||||||
DATE(s."startTime") AS spend_date,
|
DATE(s."startTime") AS spend_date,
|
||||||
|
|
|
@ -2153,7 +2153,7 @@ def stringify_json_tool_call_content(messages: List) -> List:
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import mimetypes
|
import mimetypes
|
||||||
from cgi import parse_header
|
from email.message import Message
|
||||||
|
|
||||||
import httpx
|
import httpx
|
||||||
|
|
||||||
|
@ -2174,8 +2174,9 @@ from litellm.types.llms.bedrock import ToolUseBlock as BedrockToolUseBlock
|
||||||
|
|
||||||
|
|
||||||
def _parse_content_type(content_type: str) -> str:
|
def _parse_content_type(content_type: str) -> str:
|
||||||
main_type, _ = parse_header(content_type)
|
m = Message()
|
||||||
return main_type
|
m['content-type'] = content_type
|
||||||
|
return m.get_content_type()
|
||||||
|
|
||||||
|
|
||||||
class BedrockImageProcessor:
|
class BedrockImageProcessor:
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
"cache_read_input_token_cost": 0.00000055,
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
"litellm_provider": "openai",
|
"litellm_provider": "openai",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_vision": true,
|
"supports_vision": false,
|
||||||
"supports_prompt_caching": true
|
"supports_prompt_caching": true
|
||||||
},
|
},
|
||||||
"o3-mini-2025-01-31": {
|
"o3-mini-2025-01-31": {
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
"cache_read_input_token_cost": 0.00000055,
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
"litellm_provider": "openai",
|
"litellm_provider": "openai",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_vision": true,
|
"supports_vision": false,
|
||||||
"supports_prompt_caching": true
|
"supports_prompt_caching": true
|
||||||
},
|
},
|
||||||
"o1-mini-2024-09-12": {
|
"o1-mini-2024-09-12": {
|
||||||
|
@ -929,6 +929,30 @@
|
||||||
"input_cost_per_character": 0.000030,
|
"input_cost_per_character": 0.000030,
|
||||||
"litellm_provider": "openai"
|
"litellm_provider": "openai"
|
||||||
},
|
},
|
||||||
|
"azure/o3-mini": {
|
||||||
|
"max_tokens": 100000,
|
||||||
|
"max_input_tokens": 200000,
|
||||||
|
"max_output_tokens": 100000,
|
||||||
|
"input_cost_per_token": 0.0000011,
|
||||||
|
"output_cost_per_token": 0.0000044,
|
||||||
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
|
"litellm_provider": "openai",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_vision": false,
|
||||||
|
"supports_prompt_caching": true
|
||||||
|
},
|
||||||
|
"azure/o3-mini-2025-01-31": {
|
||||||
|
"max_tokens": 100000,
|
||||||
|
"max_input_tokens": 200000,
|
||||||
|
"max_output_tokens": 100000,
|
||||||
|
"input_cost_per_token": 0.0000011,
|
||||||
|
"output_cost_per_token": 0.0000044,
|
||||||
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
|
"litellm_provider": "openai",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_vision": false,
|
||||||
|
"supports_prompt_caching": true
|
||||||
|
},
|
||||||
"azure/tts-1": {
|
"azure/tts-1": {
|
||||||
"mode": "audio_speech",
|
"mode": "audio_speech",
|
||||||
"input_cost_per_character": 0.000015,
|
"input_cost_per_character": 0.000015,
|
||||||
|
@ -3876,6 +3900,16 @@
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_function_calling": true
|
"supports_function_calling": true
|
||||||
},
|
},
|
||||||
|
"vertex_ai/codestral@2405": {
|
||||||
|
"max_tokens": 128000,
|
||||||
|
"max_input_tokens": 128000,
|
||||||
|
"max_output_tokens": 128000,
|
||||||
|
"input_cost_per_token": 0.0000002,
|
||||||
|
"output_cost_per_token": 0.0000006,
|
||||||
|
"litellm_provider": "vertex_ai-mistral_models",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_function_calling": true
|
||||||
|
},
|
||||||
"vertex_ai/imagegeneration@006": {
|
"vertex_ai/imagegeneration@006": {
|
||||||
"output_cost_per_image": 0.020,
|
"output_cost_per_image": 0.020,
|
||||||
"litellm_provider": "vertex_ai-image-models",
|
"litellm_provider": "vertex_ai-image-models",
|
||||||
|
|
|
@ -158,11 +158,11 @@ async def create_missing_views(db: _db): # noqa: PLR0915
|
||||||
print("MonthlyGlobalSpendPerUserPerKey Created!") # noqa
|
print("MonthlyGlobalSpendPerUserPerKey Created!") # noqa
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await db.query_raw("""SELECT 1 FROM DailyTagSpend LIMIT 1""")
|
await db.query_raw("""SELECT 1 FROM "DailyTagSpend" LIMIT 1""")
|
||||||
print("DailyTagSpend Exists!") # noqa
|
print("DailyTagSpend Exists!") # noqa
|
||||||
except Exception:
|
except Exception:
|
||||||
sql_query = """
|
sql_query = """
|
||||||
CREATE OR REPLACE VIEW DailyTagSpend AS
|
CREATE OR REPLACE VIEW "DailyTagSpend" AS
|
||||||
SELECT
|
SELECT
|
||||||
jsonb_array_elements_text(request_tags) AS individual_request_tag,
|
jsonb_array_elements_text(request_tags) AS individual_request_tag,
|
||||||
DATE(s."startTime") AS spend_date,
|
DATE(s."startTime") AS spend_date,
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
"cache_read_input_token_cost": 0.00000055,
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
"litellm_provider": "openai",
|
"litellm_provider": "openai",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_vision": true,
|
"supports_vision": false,
|
||||||
"supports_prompt_caching": true
|
"supports_prompt_caching": true
|
||||||
},
|
},
|
||||||
"o3-mini-2025-01-31": {
|
"o3-mini-2025-01-31": {
|
||||||
|
@ -223,7 +223,7 @@
|
||||||
"cache_read_input_token_cost": 0.00000055,
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
"litellm_provider": "openai",
|
"litellm_provider": "openai",
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_vision": true,
|
"supports_vision": false,
|
||||||
"supports_prompt_caching": true
|
"supports_prompt_caching": true
|
||||||
},
|
},
|
||||||
"o1-mini-2024-09-12": {
|
"o1-mini-2024-09-12": {
|
||||||
|
@ -929,6 +929,30 @@
|
||||||
"input_cost_per_character": 0.000030,
|
"input_cost_per_character": 0.000030,
|
||||||
"litellm_provider": "openai"
|
"litellm_provider": "openai"
|
||||||
},
|
},
|
||||||
|
"azure/o3-mini": {
|
||||||
|
"max_tokens": 100000,
|
||||||
|
"max_input_tokens": 200000,
|
||||||
|
"max_output_tokens": 100000,
|
||||||
|
"input_cost_per_token": 0.0000011,
|
||||||
|
"output_cost_per_token": 0.0000044,
|
||||||
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
|
"litellm_provider": "openai",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_vision": false,
|
||||||
|
"supports_prompt_caching": true
|
||||||
|
},
|
||||||
|
"azure/o3-mini-2025-01-31": {
|
||||||
|
"max_tokens": 100000,
|
||||||
|
"max_input_tokens": 200000,
|
||||||
|
"max_output_tokens": 100000,
|
||||||
|
"input_cost_per_token": 0.0000011,
|
||||||
|
"output_cost_per_token": 0.0000044,
|
||||||
|
"cache_read_input_token_cost": 0.00000055,
|
||||||
|
"litellm_provider": "openai",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_vision": false,
|
||||||
|
"supports_prompt_caching": true
|
||||||
|
},
|
||||||
"azure/tts-1": {
|
"azure/tts-1": {
|
||||||
"mode": "audio_speech",
|
"mode": "audio_speech",
|
||||||
"input_cost_per_character": 0.000015,
|
"input_cost_per_character": 0.000015,
|
||||||
|
@ -3876,6 +3900,16 @@
|
||||||
"mode": "chat",
|
"mode": "chat",
|
||||||
"supports_function_calling": true
|
"supports_function_calling": true
|
||||||
},
|
},
|
||||||
|
"vertex_ai/codestral@2405": {
|
||||||
|
"max_tokens": 128000,
|
||||||
|
"max_input_tokens": 128000,
|
||||||
|
"max_output_tokens": 128000,
|
||||||
|
"input_cost_per_token": 0.0000002,
|
||||||
|
"output_cost_per_token": 0.0000006,
|
||||||
|
"litellm_provider": "vertex_ai-mistral_models",
|
||||||
|
"mode": "chat",
|
||||||
|
"supports_function_calling": true
|
||||||
|
},
|
||||||
"vertex_ai/imagegeneration@006": {
|
"vertex_ai/imagegeneration@006": {
|
||||||
"output_cost_per_image": 0.020,
|
"output_cost_per_image": 0.020,
|
||||||
"litellm_provider": "vertex_ai-image-models",
|
"litellm_provider": "vertex_ai-image-models",
|
||||||
|
|
|
@ -43,6 +43,9 @@ def test_batch_completions():
|
||||||
except Timeout as e:
|
except Timeout as e:
|
||||||
print(f"IN TIMEOUT")
|
print(f"IN TIMEOUT")
|
||||||
pass
|
pass
|
||||||
|
except litellm.InternalServerError as e:
|
||||||
|
print(f"IN INTERNAL SERVER ERROR")
|
||||||
|
pass
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"An error occurred: {e}")
|
pytest.fail(f"An error occurred: {e}")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue