AWS Bedrock - Anthropic Claude V2 Max tokens

0

When invoking the model ("modelId": "anthropic.claude-v2") using boto3 version 1.28.59 with "max_tokens_to_sample" higher than 8191. I get an error: botocore.errorfactory.ValidationException: An error occurred (ValidationException) when calling the InvokeModel operation: Malformed input request: 60000 is not less or equal to 8191, please reformat your input and try again.

One one the reasons I am looking into Claude 2 is its 100K tokens limit. Do I need to request getting 100K?

Thank you in advance! Max

Max M
posta 8 mesi fa4951 visualizzazioni
2 Risposte
2
Risposta accettata

My bad. The documentation (https://docs.aws.amazon.com/bedrock/latest/userguide/model-parameters.html#model-parameters-claude) clearly states that the longest output is 8K. The context size can be 100K, but the length of the response cannot exceed 8K. My use case was to decompose a document into Q&As, so my output is about the same size as the input and I will need to chunk documents into smaller pieces.

Max

Max M
con risposta 8 mesi fa
profile picture
ESPERTO
verificato 23 giorni fa
profile picture
ESPERTO
verificato 3 mesi fa
0

The input/output sizes can change and https://docs.anthropic.com/claude/reference/input-and-output-sizes contains the latest info as of this writing :)

AWS
con risposta 4 mesi fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande