Skip to content

feat(benchmarking): add Bayesian model fitting and CI workflow#6089

Draft
mfleader wants to merge 2 commits into
ogx-ai:mainfrom
mfleader:api-latency-analysis
Draft

feat(benchmarking): add Bayesian model fitting and CI workflow#6089
mfleader wants to merge 2 commits into
ogx-ai:mainfrom
mfleader:api-latency-analysis

Conversation

@mfleader

@mfleader mfleader commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Depends on #6088 — review that first. Retarget to main after #6088 merges.

What does this PR do?

Adds Bayesian model fitting, diagnostics, and a CI workflow on top of the experiment pipeline from #6088. Estimates changes in API response latency (mean, p50, p95, p99) with uncertainty intervals. The false positive detection runs a negative control (same code as comparison, run independently) to verify the experiment isn't producing spurious differences.

  • analysis/fit_resp_latency_model.py — Wald (Inverse Gaussian) model with HSGP (Hilbert Space Gaussian Process) temporal adjustment, fitted via nutpie
  • analysis/diagnostics.py — analysis quality assessment: estimation reliability, model assumptions, data fit
  • analysis/decisions.py — quantile decisions and false positive detection
  • analysis/wald_numba.py — numba dispatch shim so nutpie can compile the Wald distribution
  • analysis/smoke_test.py — smoke test for the analysis dependencies (nutpie, NetCDF, LOO)
  • analysis/MODEL.md — model specification
  • .github/workflows/response-latency-regression-benchmark.yml — daily CI comparing latest release vs main

Test Plan

uv sync --group benchmark-regression
uv run python -m pytest benchmarking/api_latency_comparison/experiment/test_benchmark.py -v -s

test_benchmark.py runs the full pipeline (experiment + model fitting) and verifies analysis artifacts: decisions.csv, fp-results.json, and idata.nc.

mfleader and others added 2 commits June 12, 2026 21:30
Adds a data collection pipeline under
benchmarking/api_latency_comparison/ for comparing per-request API
latency between two OGX versions.

The orchestrator sets up git worktrees for each version, generates a
randomized complete block design experiment matrix, starts servers
with CPU pinning via mirakuru, runs Locust against each version, and
records per-request response times. A third "comparison control"
group runs the same code as comparison to catch false positives from
environmental noise.

First of two commits. Follow-up adds model fitting and a CI workflow.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthew F Leader <mleader@redhat.com>
Fit a Wald (Inverse Gaussian) latency model with HSGP (Hilbert Space
Gaussian Process) temporal adjustment via nutpie. Detect regressions
using posterior predictive quantile decisions with false positive
calibration. Add MCMC diagnostics and a daily CI workflow comparing
latest release against main.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Matthew F Leader <mleader@redhat.com>
@mfleader mfleader force-pushed the api-latency-analysis branch from c3d0510 to 05d9a6a Compare June 12, 2026 22:35
cdoern added a commit that referenced this pull request Jun 15, 2026
…sults (backport #6093) (#6117)

## Summary
- The catch-all `except Exception` in `openai_search_vector_store` was
silently swallowing backend errors and returning empty results with HTTP
200
- Clients had no way to distinguish "no matching documents" from "the
search failed"
- This masked bugs like the milvus-lite 3.0 `chunk_content` KeyError
(#6089), where file_search appeared to work but retrieval silently
returned nothing
- Now re-raises the exception so it surfaces as a 500 to the client
- Also fixes `test_openai_vector_store_with_chunks` which was passing
`filters={"topic": "ai"}` (the old shorthand format) instead of the
typed format `{"type": "eq", "key": "topic", "value": "ai"}` required
since #4471. The error was silently swallowed, and the assertion loop
over empty results never executed, so the test appeared to pass.

Closes #6092

## Test plan
- Added unit test `test_search_vector_store_propagates_backend_errors`
that verifies a `KeyError` from the backend propagates to the caller
- Fixed `test_openai_vector_store_with_chunks` filter format so it
actually exercises the filter path
- Reproduced locally with milvus-lite 3.0: before the fix, search
returns 200 with empty results; after, returns 500<hr>This is an
automatic backport of pull request #6093 done by
[Mergify](https://mergify.com).

Signed-off-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>
mfleader pushed a commit to mfleader/llama-stack that referenced this pull request Jun 15, 2026
…sults (ogx-ai#6093)

## Summary
- The catch-all `except Exception` in `openai_search_vector_store` was
silently swallowing backend errors and returning empty results with HTTP
200
- Clients had no way to distinguish "no matching documents" from "the
search failed"
- This masked bugs like the milvus-lite 3.0 `chunk_content` KeyError
(ogx-ai#6089), where file_search appeared to work but retrieval silently
returned nothing
- Now re-raises the exception so it surfaces as a 500 to the client
- Also fixes `test_openai_vector_store_with_chunks` which was passing
`filters={"topic": "ai"}` (the old shorthand format) instead of the
typed format `{"type": "eq", "key": "topic", "value": "ai"}` required
since ogx-ai#4471. The error was silently swallowed, and the assertion loop
over empty results never executed, so the test appeared to pass.

Closes ogx-ai#6092

## Test plan
- Added unit test `test_search_vector_store_propagates_backend_errors`
that verifies a `KeyError` from the backend propagates to the caller
- Fixed `test_openai_vector_store_with_chunks` filter format so it
actually exercises the filter path
- Reproduced locally with milvus-lite 3.0: before the fix, search
returns 200 with empty results; after, returns 500

---------

Signed-off-by: Derek Higgins <derekh@redhat.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Charlie Doern <cdoern@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant