Description
In the elif model_str == "claude-3.5-sonnet":
block, the code calls:
message = client.messages.create(
model="claude-3-5-sonnet-latest",
...
)
However, the model_str
is "claude-3.5-sonnet"
, and in other places we refer to "claude-3-5-sonnet"
(for example, in the cost dictionaries). Essentially, there are three different naming variations in use:
"claude-3-5-sonnet"
in the cost dictionaries"claude-3.5-sonnet"
in theelif
check"claude-3-5-sonnet-latest"
inclient.messages.create()
If the intention is to refer to the exact same model, these should be unified or mapped consistently. Otherwise, token usage and cost may be misattributed or incorrectly tallied
Steps to Reproduce
- Call the function
query_model("claude-3.5-sonnet", ...)
- Notice the cost dictionary uses
"claude-3-5-sonnet"
- Observe the actual function call references
"claude-3-5-sonnet-latest"
Expected Behavior
All references (model checks, cost dictionary keys, model calls, etc.) should match consistently so that token usage and costs align with the same model name.
Actual Behavior
There are three different model strings in the codebase, which may cause inconsistencies in cost calculation or model selection.
Proposed Fix
- Choose a single, standardized model name—e.g.
"claude-3-5-sonnet"
—and update:- The
elif
condition to match that name - The cost dictionary keys to match that name
- The actual
messages.create()
call to also match
- The
By unifying all references, you ensure the correct model is being used throughout the code and that costs are properly tallied.