Repository navigation
feat(ai): warn once per worker when built-in ONNX inference is used - #769
Merged
johnstonmatt merged 2 commits intoNov 13, 2026
Merged
Conversation
Built-in ONNX inference is being considered for deprecation, so users should learn that from their function logs. Warn once per worker per entry point, for both Supabase.ai.Session("gte-small") and onnxruntime InferenceSession.create, rather than on every invocation.
- Add warnOnnxUsage in ext/ai/js/onnxruntime/onnx.js, which de-duplicates by entry point and logs via console.warn.
- Call it from the gte-small branch of the Session constructor in ext/ai/js/ai.js and from InferenceSession.fromBuffer.
- Add integration tests that capture worker log events and assert exactly one warning per entry point.
- Add a second gte-small session to the supabase-ai test case to check that repeated sessions in one worker do not repeat the warning.
nyannyacha
approved these changes
Nov 13, 2026
The ingress main worker creates a gte-small session at boot to warm the model cache, which would have logged the deprecation warning on every instance. Warning in Session.run and InferenceSession.run counts actual model calls instead.
johnstonmatt
deleted the
FUNC-1090/log-onnx-model-calls-to-measure-feature-usage
branch
November 13, 2026 19:57
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.
Built-in ONNX inference is being considered for deprecation, so this surfaces that in users' function logs. A warning is logged once per worker per entry point when a model is run, rather than on every invocation, for both
Supabase.ai.Session("gte-small").runand onnxruntime'sInferenceSession.run.Creating a session doesn't warn. The ingress main worker creates a gte-small session at boot to warm the model cache, and that isn't user usage.
warnOnnxUsageinext/ai/js/onnxruntime/onnx.js, which de-duplicates by entry point and logs viaconsole.warn.Session.runinext/ai/js/ai.jsand fromInferenceSession.run.supabase-aitest case runs the model twice, and also creates a second gte-small session without running it, to check that neither repeats nor adds a warning.