Skip to content

Share caption policy and retries across native vLLM and API workers - #77

Merged
bghira merged 1 commit into
mainfrom
fix/shared-caption-pipeline
Sep 10, 2026
Merged

bghira merged 1 commit into
mainfrom
fix/shared-caption-pipeline

Conversation

@bghira

@bghira bghira commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Summary

  • Move caption acceptance, JSON validation/repair, refusal matching, semantic retries, and stage progression into a backend-independent pipeline used by both workers.
  • Add shared inference/stage output_processing, response_format, and retry_response_format configuration. Keep existing API-worker policy flags as compatibility aliases.
  • Support native vLLM constrained decoding through both structured-output and older guided-decoding APIs, preserving native sampling controls and isolated retry overrides.
  • Fix native hot reload retaining stale stage settings, unsuccessful items reaching later stages, and decoded images being discarded before generation. Preserve original dimensions through resize recovery.
  • Reuse encoded API images across stages and release request buffers after each batch. Update the recipe and example configuration.

Validation

  • Full suite: 541 passed, 2 skipped.
  • Shared stage runner: 100% statement coverage; locally calculated executable-line patch coverage approximately 99%.
  • Focused Ruff checks and git diff --check pass.
  • Cross-backend regression tests cover malformed JSON, semantic retries, constrained decoding, native sampling, stage failures, config reload, and image-buffer reuse.
  • Native vLLM calls are mocked in the CPU test suite; no GPU throughput comparison is claimed.

No deployments, worker restarts, or changes to running caption jobs.

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.91892% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/caption_flow/workers/caption.py 97.97% 2 Missing ⚠️
src/caption_flow/utils/output_policy.py 99.27% 1 Missing ⚠️
src/caption_flow/utils/vllm_config.py 94.44% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/caption_flow/models.py 96.21% <100.00%> (+0.06%) ⬆️
src/caption_flow/utils/image_processor.py 98.66% <100.00%> (+8.12%) ⬆️
src/caption_flow/workers/openai_compatible.py 91.75% <100.00%> (-0.62%) ⬇️
src/caption_flow/workers/pipeline.py 100.00% <100.00%> (ø)
src/caption_flow/utils/output_policy.py 99.27% <99.27%> (ø)
src/caption_flow/utils/vllm_config.py 96.66% <94.44%> (+3.33%) ⬆️
src/caption_flow/workers/caption.py 74.55% <97.97%> (+10.70%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bghira
bghira merged commit a34af75 into main Sep 10, 2026
4 checks passed
@bghira
bghira deleted the fix/shared-caption-pipeline branch September 10, 2026 15:42
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.

1 participant