Skip to content

Commit 6270a0a

Browse files
authored
Fix KoboldCPP agent provider max tokens (#4519)
add max tokens to koboldcpp agent provider
1 parent 71cd46c commit 6270a0a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

server/utils/agents/aibitat/providers/koboldcpp.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
2020

2121
this._client = client;
2222
this.model = model;
23+
this.maxTokens = Number(process.env.KOBOLD_CPP_MAX_TOKENS) || 2048;
2324
this.verbose = true;
2425
}
2526

@@ -36,6 +37,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
3637
.create({
3738
model: this.model,
3839
messages,
40+
max_tokens: this.maxTokens,
3941
})
4042
.then((result) => {
4143
if (!result.hasOwnProperty("choices"))
@@ -54,6 +56,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
5456
model: this.model,
5557
stream: true,
5658
messages,
59+
max_tokens: this.maxTokens,
5760
});
5861
}
5962

0 commit comments

Comments
 (0)