Skip to content

refactor(llm): Split model.py by model architecture #141

@m96-chan

Description

@m96-chan

Problem

src/pygpukit/llm/model.py is 1501 lines with multiple model implementations mixed.

Current State

src/pygpukit/llm/
└── model.py  (1501 lines - all models)

Proposed Structure

src/pygpukit/llm/models/
├── __init__.py          (exports)
├── base.py              (BaseModel, common interfaces)
├── qwen.py              (QwenModel, Qwen2, Qwen3)
├── llama.py             (LlamaModel)
├── moe.py               (MoE model support)
└── registry.py          (model registry, auto-detection)

Benefits

  • Each model in its own file
  • Easier to add new model architectures
  • Clear inheritance hierarchy
  • Model-specific optimizations isolated

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions