Thank you for your interest in contributing to WebLLM. This guide helps contributors get set up quickly and make high-impact changes that are easy to review and merge.
We welcome contributions across the project, including:
- Bug reports with clear reproduction steps
- Bug fixes and reliability improvements
- New features and API improvements
- Performance and memory optimizations
- Tests and test coverage improvements
- Documentation updates and tutorials
- New or improved examples in
examples/ - Model integration and configuration improvements
- Code review and issue triage support
If you are unsure where to start, look for open issues in the repository and propose a plan in the issue thread before implementation.
WebLLM is part of a broader open-source ecosystem and follows collaborative, public-first development norms.
- Keep technical discussion in public, archivable channels (issues and pull requests)
- Use clear technical reasoning and seek consensus on non-trivial changes
- For major design changes, start with an issue or RFC-style proposal before coding
- Review other contributors' PRs when possible
Additional reference: Apache TVM community guidelines
- Node.js (see
.nvmrcfor the required version) - npm
- Git
Optional:
- Python 3 (for docs build)
- Emscripten/toolchain setup
git clone https://github.com/mlc-ai/web-llm.git
cd web-llm
npm installnpm run build
npm run lint
npm testNotes:
npm testruns Jest with coverage thresholds.- For quick iteration on a single test file, you can run:
npx jest --coverage=false tests/<file>.test.tsIf lint or style checks fail, run:
npm run formatPre-commit hooks (Husky + lint-staged) are configured in this repo.
To test local package changes inside an example app:
- Edit
examples/<example>/package.jsonand set"@mlc-ai/web-llm"to"../.."(or"file:../.."if needed). - Install and run the example.
cd examples/<example>
npm install
npm run startDocs are in docs/ and built with Sphinx.
cd docs
pip3 install -r requirements.txt
make htmlOpen the built docs from docs/_build/html.
Before opening a PR:
- Keep the change scoped to one problem or feature.
- Add or update tests for behavior changes.
- Update docs/examples for user-facing changes.
- Run
npm run lintandnpm testlocally. - Include a clear PR description with:
- Problem statement
- Proposed solution
- Validation steps and results
- Backward-compatibility considerations
During review:
- Respond to comments with concrete follow-ups
- Prefer additional tests over assumptions
- Keep commit history understandable (small, logical commits)
- Use GitHub Issues for bug reports and feature requests.
- Include environment details, expected vs. actual behavior, and minimal reproduction steps.
- For substantial feature additions, open an issue first to align on design and scope.
Please do not report security vulnerabilities in public issues. Report vulnerabilities via email to mlc-llm-private@googlegroups.com.
Reference:
By contributing, you agree that your contributions are provided under the repository's Apache-2.0 license.