Contributing to UniLLM¶
Thank you for your interest in contributing to UniLLM! This guide will help you get started.
Ways to Contribute¶
Code Contributions¶
- New Models - Implement support for additional model architectures
- Bug Fixes - Fix issues in existing code
- Performance - Optimize inference speed and memory usage
- Features - Add new capabilities to the runtime
Non-Code Contributions¶
- Documentation - Improve guides, examples, and API docs
- Testing - Write tests, report bugs, verify fixes
- Examples - Create sample applications and tutorials
- Feedback - Share your experience and suggestions
Quick Start¶
- Fork and clone the repository
- Set up development environment
- Make changes following our guidelines
- Test your changes
- Submit a pull request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/unillm.git
cd unillm
# Add upstream remote
git remote add upstream https://github.com/unillm/unillm.git
# Create a branch
git checkout -b feature/my-contribution
# Make changes, then commit
git add .
git commit -m "Add feature X"
# Push to your fork
git push origin feature/my-contribution
Contribution Areas¶
Priority Areas¶
| Area | Description | Difficulty |
|---|---|---|
| GPU Backends | CUDA and Metal acceleration | High |
| KV Caching | Efficient autoregressive generation | Medium |
| New Models | Add model architectures | Medium |
| Quantized Inference | Use quantized weights directly | High |
| Production Server | HTTP API implementation | Medium |
Good First Issues¶
Look for issues labeled good-first-issue:
- Documentation improvements
- Simple bug fixes
- Test additions
- Small feature enhancements
Code Guidelines¶
General Principles¶
- Follow the three-layer abstraction - TensorCore, ModelCore, WeightLoaderCore
- Use established patterns - Look at existing models for examples
- Write tests - All new code should have tests
- Document - Add comments for complex logic
- Keep it simple - Avoid unnecessary complexity
Rust Style¶
// Good: Clear, descriptive names
fn forward_attention(&self, hidden: &Tensor, mask: &Tensor) -> Result<Tensor>
// Bad: Cryptic abbreviations
fn fwd_attn(&self, h: &Tensor, m: &Tensor) -> Result<Tensor>
See Code Style Guide for details.
Pull Request Process¶
Before Submitting¶
-
Sync with upstream
-
Run tests
-
Check formatting
-
Run clippy
PR Guidelines¶
- Clear title - Describe what the PR does
- Description - Explain why and how
- Small PRs - Easier to review
- One thing - Each PR should do one thing
- Tests - Include tests for new code
Review Process¶
- Automated checks - CI must pass
- Code review - At least one approval
- Testing - Manual testing if needed
- Merge - Squash and merge
Getting Help¶
Communication¶
- Issues - For bugs and feature requests
- Discussions - For questions and ideas
- Pull Requests - For code contributions
Resources¶
Recognition¶
Contributors are recognized in:
CONTRIBUTORS.mdfile- Release notes
- README acknowledgments
License¶
By contributing, you agree that your contributions will be licensed under the same license as the project (MIT/Apache-2.0).
Code of Conduct¶
We are committed to providing a welcoming and inclusive environment. Please:
- Be respectful and constructive
- Focus on the code, not the person
- Help others learn and grow
- Report unacceptable behavior
Thank you for contributing to UniLLM!