feat: harden inference path and add drop-in sql entry point - #2
Merged
Merged
Conversation
- Ask about each distinct input once per invocation and copy the answer to every row sharing it, so constant input costs one request - Scale the probability-sum tolerance with the criteria count - Measure the per-row cap and batch split on JSON-encoded size; only suggest lowering batch_size when the batch has more than one row - Keep score criterion labels in the request when a description is set - Accept dictionary-encoded text input - Hold the concurrency permit only while a request is in flight - Add datafusion_jev::sql / sql_with_options as a drop-in for SessionContext::sql, with a clear error on strict SQL dialects - Rewrite README and crate docs for users; expand tests to 24
eddietejeda
requested review from
rohan-hotdata
and removed request for
a team
September 23, 2026 17:21
| This first version supports single-question calls. `questions := ...` and the JSON configuration escape hatch are not implemented. It follows MotherDuck's public interface for the supported subset; it is not MotherDuck code. | ||
| - **NULL text** returns NULL without calling the service. | ||
| - **Repeated text** is asked once and the answer is copied to every matching row. | ||
| A constant like `prompt_jev('hello', ...)` costs one request no matter how many rows. |
There was a problem hiding this comment.
nit: Qualify the dedup claim as per batch of up to 256 rows. (not blocking)
Dedup state lives inside one invoke_async_with_args call. ideal_batch_size returns 256 (src/udf.rs:359), and each partition invokes separately. A constant over 10,000 rows therefore costs about 40 requests, not one. Users who trust "no matter how many rows" underestimate cost.
Suggested change
| A constant like `prompt_jev('hello', ...)` costs one request no matter how many rows. | |
| Within each batch of up to 256 rows, a constant like `prompt_jev('hello', ...)` costs one request. |
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.
Summary
batch_sizewhen the batch has more than one rowdatafusion_jev::sql/sql_with_optionsas a drop-in forSessionContext::sql, with a clear error on strict SQL dialectsValidation
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo testall pass