BerriAI / litellm

Python SDK, Proxy Server (LLM Gateway) to call 100+ LLM APIs in OpenAI format - [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropic, Sagemaker, HuggingFace, Replicate, Groq]
https://docs.litellm.ai/docs/
Other
13.9k stars 1.64k forks source link

[Feature] Add gpt-4o-mini pricing for Azure OpenAI #5072

Closed Manouchehri closed 3 months ago

Manouchehri commented 3 months ago
          Please checkout Azure GPT-4o-mini ;) https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/openai-s-gpt-4o-mini-now-available-in-api-with-vision/ba-p/4200640

Originally posted by @seonghobae in https://github.com/BerriAI/litellm/issues/4922#issuecomment-2262822864

krrishdholakia commented 3 months ago

this is live already @Manouchehri https://github.com/BerriAI/litellm/blob/2a95484a83a2d16ae3180b5459ecd204c537b9ae/model_prices_and_context_window.json#L499

krrishdholakia commented 3 months ago

any reason you thought it wasn't supported yet?

asking to improve here

Manouchehri commented 3 months ago

I was expecting azure/gpt-4o-mini-2024-07-18, not azure/gpt-4o-mini. =)

Manouchehri commented 3 months ago

@krrishdholakia Am I making an obvious mistake here...? It seems like the cost is always zero, even after changing to azure/gpt-4o-mini.

image
Manouchehri commented 3 months ago
model_list:
  - model_name: gpt-4o-mini-2024-07-18
    litellm_params:
      model: azure/gpt-4o-mini-2024-07-18
      api_version: "2024-06-01"
      azure_ad_token: "oidc/google/https://example.invalid"
      additional_drop_params: ["user"]
      api_base: "https://gateway.ai.cloudflare.com/v1/REMOVED/litellm/azure-openai/REMOVED"
      seed: 1337
      max_tokens: 4096
      logprobs: True
      top_logprobs: 5
      frequency_penalty: 0
      presence_penalty: 0
      n: 1
      temperature: 1
      top_p: 1
      extra_headers: {"cf-skip-cache": "true"}
    model_info:
      base_model: azure/gpt-4o-mini
krrishdholakia commented 3 months ago

Nope. Works just fine. Tested on braintrust + langfuse + checked the response cost on curl

If you're seeing issues with cost calc - i'd recommend bumping version, and if the issue persists create a new issue w/ complete server logs so we can debug.

Screenshot 2024-08-06 at 4 23 32 PM Screenshot 2024-08-06 at 4 23 36 PM Screenshot 2024-08-06 at 4 24 06 PM
krrishdholakia commented 3 months ago

Here's my config for repro -

model_list:
  - model_name: "gpt-4o-mini"
    litellm_params:
      model: "azure/my-gpt-4o-mini"
      api_base: os.environ/AZURE_API_BASE
      api_key: os.environ/AZURE_API_KEY
    model_info:
      base_model: azure/gpt-4o-mini

litellm_settings:
  success_callback: ["langfuse"]
krrishdholakia commented 3 months ago

I was expecting azure/gpt-4o-mini-2024-07-18, not azure/gpt-4o-mini. =)

Any reason why? I can see we have this behaviour in some places of the model cost map, but in general we try to adhere to what the model name that is returned from the provider would look like