Skip to main content

Type stubs for the Unsloth library, providing enhanced type checking and autocompletion for Python developers.

Project description

Unsloth Stubs

PyPI version Conda Forge version

Unsloth Stubs is a collection of PEP 484 type stub files (.pyi) for the 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 and manually refined for correctness. Some tests and configs are contributed to Typeshed; see their contributors and license.

Features

  • Accurate type hints for Unsloth modules
  • Enhanced autocompletion in editors
  • Compatibility with Mypy and other type checkers
  • Easy installation via PyPI or Conda

Installation

Install from PyPI:

pip install unsloth-stubs

Or from conda-forge:

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 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unsloth_stubs-0.0.0.dev0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unsloth_stubs-0.0.0.dev0-py3-none-any.whl (39.2 kB view details)

Uploaded Python 3

File details

Details for the file unsloth_stubs-0.0.0.dev0.tar.gz.

File metadata

  • Download URL: unsloth_stubs-0.0.0.dev0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.17

File hashes

Hashes for unsloth_stubs-0.0.0.dev0.tar.gz
Algorithm Hash digest
SHA256 48df875b93f372d2b3410dcdff02057e39afe46a8daab46855303d0d0020f678
MD5 5ae6cdf25d190aaea517034e5e51bfc0
BLAKE2b-256 be518afc3aa971ee049dd745db7cab0c631ddf5bac862c8134fdbfcd555a6870

See more details on using hashes here.

File details

Details for the file unsloth_stubs-0.0.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for unsloth_stubs-0.0.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f6b195f149c4c06a3c2bd634b0cfe953da502c3bb187ddb7a704c1a0b61c4ed
MD5 b106f30552e5d3164006649d36ba8899
BLAKE2b-256 eb68f264206491d3a1a776aa5358b12fd264ab68a21946a957c59618a9fe9be7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page