Skip to content

fix(byok-ollama): stop systemd service before rebind + non-zero fallback pricing - #49074

Merged
pelikhan merged 3 commits into
mainfrom
copilot/add-pricing-for-qwen2-5b
Jul 30, 2026
Merged

fix(byok-ollama): stop systemd service before rebind + non-zero fallback pricing#49074
pelikhan merged 3 commits into
mainfrom
copilot/add-pricing-for-qwen2-5b

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Daily BYOK Ollama test fails with HTTP 400 ("no AI credits pricing") due to two compounding bugs.

Root causes

Ollama not reachable from Docker containers
The Ollama installer starts a systemd service bound to 127.0.0.1:11434. The "Start Ollama service" step attempts OLLAMA_HOST=0.0.0.0:11434 ollama serve &, which silently fails (bind: address already in use). The localhost readiness check still passes, masking the failure — but host.docker.internal:11434 is unreachable from the api-proxy container.

Zero-value fallback pricing treated as absent
AWF api-proxy v0.27.42 rejects defaultAiCreditsPricing: {input:0, output:0} as "not configured", returning HTTP 400 for any model not in its built-in pricing table.

Changes

  • Ollama binding — stop the systemd-managed service before rebinding to 0.0.0.0:

    run: |
      sudo systemctl stop ollama 2>/dev/null || true
      sleep 2
      ollama serve &
  • Fallback pricing — replace zero values with a near-zero positive rate so the api-proxy recognises the fallback as configured:

    models:
      default-ai-credits-pricing:
        input: 0.000001   # was: 0
        output: 0.000001  # was: 0

    At this rate the cost per run is negligible (<$0.0001) for a local free model.

…ult pricing for BYOK test

- Add `sudo systemctl stop ollama 2>/dev/null || true` before `ollama serve &`
  to release the 127.0.0.1:11434 port bound by the installer's systemd service,
  so the new instance can bind to 0.0.0.0:11434 and be accessible from Docker
  containers via host.docker.internal:11434
- Change defaultAiCreditsPricing from {input:0, output:0} to {input:0.000001,
  output:0.000001} — AWF api-proxy v0.27.42 treats all-zero pricing as
  "not configured" and rejects requests with HTTP 400; tiny positive values
  are recognized as valid fallback pricing for this free local model

Closes #49007

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add pricing for model qwen2.5:0.5b in daily workflow fix(byok-ollama): stop systemd service before rebind + non-zero fallback pricing Jul 30, 2026
Copilot AI requested a review from pelikhan July 30, 2026 07:12
@pelikhan
pelikhan marked this pull request as ready for review July 30, 2026 07:16
Copilot AI review requested due to automatic review settings July 30, 2026 07:16
@pelikhan pelikhan added the awf label Jul 30, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot update the compiler to enforce positive values in pricing fields that are present in the frontmatter

@github-actions

Copy link
Copy Markdown
Contributor

Triage Summary

  • Category: chore
  • Risk: low
  • Priority Score: 7/100 (impact 3 + urgency 2 + quality 2)
  • Recommended Action: close

WIP PR with an empty diff (0 files changed) and an unstarted task checklist — appears stale/superseded. Recommend closing unless actively being worked.

Generated by 🔧 PR Triage Agent · auto · 54.9 AIC · ⌖ 5.64 AIC · ⊞ 7.9K ·

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Attempts to restore the daily Ollama BYOK workflow by rebinding Ollama and configuring fallback pricing.

Changes:

  • Stops the systemd Ollama service before rebinding.
  • Adds positive fallback pricing.
  • Regenerates the compiled workflow.
Show a summary per file
File Description
.github/workflows/daily-byok-ollama-test.md Updates Ollama startup and pricing configuration.
.github/workflows/daily-byok-ollama-test.lock.yml Regenerates the compiled workflow.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2
  • Review effort level: Medium

env:
OLLAMA_HOST: "0.0.0.0:11434"
run: |
sudo systemctl stop ollama 2>/dev/null || true
Comment on lines +100 to +101
input: 0.000001
output: 0.000001
… fields

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot update the compiler to enforce positive values in pricing fields that are present in the frontmatter

Added validateDefaultAiCreditsPricing in pkg/workflow/model_costs_pricing_validation.go and registered it in validateCoreToolConfiguration. The compiler now rejects any models.default-ai-credits-pricing block where input, output, cache_read, or cache_write is zero or negative, with a message pointing to using a small positive rate (e.g. 0.000001) for effectively-free self-hosted models.

Commit: feat(compiler): enforce positive values in default-ai-credits-pricing fields

@pelikhan
pelikhan merged commit 8b250d7 into main Jul 30, 2026
29 checks passed
@pelikhan
pelikhan deleted the copilot/add-pricing-for-qwen2-5b branch July 30, 2026 07:50
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Daily BYOK Ollama Test has no AI credits pricing for model (qwen2.5:0.5b)

3 participants