From f6a0f7266cd8f4e0667640574ceb9de5fd718a79 Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 10:12:19 +0200 Subject: [PATCH 1/6] fix: cache tags in workflows --- .forgejo/workflows/docker-publish-semantic.yml | 4 ++-- .forgejo/workflows/docker-publish.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/docker-publish-semantic.yml b/.forgejo/workflows/docker-publish-semantic.yml index c47a1e5..79bd5d3 100644 --- a/.forgejo/workflows/docker-publish-semantic.yml +++ b/.forgejo/workflows/docker-publish-semantic.yml @@ -88,8 +88,8 @@ jobs: build-args: | SEMANTIC_CACHE=true tags: ${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:buildcache-semantic-${{ matrix.arch }} - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:buildcache-semantic-${{ matrix.arch }},mode=min + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }} + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }},mode=max merge: runs-on: docker-amd64 diff --git a/.forgejo/workflows/docker-publish.yml b/.forgejo/workflows/docker-publish.yml index e3dad4b..3979f62 100644 --- a/.forgejo/workflows/docker-publish.yml +++ b/.forgejo/workflows/docker-publish.yml @@ -79,7 +79,7 @@ jobs: provenance: false tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:platform-${{ matrix.arch }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }} - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=min + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-${{ matrix.arch }},mode=max merge: runs-on: docker-amd64 From 88df31c3906e822703c2e611b0207e937b251e53 Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 10:18:59 +0200 Subject: [PATCH 2/6] fix: use internal cache tags --- .../workflows/docker-publish-semantic.yml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.forgejo/workflows/docker-publish-semantic.yml b/.forgejo/workflows/docker-publish-semantic.yml index 79bd5d3..e2fe658 100644 --- a/.forgejo/workflows/docker-publish-semantic.yml +++ b/.forgejo/workflows/docker-publish-semantic.yml @@ -15,11 +15,11 @@ on: - "v*.*.*" workflow_dispatch: -env: - REGISTRY: bitfreedom.net - IMAGE_NAME: ${{ github.repository }} - CACHE_IMAGE: ${{ github.repository }}-buildcache-semantic - DOCKER_BUILD_SUMMARY: "false" + env: + REGISTRY: bitfreedom.net + IMAGE_NAME: ${{ github.repository }} + CACHE_REF: ${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }} + DOCKER_BUILD_SUMMARY: "false" jobs: build: @@ -87,9 +87,9 @@ jobs: provenance: false build-args: | SEMANTIC_CACHE=true - tags: ${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }} - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-${{ matrix.arch }},mode=max + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-${{ matrix.arch }} + cache-from: type=registry,ref=${{ env.CACHE_REF }} + cache-to: type=registry,ref=${{ env.CACHE_REF }},mode=max merge: runs-on: docker-amd64 @@ -145,6 +145,6 @@ jobs: run: | docker buildx imagetools create \ $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ - ${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-amd64 \ - ${{ env.REGISTRY }}/${{ env.CACHE_IMAGE }}:platform-semantic-arm64 + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-amd64 \ + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-arm64 From 56b214ef469197b85c31786460ee997c94c424ad Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 10:21:22 +0200 Subject: [PATCH 3/6] fix: avoid docker hub lookup --- .forgejo/workflows/docker-publish-semantic.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.forgejo/workflows/docker-publish-semantic.yml b/.forgejo/workflows/docker-publish-semantic.yml index e2fe658..d39fd2f 100644 --- a/.forgejo/workflows/docker-publish-semantic.yml +++ b/.forgejo/workflows/docker-publish-semantic.yml @@ -18,7 +18,7 @@ on: env: REGISTRY: bitfreedom.net IMAGE_NAME: ${{ github.repository }} - CACHE_REF: ${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }} + DOCKER_BUILD_SUMMARY: "false" jobs: @@ -88,8 +88,8 @@ jobs: build-args: | SEMANTIC_CACHE=true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-${{ matrix.arch }} - cache-from: type=registry,ref=${{ env.CACHE_REF }} - cache-to: type=registry,ref=${{ env.CACHE_REF }},mode=max + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }} + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }},mode=max merge: runs-on: docker-amd64 From f92099de11f9762a4f39b55a4693648f3cca3a2f Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 10:24:18 +0200 Subject: [PATCH 4/6] fix: don't know what to say --- .forgejo/workflows/docker-publish-semantic.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/docker-publish-semantic.yml b/.forgejo/workflows/docker-publish-semantic.yml index d39fd2f..33da327 100644 --- a/.forgejo/workflows/docker-publish-semantic.yml +++ b/.forgejo/workflows/docker-publish-semantic.yml @@ -89,7 +89,7 @@ jobs: SEMANTIC_CACHE=true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-${{ matrix.arch }} cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }} - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }},mode=max + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }},mode=max,registry=${{ env.REGISTRY }} merge: runs-on: docker-amd64 From f364a2d123e43baca503ce36b7cea0a4cb2fc84a Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 10:28:28 +0200 Subject: [PATCH 5/6] fix: trying to replicate the non-semantic workflow --- .forgejo/workflows/docker-publish-semantic.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.forgejo/workflows/docker-publish-semantic.yml b/.forgejo/workflows/docker-publish-semantic.yml index 33da327..2fa59d5 100644 --- a/.forgejo/workflows/docker-publish-semantic.yml +++ b/.forgejo/workflows/docker-publish-semantic.yml @@ -15,11 +15,10 @@ on: - "v*.*.*" workflow_dispatch: - env: - REGISTRY: bitfreedom.net - IMAGE_NAME: ${{ github.repository }} - - DOCKER_BUILD_SUMMARY: "false" +env: + REGISTRY: bitfreedom.net + IMAGE_NAME: ${{ github.repository }} + DOCKER_BUILD_SUMMARY: "false" jobs: build: @@ -88,8 +87,8 @@ jobs: build-args: | SEMANTIC_CACHE=true tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:semantic-platform-${{ matrix.arch }} - cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }} - cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ github.repository }}:semantic-buildcache-${{ matrix.arch }},mode=max,registry=${{ env.REGISTRY }} + cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-semantic-${{ matrix.arch }} + cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:buildcache-semantic-${{ matrix.arch }},mode=max merge: runs-on: docker-amd64 From a432a65396d17ab08fd91abeae1090dd5fe6d818 Mon Sep 17 00:00:00 2001 From: alpha nerd Date: Wed, 8 Apr 2026 13:01:56 +0200 Subject: [PATCH 6/6] fix: params is never defined in ollama native backend --- router.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/router.py b/router.py index c87c5ca..2f27d94 100644 --- a/router.py +++ b/router.py @@ -2110,7 +2110,11 @@ async def chat_proxy(request: Request): # Only cache when no max_tokens limit was set — otherwise # finish_reason=length might just mean max_tokens was hit, # not that the context window was exhausted. - _req_max_tok = params.get("max_tokens") or params.get("max_completion_tokens") or params.get("num_predict") + _req_max_tok = ( + params.get("max_tokens") or params.get("max_completion_tokens") or params.get("num_predict") + if use_openai else + (options.get("num_predict") if options else None) + ) if _dr == "length" and not _req_max_tok: _pt = getattr(chunk, "prompt_eval_count", 0) or 0 _ct = getattr(chunk, "eval_count", 0) or 0