docling-java icon indicating copy to clipboard operation
docling-java copied to clipboard

[Bug] VLM pipeline model options are mistyped as String and missing temperature

Open edeandrea opened this issue 1 day ago • 1 comments

Description

Two related gaps in how the VLM pipeline model options are typed. Found while scoping #819; kept out of that PR because the first half is a breaking change and the PR is otherwise additive.

1. vlmPipelineModelLocal / vlmPipelineModelApi are typed as String (breaking to fix)

ConvertDocumentOptions declares both as String:

@JsonProperty("vlm_pipeline_model_local")
@Nullable
private String vlmPipelineModelLocal;

@JsonProperty("vlm_pipeline_model_api")
@Nullable
private String vlmPipelineModelApi;

The server declares them as objects:

vlm_pipeline_model_local: Annotated[Optional[VlmModelLocal], ...] = None
vlm_pipeline_model_api: Annotated[Optional[VlmModelApi], ...] = None

VlmModelLocal and VlmModelApi already exist in the same package, fully modeled — they are simply not wired to these two fields, so nothing references them. As it stands, a caller cannot set either option correctly: a String serializes to a JSON string where the server expects an object.

Changing the field types breaks source and binary compatibility for anyone passing a String today, so this wants its own release note and a minor-version bump.

2. VlmModelLocal and VlmModelApi are both missing temperature

The server declares it on both:

temperature: Annotated[
    float,
    Field(
        description="Temperature parameter controlling the reproducibility of the result.",
        examples=[0.0, 1.0],
    ),
] = 0.0

Adding @JsonProperty("temperature") @Nullable private Double temperature; to each is additive and could land independently of the retyping above.

Note

Docling Serve marks vlm_pipeline_model, vlm_pipeline_model_local and vlm_pipeline_model_api as deprecated in favor of vlm_pipeline_preset / vlm_pipeline_custom_config (both mapped in #819). That is an argument for fixing these cheaply rather than elaborately, but not for leaving them wrong — the deprecated options still work and are the only way to reach a specific local or API model today.

Verified against

docling-serve v1.35.0–v1.41.0, docling 2.155.0.

edeandrea avatar Dec 01 '26 15:12 edeandrea

Dug into the history on both parts of this:

Part 1 (String vs. object typing) — this has always been a bug, not something that drifted with a version bump. VlmModelLocal/VlmModelApi and the mistyped String fields in ConvertDocumentOptions were both introduced in the very same initial commit (106fef4/4c143cc, 2025-10-19/21). The classes existed in that commit but were never wired to the two fields — wrong from day one.

Part 2 (missing temperature) — this one did track an upstream change:

  • Our VlmModelLocal/VlmModelApi classes were modeled on 2025-10-19.
  • Upstream, temperature was added to both classes a week later, on 2025-10-27, in docling-jobkit commit 5b1914c ("fix: missing temperature parameter for vlm pipeline models", docling-jobkit#69), first released in docling-jobkit v1.7.1.
  • docling-serve picked that up starting around v1.7.x/v1.8.0 (which pins docling-jobkit>=1.8.0, well past the fix).

So part 2 was correct when we modeled it, then went stale a week later when the server added the field upstream — we never caught up. Part 1 isn't tied to any version at all; it was simply wrong from the start.

edeandrea avatar Dec 01 '26 18:12 edeandrea