[Bug Report] `TransformerBridge.boot_*` methods are invisible to static type checkers
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- developer-experience, tooling
Research direction
Read transformer_lens/model_bridge.py and the three source locations named in the report: sources/transformers/__init__.py:31, sources/native/__init__.py:115, and sources/tl_legacy.py:226. Compare the boot_* signatures and decide how to expose them to static type checkers while preserving the bridge-to-sources import direction. Done when calls such as TransformerBridge.boot_native(cfg) are recognized and have a typed return value.
Written by the indexing model from the issue text.
Description
boot_transformers, boot_native and boot_tl_legacy are attached to TransformerBridge at import time with setattr(TransformerBridge, "boot_...", staticmethod(boot)), in sources/transformers/__init__.py:31, sources/native/__init__.py:115 and sources/tl_legacy.py:226. Because the class body never declares them, static type checkers flag every call, even though the package ships py.typed:
from transformer_lens.model_bridge import TransformerBridge
model = TransformerBridge.boot_native(cfg)
# ty: Class `TransformerBridge` has no attribute `boot_native`
It also means no autocomplete and an untyped return value in editors.
Workaround: from transformer_lens.model_bridge.sources import boot_native. This works and is fully typed.
Possible fixes, which keep the bridge → sources import direction intact:
- Declare the methods on the class under
if TYPE_CHECKING:, using the source signatures, or - Define them as real
@staticmethods onTransformerBridgethat lazily import and delegate to the sourceboot.
Versions: transformer-lens 4.3.0, ty 0.0.97, Python 3.14
- Dominant language
- Python
- Stars
- 3.9k
- Forks
- 708
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 82
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TransformerLensOrg/TransformerLens
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TransformerLensOrg/TransformerLens#1979 ·
Maintainers usually reply within 1 day
-
[Proposal] Demo: auditing a published LLM-written weight edit (Weight-Space Programming, Qwen3.5-0.8B loop fix) with TransformerBridgePossibly taken @emerardd claimed this today. Opencomplexity-moderate demo TransformerBridge
TransformerLensOrg/TransformerLens#1978 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
-
[Bug Report] `blocks.N.hook_out` never fires on OpenAI GPT because the HF block returns a listPossibly taken @ska2704 claimed this 1 day ago. Openbug complexity-simple TransformerBridge
Difficulty 3/5 Half a day Newbie friendliness 72/100
TransformerLensOrg/TransformerLens#1969 · 2 comments ·
Maintainers usually reply within 1 day
-
enhancement seen_by_maintainers TransformerBridge
Difficulty 4/5 3-5 days Newbie friendliness 30/100
TransformerLensOrg/TransformerLens#1957 · 3 comments ·
Maintainers usually reply within 1 day
-
[Proposal] KV-group destinations for direct path patching on GQA/MQA modelsPossibly taken @emerardd claimed this 6 days ago. Opencomplexity-moderate enhancement TransformerBridge
TransformerLensOrg/TransformerLens#1954 · 1 comment · 1 assignee ·
Maintainers usually reply within 1 day
All issues in TransformerLensOrg/TransformerLens
Similar issues
-
needs-area-label
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 2 days
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Official-Space-AI/OpenPhysGraspGen#114 ·
Maintainers usually reply within 2 days
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ramnes/notion-sdk-py#441 ·
-
qa_bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NVIDIA-NeMo/Gym#5644 ·
Maintainers usually reply within 2 days
-
BUG: catalog database credentials printed to logs at startupPossibly taken @cjboyle claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day