litellm icon indicating copy to clipboard operation
litellm copied to clipboard

[Bug]: Custom Pricing for provider text-completion-codestral does not work

Open gustavhertz opened this issue 8 months ago • 1 comments

What happened?

Hi!

I cannot get cost tracking to work properly for my codestral deployment. The cost for the requests are always set to 0 - while the model has a listed price and tracks the number of tokens used properly. See attached screenshot from the usage tracking.

Image

Here is my configuration:

    - model_name: codestral-latest
      litellm_params:
        model: text-completion-codestral/codestral-latest
        api_base: https://Codestral-2501-xxxx.swedencentral.models.ai.azure.com/v1/fim/completions
        api_key: os.environ/AZURE_AI_API_KEY
      model_info:
        input_cost_per_token: 0.0000003 # $0.3 per 1M input tokens
        output_cost_per_token: 0.0000009 # $0.9 per 1M output tokens

    - model_name: codestral-2501
      litellm_params:
        model: text-completion-codestral/codestral-2501
        api_base: https://Codestral-2501-xxxx.swedencentral.models.ai.azure.com/v1/fim/completions
        api_key: os.environ/AZURE_AI_API_KEY
      model_info:
        input_cost_per_token: 0.0000003 # $0.3 per 1M input tokens
        output_cost_per_token: 0.0000009 # $0.9 per 1M output tokens

The litellm version we use is: 1.67.0

Relevant log output


Are you a ML Ops Team?

Yes

What LiteLLM version are you on ?

1.67.0

Twitter / LinkedIn details

No response

gustavhertz avatar Apr 24 '25 13:04 gustavhertz

having the exact same problem

tfisnl avatar Apr 24 '25 13:04 tfisnl

Got the same error :( I was trying to use this config and got the same beavior

- model_name: DeepSeek-v3
  litellm_params:
    model: together_ai/deepseek-ai/DeepSeek-v3
    api_key: "XXX"
  model_info:
    ...
    input_cost_per_token: 0.00000125
    output_cost_per_token: 0.00000125

raz-alon avatar Jun 23 '25 10:06 raz-alon

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Sep 22 '25 00:09 github-actions[bot]