Skip to content
modelscopePublic

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

81 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrainBench: Web workbench for one-stack LLM training and auto research


English  |  中文 

Live Demo  (expo mode: remote multi-LoRA training, no local GPU) 

✨ What is TrainBench?

TrainBench is the web interface of ms-swift 5.x and twinkle. It covers the full model workflow in one place: creating and monitoring training, evaluation, export and deployment tasks, chatting with models through an agent loop with tools and skills, running long-form research sessions, and composing multi-step pipelines on a node canvas. The interface and the backend are one program: the dev server hosts the task executors, model configuration and the chat proxy, and all state lives on disk, so running jobs are not affected when the page is closed.

🧩 Full Task Lifecycle: train / eval / export / deploy / script / workflow tasks, each with creation forms, live logs and history; training tasks additionally provide real-time metric curves (loss, lr, ...) and a cross-run comparison page.
🤖 Agent Chat: tool calling with per-session approval control, side-by-side multi-model comparison with per-model token usage counters, streaming responses.
🔬 Research Sessions: the agent iterates over a research goal across turns, with every iteration's tool calls and conclusions recorded in per-session research records plus a structured event stream.
🕸️ Workflow Editor: compose training, eval, merge and deploy steps as a node graph; each run is a separate instance with its own logs and snapshot.
📁 File-Based State: task state is derived from files under TRAINBENCH_HOME (default ~/.trainbench); jobs keep running when the TrainBench stops, and every task directory contains a run.sh that can be replayed without the TrainBench.
🌍 Bilingual Interface: English and Chinese, with light / dark themes.

Installation

The TrainBench drives a Python environment that provides ms-swift 5.x. The startup command checks this requirement before binding a port, so install ms-swift first (the same environment you would use for swift commands). Node.js 18 or newer is needed only when running from source.

Install from npm:

npm install -g @modelscope/trainbench
trainbench

The trainbench command verifies ms-swift >= 5.0 in the active Python environment, then starts the server and prints its address. Point a browser at it and you are done; no separate backend process is required.

Run from source:

git clone https://github.com/modelscope/trainbench.git
cd trainbench/webui
npm install
npm run dev

Features

  • Training: creation form with parallelism planning and memory estimation, live output log, loss / lr curves parsed from the training log in real time, and a comparison page across runs.
  • Evaluation, export, deployment: the same create / list / detail pattern; a deployment is an attached swift deploy process, and once ready its endpoint is registered in the model configuration and selectable in chat.
  • Chat: conversations against configured model endpoints, agent tool loop with an approval gate that can be disabled per session, and a compare mode that sends each turn to several models at once.
  • Research: dedicated list and detail pages; sessions record the goal, the agent's tool calls and conclusions per iteration, and can be resumed.
  • Workflow: node palette covering training, evaluation, LoRA merge and deploy steps; definitions are stored as YAML, runs are separate directories with a snapshot of the definition at launch time.
  • Models, plugins, skills: model endpoints (API services or local deployments) are configured in the models page; plugins and skills extend what the agent can do.
  • Settings: a ModelScope / HuggingFace hub switch decides where models, datasets and skill listings are fetched from — it takes effect immediately and can be pinned by the TRAINBENCH_HUB or USE_HF environment variable; external data directories can be registered so the agent can analyze local datasets read-only without copying them into the workspace; plus HF / ModelScope tokens and a per-turn max-tokens cap.
  • Appearance: Settings offers independent light and dark color schemes (ice blue, warm paper, teal, violet and rose). Customize the primary and background colors with a color picker or #RGB / #RRGGBB input; text and surface colors are matched automatically. Enter or leaving the field commits a valid HEX value; Escape cancels the draft. Choosing a preset clears that group's custom colors without switching appearance mode. Preferences use the host settings file (~/.trainbench/trainbench-settings.json); expo mode keeps them only in the browser session. Task status colors and the dark workflow canvas remain unchanged.

Skills

The chat agent can load skills — instruction documents that teach it how to use a tool or a domain workflow. Skills are not authored in this repository: at build time, scripts/fetch-skills.mjs copies them from the ms-swift repository, the modelscope-skills repository and the huggingface/skills repository into public/skills/, so the three source repositories remain the single source of truth. SWIFT_SKILLS_REF, MODELSCOPE_SKILLS_REF and HF_SKILLS_REF select which ref to fetch; which group is served at runtime follows the hub switch (ModelScope by default, HuggingFace when enabled).

License

Apache License 2.0.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages