Future-House/paper-qa

Anthropic Claude command line usage

Opened this issue · 1 comments

Trying to use Claude to index a folder from the command line.

pqa \
  --llm "anthropic/litellm-claude-3-5-sonnet-20241022" \
  --summary_llm "anthropic/litellm-claude-3-5-sonnet-20241022" \
  index .

But although my API key is set, I get:

litellm.exceptions.NotFoundError: litellm.NotFoundError: AnthropicException - Client error '404 Not Found' for url 'https://api.anthropic.com/v1/messages'

I did a lot of code reading to figure out the prefixes I needed, an example would probably help the docs. Is there another setting that I need to use to switch API versions?

Hey @apaz-cli! 👋 I'm here to help you with bugs, questions, and becoming a contributor. I'm Dosu, a bot designed to assist you while waiting for a human maintainer.

The 404 Not Found error suggests that the API endpoint or the model identifier might be incorrect. Here are a few things to check:

  1. Model Identifier: Ensure that the model identifier "anthropic/litellm-claude-3-5-sonnet-20241022" is correct and supported by the API. The model identifier should match the expected format and version available in the API.

  2. API Endpoint: The endpoint https://api.anthropic.com/v1/messages is correct for the Anthropic Claude model [1]. Double-check that there are no typos or incorrect configurations in your setup.

  3. API Key: Make sure that the ANTHROPIC_API_KEY environment variable is correctly set and has the necessary permissions [2].

  4. Headers and Parameters: Verify that all required headers and parameters are included in your request. The necessary headers include accept, content-type, anthropic-version, and others as specified [3][4].

If these aspects are correctly configured and the issue persists, it might be worth checking if there are any updates or changes in the API documentation regarding model versions or endpoint usage.

To continue talking to Dosu, mention @dosu.