Build scaffolding without tensorrt_llm dependency
Many community contributors hope to run scaffolding without building trt-llm. In theory, scaffolding can also be run through non TRT LLM workers, such as OpenAI API, and we can find ways to support this.
Hi, I reproduced the current import boundary behind this issue and would like to contribute a narrow first slice if the direction is still wanted.
On current main (573bd5f0b8414566bd6183f74b06f8c8a99e6a69), even canonical import of the standard-library-only tensorrt_llm.scaffolding.math_utils initializes tensorrt_llm/__init__.py first. In a CPU environment with the OpenAI/MCP/Transformers dependencies installed but no TensorRT-LLM runtime stack, both that import and import tensorrt_llm.scaffolding fail before any Scaffolding source frame is reached. Direct loading of the exact math_utils.py control succeeds.
The source audit shows a second coupling layer after the package root:
scaffolding/__init__.py -> eagerly exports worker.py, controllers, benchmark, replay
worker.py -> imports LLM, executor, KV/Scheduler config, SamplingParams
task.py/controller.py -> import executor result and logger types at runtime
The result passed identically in three fresh subprocesses. This means OpenAI-only controller execution is structurally coupled to the full runtime even when it does not use an in-process TRT worker.
Could a maintainer approve a narrow dependency-boundary contribution before implementation? I propose:
- define the supported lightweight public surface and dependency direction first;
- separate generic task/result/controller protocols and
OpenaiWorkerfrom the in-processTRTLLMWorkeradapter; - avoid eager imports of optional worker/benchmark/replay surfaces;
- add a clean CPU import-and-minimal-controller test that fails if native/runtime modules are imported;
- preserve existing imports through compatibility re-exports where feasible, without changing execution semantics.
There is no assignee or active PR referencing this issue visible today.