You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2026/10/12 17:00:06 UTC

(sling-tooling-jenkins) branch feat/llmao updated: fix: configure maxTokens, attempt to fix problems

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feat/llmao
in repository https://gitbox.apache.org/repos/asf/sling-tooling-jenkins.git


The following commit(s) were added to refs/heads/feat/llmao by this push:
     new 8130e6a  fix: configure maxTokens, attempt to fix problems
8130e6a is described below

commit 8130e6a97c53ea73a0f60df10b587738786130d1
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Mon Oct 12 17:59:25 2026 +0100

    fix: configure maxTokens, attempt to fix problems
    
    429: {"message":"Rate limit exceeded for api_key: XXXXX. Limit type: tokens. Current limit: 120000, Remaining: 20430. Limit resets at: 2026-10-12 16:42:05 UTC","type":"throttling_error","param":null,"code":"429"}
---
 README.md                        | 3 +++
 vars/slingOsgiBundleBuild.groovy | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/README.md b/README.md
index 4026964..fba02c9 100644
--- a/README.md
+++ b/README.md
@@ -75,11 +75,14 @@ These settings can be provided as library arguments or under `jenkins` in `.slin
 | --- | --- | --- |
 | `llmaoRebuildFrequency` | `@weekly` | Cron for the dedicated job. Use `''` for manual runs only. |
 | `llmaoModel` | `gemma4-26b` | Model ID available to the PAT on the LLMAO [Models page](https://llm.apache.org/models). |
+| `llmaoMaxTokens` | `4096` | Maximum output tokens per model response; must be a positive integer. |
 | `llmaoInput` | Empty | Task prompt to send to the Pi agent. |
 | `llmaoInputFile` | Empty | Workspace-relative UTF-8 prompt file to read instead of `llmaoInput`. |
 
 Provide either an input string or an input file; the library has no default task. The library allocates its own node and checks out the project; `llmaoInputFile` must exist in that checked-out workspace. Input files are not deleted. The checkout must be clean before Pi starts, so existing changes are never silently discarded. Avoid exposing secrets to the agent, and check the Models page for who can see prompts and source files.
 
+`llmaoMaxTokens` replaces Pi's default 16,384-token output allowance for this custom model. A smaller allowance may help a request fit within the remaining PAT quota, but does not reset or increase that quota or cap the total tokens used by a multi-step job.
+
 The library runs [Pi](https://pi.dev) in Docker, configured for LLMAO's OpenAI-compatible endpoint at `https://llm.apache.org/v1`, with the selected model and temperature `0.0`. Pi can read, search, edit, and write project files and run shell commands. Extensions, MCP, automatic project instructions, stored sessions, retries, and compaction remain disabled.
 
 Each run fetches `skills/` from the `master` branch of [Apache Sling Whiteboard](https://github.com/apache/sling-whiteboard/tree/master/skills), including references and scripts. All its skills are explicitly available to Pi, including `update-sling-parent-pom`. The fetched Git revision is logged. Skills live outside the project checkout and do not appear in the diff. The parent-POM skill currently targets the latest supported release, not simply the current version plus one.
diff --git a/vars/slingOsgiBundleBuild.groovy b/vars/slingOsgiBundleBuild.groovy
index 83e5ffa..69c128d 100644
--- a/vars/slingOsgiBundleBuild.groovy
+++ b/vars/slingOsgiBundleBuild.groovy
@@ -148,6 +148,7 @@ def runLlmaoOnlyBuild(def globalConfig, Map params) {
     def llmaoConfig = [
         llmaoRebuildFrequency: '@weekly',
         llmaoModel: 'gemma4-26b',
+        llmaoMaxTokens: 4096,
         llmaoInput: '',
         llmaoInputFile: ''
     ]
@@ -168,6 +169,8 @@ def runLlmaoOnlyBuild(def globalConfig, Map params) {
                     if ( params.containsKey(key) )
                         llmaoConfig[key] = params[key]
                 }
+                if ( !(llmaoConfig.llmaoMaxTokens instanceof Integer) || llmaoConfig.llmaoMaxTokens <= 0 )
+                    error('llmaoMaxTokens must be a positive integer.')
             }
 
             stage('Configure Job') {
@@ -227,6 +230,7 @@ def runLlmaoOnlyBuild(def globalConfig, Map params) {
                                         models: [[
                                             id: llmaoConfig.llmaoModel,
                                             input: ['text'],
+                                            maxTokens: llmaoConfig.llmaoMaxTokens,
                                             samplingParams: [temperature: 0.0]
                                         ]]
                                     ]]