feat: add Model Serving connector and plugin#239
Merged
Conversation
This was referenced Apr 3, 2026
76a2618 to
41a0074
Compare
calvarjorge
reviewed
Apr 8, 2026
MarioCadenas
requested changes
Apr 8, 2026
218f9b5 to
cab05df
Compare
Add the core Model Serving plugin that provides an authenticated proxy to Databricks Model Serving endpoints. Includes the connector layer (SDK client wrapper) and the plugin layer (Express routes for invoke/stream). Also adds UPSTREAM_ERROR SSE error code for propagating API errors. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
The serving plugin was not forwarding the abort signal to the serving connector, unlike the genie plugin. Without the signal, the connector's fetch request cannot be cancelled and the abort-check loop never triggers. Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
- Use SDK servingEndpoints.query() for invoke instead of raw fetch
- Use SDK apiClient.request({ raw: true }) for streaming SSE
- Fix exports() to support asUser via files plugin pattern
- Rename DATABRICKS_SERVING_ENDPOINT to DATABRICKS_SERVING_ENDPOINT_NAME
- Throw error on SSE buffer overflow instead of silent discard
- Add OBO rationale comment in injectRoutes
- Add SSE spec comments for empty line handling
- Add ServingEndpointHandle type with asUser support
Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
The SDK's readableToWeb() closes the controller on "end" event. Calling reader.cancel() unconditionally in the finally block causes a "Controller is already closed" error on subsequent requests. Only cancel when the signal was actually aborted (early termination). Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
…ndle Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
2080612 to
1996ad6
Compare
22df022 to
ac93525
Compare
Eliminate double parse/serialize cycle in the serving streaming path. Previously, the connector parsed upstream SSE into JS objects, then StreamManager re-serialized them back to SSE for the browser. Since none of the StreamManager features (reconnection replay, event buffering, multi-client broadcast) are meaningful for serving streams, pipe the raw ReadableStream directly to the Express response instead. - Connector stream() now returns raw ReadableStream<Uint8Array> - Plugin _handleStream pipes bytes via node:stream/promises pipeline - Remove parsed SSE generator, ServingStreamOptions, mapUpstreamError - Remove stream from ServingEndpointMethods (no programmatic consumers) - Remove servingStreamDefaults (StreamManager no longer used) Signed-off-by: Pawel Kosiec <pawel.kosiec@databricks.com>
ac93525 to
99bbfad
Compare
MarioCadenas
approved these changes
Apr 10, 2026
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
/api/serving/:alias/invokeand/api/serving/:alias/streamUPSTREAM_ERRORSSE error code for propagating Databricks API errorsDemo
model-serving-demo-compressed.mp4
PR Stack — Model Serving