From cd2261181042500004fb1913959788578fcd2945 Mon Sep 17 00:00:00 2001 From: kev Date: Thu, 20 Feb 2025 14:58:52 +0800 Subject: [PATCH] update litellm --- litellm/data/config.yaml | 32 ++++++++++++++++++++++---------- litellm/data/prompt.txt | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 litellm/data/prompt.txt diff --git a/litellm/data/config.yaml b/litellm/data/config.yaml index f5eae28..771963f 100644 --- a/litellm/data/config.yaml +++ b/litellm/data/config.yaml @@ -9,26 +9,26 @@ model_list: litellm_params: model: openai/gpt-4o api_key: os.environ/OPENAI_API_KEY - #input_cost_per_token: 2.5e-06 # $2.5/1M - #output_cost_per_token: 1.0e-05 # $10/1M + input_cost_per_token: 2.5e-6 + output_cost_per_token: 1.0e-5 - model_name: gpt-4o-mini litellm_params: model: openai/gpt-4o-mini api_key: os.environ/OPENAI_API_KEY - #input_cost_per_token: 1.5e-07 # $0.15/1M - #output_cost_per_token: 6.0e-07 # $0.6/1M + input_cost_per_token: 1.5e-7 + output_cost_per_token: 6.0e-7 - model_name: claude-3.5-sonnet litellm_params: model: anthropic/claude-3-5-sonnet-latest api_key: os.environ/ANTHROPIC_API_KEY - #input_cost_per_token: 3.0e-06 # $3/1M - #output_cost_per_token: 1.5e-05 # $15/1M + input_cost_per_token: 3.0e-6 + output_cost_per_token: 1.5e-5 - model_name: claude-3.5-haiku litellm_params: model: anthropic/claude-3-5-haiku-latest api_key: os.environ/ANTHROPIC_API_KEY - #input_cost_per_token: 8.0e-07 # $0.8/1M - #output_cost_per_token: 4.0e-06 # $4/1M + input_cost_per_token: 8.0e-7 + output_cost_per_token: 4.0e-6 - model_name: llama3.2 litellm_params: model: ollama/llama3.2 @@ -36,8 +36,20 @@ model_list: general_settings: master_key: os.environ/LITELLM_MASTER_KEY - #database_url: postgresql://litellm:litellm@postgres:5432/litellm - #store_model_in_db: True + database_url: postgresql://litellm:litellm@postgres:5432/litellm + store_model_in_db: True + +litellm_settings: + drop_params: true + modify_params: true + +# $ psql postgres +# >>> CREATE USER litellm WITH PASSWORD 'litellm'; +# CREATE ROLE +# >>> CREATE DATABASE litellm OWNER litellm; +# CREATE DATABASE +# >>> \q +# $ open http://192.168.255.200:4000/ui/ ####################################### # export OPENAI_API_KEY=sk-xxxxxx # diff --git a/litellm/data/prompt.txt b/litellm/data/prompt.txt new file mode 100644 index 0000000..be7a9bf --- /dev/null +++ b/litellm/data/prompt.txt @@ -0,0 +1,37 @@ +- go to https://www.botgenuity.com/tools/llm-pricing. +- extract the 1M input & output token prices for 4 models from page + 1. gpt-4o + 2. gpt-4o-mini + 3. claude-3-5-sonnet-latest + 4. claude-3-5-haiku-latest +- convert the 1M token price to per token price (in exponential notation) +- fill in all missing values (related to model_name) in the provided yaml file. +- print the updated yaml file + +```yaml +model_list: +- model_name: gpt-4o + litellm_params: + model: openai/gpt-4o + api_key: os.environ/OPENAI_API_KEY + input_cost_per_token: missing + output_cost_per_token: missing +- model_name: gpt-4o-mini + litellm_params: + model: openai/gpt-4o-mini + api_key: os.environ/OPENAI_API_KEY + input_cost_per_token: missing + output_cost_per_token: missing +- model_name: claude-3.5-sonnet + litellm_params: + model: anthropic/claude-3-5-sonnet-latest + api_key: os.environ/ANTHROPIC_API_KEY + input_cost_per_token: missing + output_cost_per_token: missing +- model_name: claude-3.5-haiku + litellm_params: + model: anthropic/claude-3-5-haiku-latest + api_key: os.environ/ANTHROPIC_API_KEY + input_cost_per_token: missing + output_cost_per_token: missing +```