Allow disabling chat completions persistence via null store - #1
Open
meffmadd wants to merge 9 commits into
Open
Conversation
…l store Allow operators to disable chat completion persistence by setting storage.stores.inference to null in a run config. When the reference is absent of value None, the auto-router factory skips constructing and initializing the InferenceStore entirely: no inference_store table is created and no background write workers are started, so no chat completion payload is ever persisted. Chat completions continue to work for both streaming and non-streaming requests. The history endpoints (list, retrieve, messages) raise NotImplementedError, which the exception mapping translates to HTTP 501, rather than returning an empty list or a 404. Other stores stay enabled, so disabling inference persistence is independent of the rest of the storage layer. This follows the same optional-store pattern the Responses store already uses. Signed-off-by: Matt, Matthias <matthias.matt@tuwien.ac.at>
Drop the formatting-only changes that were bundled into 'feat(inference): allow disabling chat completions persistence via null store' so the feature diff is limited to the actual behavior change: - Restore the pre-existing formatting of the get_auto_router_impl signature in src/ogx/core/routers/__init__.py and of untouched lines in the touched unit tests. - Normalize lines added by the feature (new tests and the recording generator script) with the pinned ruff 0.12.2 used by pre-commit. - Add the project license header to the recording generator script and make it executable like the other scripts/ helpers, and add noqa: N802 markers to its BaseHTTPRequestHandler.do_GET/do_POST, matching precedent in tests/integration/telemetry/collectors/otlp.py. No functional changes; all affected unit tests still pass. Signed-off-by: Matt, Matthias <matthias.matt@tuwien.ac.at>
Signed-off-by: Matt, Matthias <matthias.matt@tuwien.ac.at>
meffmadd
force-pushed
the
disable-inference-store
branch
from
August 11, 2026 08:02
05ede32 to
775dd47
Compare
meffmadd
force-pushed
the
disable-inference-store
branch
from
August 11, 2026 13:31
fb55315 to
9bfcdfb
Compare
Signed-off-by: Matt, Matthias <matthias.matt@tuwien.ac.at>
Signed-off-by: Matt, Matthias <matthias.matt@tuwien.ac.at>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Allow operators to disable chat completion persistence by setting
storage.stores.inferencetonullin a run config. When the reference isNone, the auto-router factory inget_auto_router_implskips constructing and initializing theInferenceStoreentirely: noinference_storetable is created and no background write workers are started, so no chat completion payload is ever persisted.Behavior when persistence is disabled:
list,retrieve,messages) raiseNotImplementedError, which the exception mapping translates to HTTP 501 — rather than returning an empty list or a 404.responses,datasets,eval,files,prompts,vector_io) stay enabled, so disabling inference persistence is independent of the rest of the storage layer.inferencekey keeps persistence enabled; only an explicitinference: nulldisables it.This follows the same optional-store pattern the Responses store already uses.
Configuration
Changes
src/ogx/core/routers/__init__.py— build/initialize theInferenceStoreonly when the reference is notNone.src/ogx/core/storage/README.md,src/ogx/distributions/README.md— document the opt-out and its runtime behavior.tests/unit/core/routers/test_inference_router.py— non-streaming and streaming completions with no store;list/get/messagesraiseNotImplementedError.tests/unit/core/test_storage_references.py— omit-vs-null parsing: omitted key keeps the enabled default,nulldisables.tests/unit/server/test_resolver.py— resolver does not construct/initialize anInferenceStorewhen the reference isNone.tests/integration/inference/test_inference_store_disabled.py(recorded responses fromopenai/gpt-4o) — end-to-end behavior over the full HTTP path, including asserting that noinference_storetable exists in the SQL backend.Test Plan
Unit tests
Output:
Integration tests (replay mode — no API keys required)
Output:
Both suites pass on this branch. The integration tests run in replay mode against the committed recordings, so they are deterministic and need no API keys.