feat: add serving type generator, Vite plugin, and UI hooks#240
Open
pkosiec wants to merge 6 commits intopkosiec/serving-1-corefrom
Open
feat: add serving type generator, Vite plugin, and UI hooks#240pkosiec wants to merge 6 commits intopkosiec/serving-1-corefrom
pkosiec wants to merge 6 commits intopkosiec/serving-1-corefrom
Conversation
This was referenced Apr 3, 2026
83dab4c to
76a2618
Compare
735aa72 to
9b7bcc1
Compare
76a2618 to
41a0074
Compare
9b7bcc1 to
e2336c1
Compare
Add Vite plugin that auto-generates TypeScript types from serving endpoint OpenAPI schemas. Includes AST-based server file extraction (@ast-grep/napi), schema-to-TypeScript conversion, and caching. Also adds useServingInvoke and useServingStream React hooks in appkit-ui with full type-safe registry support. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
- Store requestKeys[] in serving cache instead of regex-parsing TypeScript type strings in schema-filter (fragile indentation dependency) - Add overrideBody parameter to useServingStream's stream() to allow callers to pass fresh body without waiting for useMemo recomputation - Lazy-init WorkspaceClient in type generator (skip when no endpoints resolve) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Chunks persisted after onComplete, causing the streaming bubble to remain visible alongside the committed message (duplicate response). Now chunks are cleared atomically with setStreaming(false) so React batches all state updates in one render. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Clearing chunks in the hook's .then() handler caused a race with React batching — chunks were empty before the component could commit them. Let consumers decide when to clear via reset() instead. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
Without a .catch(), if connectSSE rejects the promise is unhandled and setStreaming(false) never fires, leaving the hook in a broken state. This matches the pattern used by the genie chat hook. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
2657962 to
8687067
Compare
The invoke callback is recreated whenever body changes (via useCallback deps), which triggers the useEffect cleanup that aborts in-flight requests. Adding overrideBody allows callers to use a stable body while passing the real payload per-invocation, matching useServingStream. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
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
@ast-grep/napi) for automatic endpoint discoveryuseServingInvokeanduseServingStreamReact hooks with type-safe registry supportDemo
model-serving-demo-compressed.mp4
PR Stack — Model Serving