Skip to content

Commit

Permalink
fix: too small token limits on claude 3 models
Browse files Browse the repository at this point in the history
  • Loading branch information
tmokmss committed Jun 25, 2024
1 parent 66bc3b6 commit 71a7867
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 14 deletions.
11 changes: 4 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 1 addition & 5 deletions src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,7 @@ export class Bot {
// eslint-disable-next-line camelcase
anthropic_version: 'bedrock-2023-05-31',
// eslint-disable-next-line camelcase
max_tokens: 4000,
// eslint-disable-next-line camelcase
top_p: 0.9,
// eslint-disable-next-line camelcase
top_k: 250,
max_tokens: 4096,
temperature: 0,
messages: [
{
Expand Down
5 changes: 3 additions & 2 deletions src/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export class TokenLimits {
this.maxTokens = 100_000
this.responseTokens = 3000
} else {
this.maxTokens = 4000
this.responseTokens = 1000
// The latest models usually have this level of limits.
this.maxTokens = 200_000
this.responseTokens = 4096
}
// provide some margin for the request tokens
this.requestTokens = this.maxTokens - this.responseTokens - 100
Expand Down

0 comments on commit 71a7867

Please sign in to comment.