Skip to content

[FLINK-40692][model] Make model-version optional in Triton inference URL - #29223

Open
damjad wants to merge 2 commits into
apache:masterfrom
damjad:fix/flink-40692-model-version-optional
Open

damjad wants to merge 2 commits into
apache:masterfrom
damjad:fix/flink-40692-model-version-optional

Conversation

@damjad

@damjad damjad commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of the change

The KServe V2 inference protocol defines two endpoint forms:

  • Unversioned: POST /v2/models/{name}/infer — server selects a "default" version based on its own policies (typically the latest ready version)
  • Versioned: POST /v2/models/{name}/versions/{version}/infer

TritonOptions.MODEL_VERSION previously defaulted to the string "latest", causing TritonUtils.buildInferenceUrl to always emit .../versions/latest/infer. Triton does not recognise "latest" as a valid version identifier and returns HTTP 404.

Brief change log

  • Remove default value from TritonOptions.MODEL_VERSION (was "latest", now noDefaultValue()); update description to document the unversioned fallback behaviour
  • Update TritonUtils.buildInferenceUrl to emit the unversioned path (/v2/models/{name}/infer) when modelVersion is null or empty, and the versioned path when an explicit version is supplied
  • Add TritonInferenceUrlTest covering null version, empty version, explicit version, and common endpoint prefix variants

Verifying this change

  • testNullVersionProducesUnversionedUrlnull version → /v2/models/my-model/infer
  • testEmptyVersionProducesUnversionedUrl"" version → /v2/models/my-model/infer
  • testExplicitVersionProducesVersionedUrl"1" version → /v2/models/my-model/versions/1/infer
  • 3 additional tests cover /v2, /v2/models, and trailing-slash endpoint prefix normalisation

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): no
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects how connectors interact with Flink: no
  • The SQL / Table API: no
  • Core ML / Model inference (flink-model-triton): yes

Documentation

TritonOptions.MODEL_VERSION description updated inline to document that omitting the option uses the unversioned endpoint per the KServe V2 spec.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Sonnet 4.6

…URL.

The KServe V2 inference protocol defines two endpoint forms:
  /v2/models/{name}/infer          (unversioned)
  /v2/models/{name}/versions/{v}/infer (versioned)

When no version is specified the server selects a version based on
its own policies (typically the latest ready version).

Previously TritonOptions.MODEL_VERSION defaulted to the string
'latest', which caused TritonUtils.buildInferenceUrl to always emit
a versioned URL path. Triton does not recognise 'latest' as a valid
version identifier and returns HTTP 404 for such requests.

Remove the default value from MODEL_VERSION so the option is truly
optional. Update buildInferenceUrl to emit the unversioned path when
modelVersion is null or empty, and the versioned path when an explicit
version is supplied. Add TritonInferenceUrlTest to cover both paths
and the common endpoint prefix variants.

Generated-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@flinkbot

flinkbot commented Sep 17, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@damjad

damjad commented Sep 17, 2026

Copy link
Copy Markdown
Contributor Author

@featzhang tagging you for visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants