Skip to content

refactor(examples): Consolidate and clean up example scripts #148

@m96-chan

Description

@m96-chan

Problem

Multiple large example files with overlapping functionality:

  • examples/chat_cli.py (990 lines)
  • examples/chat_cli_thinking.py (714 lines)
  • examples/chat_cli_moe.py (572 lines)
  • examples/demo_v02_full.py (633 lines)
  • examples/demo_v0210.py (593 lines)

Issues

  • Duplicated code across examples
  • Version-specific demos become stale
  • Hard to maintain

Proposed Structure

examples/
├── chat/
│   ├── basic.py         (simple chat)
│   ├── streaming.py     (streaming output)
│   ├── thinking.py      (thinking mode)
│   └── moe.py           (MoE models)
├── inference/
│   ├── benchmark.py     (performance testing)
│   └── batch.py         (batch inference)
├── audio/
│   ├── stt.py           (speech-to-text)
│   └── realtime.py      (real-time processing)
└── common/
    └── utils.py         (shared utilities)

Benefits

  • No duplicated code
  • Clear categorization
  • Easier to maintain
  • Remove stale version-specific demos

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