https://github.com/danchev/unsloth-stubs
https://pypi.org/project/unsloth-stubs
https://github.com/danchev/unsloth-stubs
Last synced: 8 months ago
JSON representation
https://pypi.org/project/unsloth-stubs
- Host: GitHub
- URL: https://github.com/danchev/unsloth-stubs
- Owner: danchev
- License: mit
- Created: 2025-09-16T00:52:42.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-09-16T05:40:36.000Z (9 months ago)
- Last Synced: 2025-10-07T12:44:50.497Z (8 months ago)
- Language: Python
- Homepage:
- Size: 136 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Unsloth Stubs
[](https://pypi.org/project/unsloth-stubs/)
[](https://anaconda.org/conda-forge/unsloth-stubs)
**Unsloth Stubs** is a collection of [PEP 484](https://www.python.org/dev/peps/pep-0484/) type stub files (`.pyi`) for the [unsloth](https://pypi.org/project/unsloth/) library. These stubs provide accurate type hints for improved autocompletion, static analysis, and developer experience in Python IDEs and type checkers.
Stub files are generated using [stubgen](https://github.com/python/mypy/blob/master/mypy/stubgen.py) and manually refined for correctness. Some tests and configs are contributed to [Typeshed](https://github.com/python/typeshed/); see their [contributors](https://github.com/python/typeshed/graphs/contributors) and [license](https://github.com/python/typeshed/blob/master/LICENSE).
## Features
- Accurate type hints for Unsloth modules
- Enhanced autocompletion in editors
- Compatibility with [Mypy](http://mypy-lang.org/) and other type checkers
- Easy installation via PyPI or Conda
## Installation
Install from PyPI:
```bash
pip install unsloth-stubs
```
Or from conda-forge:
```bash
conda install -c conda-forge unsloth-stubs
```
## Usage
Once installed, type checkers (e.g., Mypy, Pytype[^1]) and autocompletion tools (e.g., Jedi) will automatically use the stubs if they are on your `PYTHONPATH`. If you need to manually add stubs, copy the `.pyi` files next to their `.py` counterparts in your Unsloth installation directory, or add the stubs directory to your `PYTHONPATH`.
Refer to [PEP 561](https://www.python.org/dev/peps/pep-0561/) for details on distributing and packaging type information.
## Compatibility
Unsloth Stubs versions follow Unsloth releases. For example, `unsloth-stubs==2025.9.5` is compatible with `unsloth>=2025.9.5`. Maintenance releases (e.g., `post1`, `post2`, ...) are reserved for annotation updates only.
## API Coverage
The stubs cover the most commonly used classes and methods in Unsloth. Full coverage is not guaranteed, but contributions are welcome!
## Project Structure
```
unsloth-stubs/
├── unsloth/
│ ├── __init__.pyi
│ ├── models/
│ ├── kernels/
│ ├── dataprep/
│ ├── registry/
│ └── utils/
└── ...
```
## Contributing
Contributions, bug reports, and suggestions are welcome! Please open an issue or pull request on GitHub.
## License & Disclaimer
Unsloth and the Unsloth logo are trademarks of their respective owners. This project is not affiliated with or endorsed by any other organization.
---
[^1]: Pytype is not officially supported or tested.