pip install xerv-crayonpip install --only-binary=:all: xerv-crayonpip install git+https://github.com/Electroiscoding/CRAYON.gitgit clone https://github.com/Electroiscoding/CRAYON.git
cd CRAYON
pip install -e .-
Install Visual Studio Build Tools (Windows):
- Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
- Select "C++ build tools" during installation
-
Install CUDA Toolkit (for GPU support):
- Download from: https://developer.nvidia.com/cuda-downloads
- Set environment variable:
set CUDA_HOME=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.x
-
Force CPU-only installation:
set CRAYON_FORCE_CPU=1 pip install xerv-crayon
- Minimum: Python 3.8
- Recommended: Python 3.10+
- Tested: 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
from crayon import CrayonVocab
# Auto-detects hardware (CUDA if available, else CPU)
tokenizer = CrayonVocab(device="auto")
tokenizer.load_profile("standard")
tokens = tokenizer.tokenize("Hello, world!")
print(f"Device: {tokenizer.device}")
print(f"Tokens: {tokens}")- ✅ Automatic Hardware Detection: CUDA, ROCm, or CPU
- ✅ Seamless Fallback: CPU if GPU unavailable
- ✅ Detailed Error Messages: Actionable debugging info
- ✅ Cross-Platform: Windows, Linux, macOS
- ✅ Multiple Python Versions: 3.8+ support
- ✅ High Performance: AVX2/AVX-512 CPU, GPU acceleration