Fix KoboldCPP agent provider max tokens (#4519)

add max tokens to koboldcpp agent provider
This commit is contained in:
Sean Hatfield 2025-10-09 15:28:50 -07:00 committed by GitHub
parent 71cd46ce1b
commit 6270a0a189
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -20,6 +20,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
this._client = client;
this.model = model;
this.maxTokens = Number(process.env.KOBOLD_CPP_MAX_TOKENS) || 2048;
this.verbose = true;
}
@ -36,6 +37,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
.create({
model: this.model,
messages,
max_tokens: this.maxTokens,
})
.then((result) => {
if (!result.hasOwnProperty("choices"))
@ -54,6 +56,7 @@ class KoboldCPPProvider extends InheritMultiple([Provider, UnTooled]) {
model: this.model,
stream: true,
messages,
max_tokens: this.maxTokens,
});
}