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

[bug] anthropic model strings in PREFERRED_MODELS not mapping to litellm providers #325

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

adubatl
Copy link

@adubatl adubatl commented Feb 20, 2025

📥 Pull Request

📘 Description
The CLI passes a bad model to the anthropic API
I fixed a typo and a contradiction in the CONTRIBUTING.MD as well

$ agentstack run
Running your agent...
🖇 AgentOps: Session Replay:
# Agent: telling me the weather
## Task: fetch the weather for a zipcode


LiteLLM.Info: If you need to debug this error, use `litellm.set_verbose=True'.


Provider List: https://docs.litellm.ai/docs/providers

ERROR:root:LiteLLM call failed: litellm.NotFoundError: AnthropicException - {"type":"error","error":{"type":"not_found_error","message":"model: claude-3-5-sonnet"}}
 Error during LLM call: litellm.NotFoundError: AnthropicException - {"type":"error","error":{"type":"not_found_error","message":"model: claude-3-5-sonnet"}}
An error occurred: 
litellm.NotFoundError: AnthropicException - {"type":"error","error":{"type":"not_found_error","message":"model: claude-3-5-sonnet"}}

Run again with --debug for more information.

replaced with https://docs.litellm.ai/docs/providers/anthropic the string here, that is also elsewhere in the codebase and reran the same wizard setup and it passed.

I manually edited the agent file it created for my initial broken agent to validate this was at least potentially the cause and that fixed it too.

LMK if there is a better place for this change! Maybe would be cool to shift this to database config we populate on deploy and fetch at runtime, and only fall back to a hardcoded list if the network is doing wonky stuff. https://github.com/BerriAI/litellm/blob/main/litellm/constants.py although even litellm hardcodes it. Maybe we just snag their list since we use their repo 🤷‍♂️ IIRC we can just curl the file from the commit we have installed then compose whatever list we wanted. ♾️ options here

🧪 Testing

  1. run da wizard of ops
  2. see an error that the model is not there
  3. changed it to the right string
  4. fix the string
  5. run da wizard of ops again
  6. no error 🥳

@adubatl adubatl marked this pull request as ready for review February 20, 2025 18:51
@bboynton97
Copy link
Contributor

please undo the linter changes in the markdown file. linter rules should be agreed upon and used by everyone contributing to the repo

@adubatl
Copy link
Author

adubatl commented Feb 27, 2025

I also tested the claude-opus string and it died too. I'll see if I have some time this week to test each model and update.

Do you all have any idea of how you'd want to handle updating those models in the future without a PR or is a PR ✅ its such a small list its probably not worth me worrying. IDK what other tools you got handy in your stack. something something db driven, cloud, idk haha

@areibman
Copy link
Contributor

I also tested the claude-opus string and it died too. I'll see if I have some time this week to test each model and update.

Do you all have any idea of how you'd want to handle updating those models in the future without a PR or is a PR ✅ its such a small list its probably not worth me worrying. IDK what other tools you got handy in your stack. something something db driven, cloud, idk haha

Chatted w @bboynton97 + @tcdent briefly, I think just semi-frequently updating is the play

@adubatl
Copy link
Author

adubatl commented Mar 4, 2025

Sorry for the delay - I updated the two claude models, and added a test.

well it works on my machine revisiting the test 👁️

@adubatl adubatl changed the title [1st pr be gentle 🙏 ] prevent model not found error after using da wizard [bug] anthropic model strings in PREFERRED_MODELS not mapping to litellm providers Mar 4, 2025
@adubatl adubatl requested a review from bboynton97 March 4, 2025 19:28
Copy link
Contributor

@bboynton97 bboynton97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better late than never :)

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

Successfully merging this pull request may close these issues.

3 participants