Closed noble-varghese closed 1 year ago
🤖
Hello,
Thank you for bringing this to our attention. The issue you're experiencing seems to be due to the fact that the model name "claude-instant-1.2" is not included in the CLAUDE_MODELS
dictionary in the anthropic_modelname_to_contextsize
function. This function checks if the provided modelname
is in the CLAUDE_MODELS
dictionary and if it is not, it raises a ValueError
stating that the model is unknown.
Here is the relevant code:
CLAUDE_MODELS = {
"claude-instant-1": 100000,
"claude-2": 100000,
}
def anthropic_modelname_to_contextsize(modelname: str) -> int:
if modelname not in CLAUDE_MODELS:
raise ValueError(
f"Unknown model: {modelname}. Please provide a valid Anthropic model name."
"Known models are: " + ", ".join(CLAUDE_MODELS.keys())
)
return CLAUDE_MODELS[modelname]
To resolve this issue, "claude-instant-1.2" needs to be added to the CLAUDE_MODELS
dictionary. However, as a user, you won't be able to make this change. We will need to update the LlamaIndex codebase to include this model name.
I will raise this issue with the development team and we will work on a fix. Once the fix is implemented, it will be included in the next release of LlamaIndex. I will update this thread once the fix is available.
In the meantime, you can use the model names "claude-instant-1" and "claude-2" as these are currently recognized by the LlamaIndex's Anthropic integration.
Thank you for your patience and understanding.
Best, Dosu
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
Easy fix, thanks!
Bug Description
I'm encountering an inconsistency while working with the Anthropic integration in llama_index. Specifically, when passing the model name as claude-instant-1.2, I'm getting an error message:
Code used :
Error
However, according to the documentation, both claude-instant-1 and claude-instant-1.2 should be valid model names. This inconsistency is causing confusion and making it challenging to work with the Anthropic LLM integration.
Furthermore, I noticed that the results from the Anthropic LLM (api results) contain the model in the full version as stated in the documentation, but the error message suggests otherwise.
Link to documentation: https://docs.anthropic.com/claude/reference/selecting-a-model
Request to Anthropic:
Example response from Anthropic:
Infact Anthropic API accepts both formats of inputs.
Version
0.8.4
Steps to Reproduce
Use the above specified code
Relevant Logs/Tracbacks