Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inference.py - Mismatch in Model String #20

Open
CharlesCNorton opened this issue Jan 12, 2025 · 0 comments · May be fixed by #29
Open

Inference.py - Mismatch in Model String #20

CharlesCNorton opened this issue Jan 12, 2025 · 0 comments · May be fixed by #29

Comments

@CharlesCNorton
Copy link
Contributor

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:

  1. "claude-3-5-sonnet" in the cost dictionaries
  2. "claude-3.5-sonnet" in the elif check
  3. "claude-3-5-sonnet-latest" in client.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

  1. Call the function query_model("claude-3.5-sonnet", ...)
  2. Notice the cost dictionary uses "claude-3-5-sonnet"
  3. 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:
    1. The elif condition to match that name
    2. The cost dictionary keys to match that name
    3. The actual messages.create() call to also match

By unifying all references, you ensure the correct model is being used throughout the code and that costs are properly tallied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant