damjad opened a new pull request, #29223:
URL: https://github.com/apache/flink/pull/29223
## 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
- `testNullVersionProducesUnversionedUrl` — `null` 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?
- [X] Yes (please specify the tool below)
Generated-by: Claude Sonnet 4.6
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]