BerriAI / litellm

Call all LLM APIs using the OpenAI format. Use Bedrock, Azure, OpenAI, Cohere, Anthropic, Ollama, Sagemaker, HuggingFace, Replicate (100+ LLMs)
https://docs.litellm.ai/docs/
Other
10.7k stars 1.22k forks source link

[Bug]: token cost of config.yaml not being obeyed #2233

Open bitnom opened 4 months ago

bitnom commented 4 months ago

What happened?

general_settings:
  master_key: sk-

model_list:
  - model_name: openrouter/mistralai/mixtral-8x7b-instruct
    litellm_params:
      model: openai/mistralai/mixtral-8x7b-instruct
      api_base: https://openrouter.ai/api/v1/
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: openrouter/auto
    litellm_params:
      model: openai/openrouter/auto
      api_base: https://openrouter.ai/api/v1/
      api_key: "os.environ/OPENROUTER_API_KEY"

  - model_name: gpt-4-turbo-preview
    litellm_params:
      model: openai/gpt-4-1106-preview
      input_cost_per_token: 0.000002
      output_cost_per_token: 0.000006
      api_base: https://api.acloudapp.com/v1/
      api_key: "os.environ/ACLOUD_API_KEY"
      max_retries: 0

  - model_name: gpt-4-1106-preview
    litellm_params:
      model: openai/gpt-4-1106-preview
#      base_model: gpt-4-1106-preview
#      input_cost_per_token: 0.00001
#      output_cost_per_token: 0.00003
      api_base: https://openrouter.ai/api/v1/
      api_key: "os.environ/OPENROUTER_API_KEY"
      max_retries: 0

  - model_name: gpt-4-turbo-preview
    litellm_params:
      model: openai/gpt-4-turbo-preview
#      base_model: gpt-4-turbo-preview
#      input_cost_per_token: 0.00001
#      output_cost_per_token: 0.00003
      api_base: https://openrouter.ai/api/v1/
      api_key: "os.environ/OPENROUTER_API_KEY"
      max_retries: 0

and then I see:

image

Relevant log output

No response

Twitter / LinkedIn details

No response

krrishdholakia commented 4 months ago

Hi @bitnom want to understand how you're using this with the UI.

Can you do a quick chat? https://meet.google.com/oph-xeev-xsj