Skip to content

fix: defer optional vLLM imports for Tinker clients - #631

Merged
pan-x-c merged 2 commits into
agentscope-ai:mainfrom
nashjojo:codex/tinker-optional-vllm-imports
Sep 29, 2026
Merged

pan-x-c merged 2 commits into
agentscope-ai:mainfrom
nashjojo:codex/tinker-optional-vllm-imports

Conversation

@nashjojo

Copy link
Copy Markdown
Collaborator

Description

Importing TinkerModel reaches the shared multimodal helpers through BaseInferenceModel and experience extraction. Those helpers currently import vLLM at module load time, so a text-only Tinker installation fails before it can create a client when the optional vLLM package is absent.

Load ModelConfig when constructing vLLMMultiModalRender, and load the synchronous/asynchronous vLLM parsers when their methods are called. Postpone vLLM-only type annotations. Text helpers and Tinker imports no longer require vLLM; selecting the vLLM renderer without it reports the required extra. Unrelated import failures retain their original error.

Message normalization and the arguments forwarded to the vLLM parsers are unchanged. No sampling, training-loss, or server API behavior is modified.

Validation

  • Five local CPU tests passed: text helpers and TinkerModel imports with vLLM blocked, the missing-renderer-dependency message, preservation of unrelated import failures, and synchronous/asynchronous parser delegation with normalized multimodal messages.
  • The local environment has Tinker 0.25.0 and no installed vLLM. The import tests also use fresh subprocesses to avoid relying on modules cached by other tests.
  • Black, isort, flake8, mypy, and git diff --check passed.
  • Parser delegation was checked with mocks. No model download, media fetch, GPU inference, or training was run.

Checklist

  • Focused CPU tests and static checks passed.
  • Module documentation describes the optional dependency boundary.
  • Code is ready for review.
  • Full repository and GPU multimodal integration tests.

@nashjojo

Copy link
Copy Markdown
Collaborator Author

/unittest-module-common

@nashjojo

Copy link
Copy Markdown
Collaborator Author

/unittest-pattern-OptionalVLLMImportTest or VLLMParserDelegationTest

@github-actions

Copy link
Copy Markdown

unittest: Run #1886

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
5 5 0 0 0 0 0 20.8s

🎉 All tests passed!

Github Test Reporter by CTRF 💚

@pan-x-c

pan-x-c commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

/unittest-module-common

@github-actions

Copy link
Copy Markdown

unittest: Run #1887

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Pending ⏳ Other ❓ Flaky 🍂 Duration ⏱️
155 154 0 1 0 0 0 37m 47s

🎉 All tests passed!

Github Test Reporter by CTRF 💚

@pan-x-c
pan-x-c merged commit b3f617f into agentscope-ai:main Sep 29, 2026
1 check passed
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